Skip to content

Commit 29a9697

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: Updating {% block javascripts position to match recipe change
2 parents 318d03d + e7d1a9e commit 29a9697

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.doctor-rst.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ whitelist:
7878
- 'The bin/console Command'
7979
- '# username is your full Gmail or Google Apps email address'
8080
- '.. _`LDAP injection`: http://projects.webappsec.org/w/page/13246947/LDAP%20Injection'
81-
- '.. versionadded:: 0.21.0' # Encore
81+
- '.. versionadded:: 1.9.0' # Encore
8282
- '.. versionadded:: 0.28.4' # Encore
8383
- '.. versionadded:: 2.4.0' # SwiftMailer
8484
- '.. versionadded:: 1.30' # Twig

frontend/encore/simple-example.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,18 @@ can do most of the work for you:
104104
<!-- Renders a link tag (if your module requires any CSS)
105105
<link rel="stylesheet" href="/build/app.css"> -->
106106
{% endblock %}
107-
</head>
108-
<body>
109-
<!-- ... -->
110107

111108
{% block javascripts %}
112109
{{ encore_entry_script_tags('app') }}
113110

114111
<!-- Renders app.js & a webpack runtime.js file
115-
<script src="/build/runtime.js"></script>
116-
<script src="/build/app.js"></script> -->
112+
<script src="/build/runtime.js" defer></script>
113+
<script src="/build/app.js" defer></script>
114+
See note below about the "defer" attribute -->
117115
{% endblock %}
118-
</body>
116+
</head>
117+
118+
<!-- ... -->
119119
</html>
120120

121121
.. _encore-entrypointsjson-simple-description:
@@ -135,11 +135,14 @@ If you're *not* using Symfony, you can ignore the ``entrypoints.json`` file and
135135
point to the final, built file directly. ``entrypoints.json`` is only required for
136136
some optional features.
137137

138-
.. versionadded:: 0.21.0
138+
.. versionadded:: 1.9.0
139139

140-
The ``encore_entry_link_tags()`` comes from WebpackEncoreBundle and relies
141-
on a feature in Encore that was first introduced in version 0.21.0. Previously,
142-
the ``asset()`` function was used to point directly to the file.
140+
The ``defer`` attribute on the ``script`` tags delays the execution of the
141+
JavaScript until the page loads (similar to putting the ``script`` at the
142+
bottom of the page). The ability to always add this attribute was introduced
143+
in WebpackEncoreBundle 1.9.0 and is automatically enabled in that bundle's
144+
recipe in the ``config/packages/webpack_encore.yaml`` file. See
145+
`WebpackEncoreBundle Configuration`_ for more details.
143146

144147
Requiring JavaScript Modules
145148
----------------------------
@@ -355,3 +358,4 @@ Encore supports many more features! For a full list of what you can do, see
355358

356359
.. _`Encore's index.js file`: https://github.com/symfony/webpack-encore/blob/master/index.js
357360
.. _`ECMAScript 6 modules`: https://hacks.mozilla.org/2015/08/es6-in-depth-modules/
361+
.. _`WebpackEncoreBundle Configuration`: https://github.com/symfony/webpack-encore-bundle#configuration

introduction/from_flat_php_to_symfony.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,10 @@ The ``layout.php`` file is nearly identical:
609609
<meta charset="UTF-8">
610610
<title>{% block title %}Welcome!{% endblock %}</title>
611611
{% block stylesheets %}{% endblock %}
612+
{% block javascripts %}{% endblock %}
612613
</head>
613614
<body>
614615
{% block body %}{% endblock %}
615-
{% block javascripts %}{% endblock %}
616616
</body>
617617
</html>
618618

0 commit comments

Comments
 (0)