-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
Moving scripts to <head> by default #874
Conversation
With <script defer, execution is still done after page load, but is more performant and works will with Turbo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request passes validation.
Besides the docs and videos, it also has a big impact (like any recipe change that does not target the next Symfony version) on the book. I've mentioned that in the past, but I think we should not make such changes in past version and limit them to the next minor version. |
I forgot to mention that it also makes some blog posts not working anymore. If one tries to follow the book examples, the patches won't apply cleanly anymore. That should not happen IMHO. We should not break the past. |
…hange (weaverryan) This PR was merged into the 4.4 branch. Discussion ---------- Updating {% block javascripts position to match recipe change Hi! See symfony/recipes#874 I did this against 4.4 (which is normally done for bug fixes) because this *would* appear as a "documentation bug" if we updated the recipe but didn't update the docs. Thanks! Commits ------- 8c2c794 Updating {% block javascripts position to match recipe change
Hi!
This is "kind of" a big change from a documentation POV, though the docs PR to update things was very small (and I'll check SymfonyCasts for any notes needed).
Having
script
tags in thehead
is more performant (and works well with Turbo) AND has the same behavior as putting the scripts at the bottom as long as you use<script defer
. In WebpackEncore 1.9, you can now specify to adddefer
automatically on all script tags and the new 1.9 recipe enables this by defaultSo, things should "just work" like before, but some docs will need to be updated.
TODO