8000 [AssetMapper] Improve link generation script by smnandre · Pull Request #52869 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[AssetMapper] Improve link generation script #52869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

smnandre
Copy link
Member
@smnandre smnandre commented Dec 2, 2023
Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

Avoid JS console warnings due to missing comma and shorten a bit the code
(document.head is available since IE9)

Felt on it while investigating this HTTPS/2/Push thing with Firefox

(poke @weaverryan)

Update: remove the "?" after 7.1 to please carson :)
Update(bis): target 6.4 / bugfix

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.1" but it seems your PR description refers to branch "7.1 ?".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@nicolas-grekas
Copy link
Member

let's do this on 6.4 as a bugfix

@@ -92,7 +92,8 @@ public function testBasicRender()
$this->assertStringContainsString('"app_css_preload": "data:application/javascript,', $html);
$this->assertStringContainsString('<link rel="stylesheet" href="/subdirectory/assets/styles/app-preload-d1g35t.css">', $html);
// non-preloaded CSS file
$this->assertStringContainsString('"app_css_no_preload": "data:application/javascript,const%20d%3Ddocument%2Cl%3Dd.createElement%28%22link%22%29%3Bl.rel%3D%22stylesheet%22%2Cl.href%3D%22%2Fsubdirectory%2Fassets%2Fstyles%2Fapp-nopreload-d1g35t.css%22%2C%28d.head%7C%7Cd.getElementsByTagName%28%22head%22%29%5B0%5D%29.appendChild%28l%29', $html);
// $this->assertStringContainsString('"app_css_no_preload": "data:application/javascript,document.head.appendChild(Object.assign(document.createElement("link"),{rel:"stylesheet",href:"/subdirectory/assets/styles/app-nopreload-d1g35t.css"})', $html);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this commented line ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this commented line ?

The deleted was the old test

The new "commented" line is the humanely readable version of the new test the following line.

You do feel it's useless ?

Copy link
Member
@nicolas-grekas nicolas-grekas Dec 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is, a commented line like this one is not useful for humans (and even less for computers)

@nicolas-grekas
Copy link
Member

looks like a rebase is missing :)

@smnandre smnandre force-pushed the asset-mapper-link-script branch from 76788f3 to 0d7fcb7 Compare December 26, 2023 16:58
@smnandre
Copy link
Member Author

looks like a rebase is missing :)

Dropped all commits but mine..

I have this special power to destroy git histories like no-one.. so please double-check i've not done anything wrong there 😅

@nicolas-grekas nicolas-grekas force-pushed the asset-mapper-link-script branch from 0d7fcb7 to 5ad7a1e Compare December 27, 2023 08:04
@nicolas-grekas
Copy link
Member
nicolas-grekas commented Dec 27, 2023 8000

Thank you @smnandre.

@nicolas-grekas nicolas-grekas merged commit c12ab3d into symfony:6.4 Dec 27, 2023
This was referenced Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0