Skip to content

Commit 91538f2

Browse files
committed
Merge remote-tracking branch 'upstream/3.3' into 3.3
2 parents bd360d5 + c59d283 commit 91538f2

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

frontend.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ to solve the most common Webpack use cases.
2525
Encore is made by `Symfony`_ and works *beautifully* in Symfony applications.
2626
But it can easily be used in any application... in any language!
2727

28+
.. _encore-toc:
29+
2830
Encore Documentation
2931
--------------------
3032

frontend/encore/simple-example.rst

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ an ``assets/`` directory:
77
* ``assets/js/app.js``
88
* ``assets/css/app.scss``
99

10-
Let's consider that the project follows the recommended practice of importing
11-
the CSS files for their associated JavaScript files:
10+
With Encore, you should think of CSS as a *dependency* of your JavaScript. This means,
11+
you will *require* whatever CSS you need from inside JavaScript:
1212

1313
.. code-block:: javascript
1414
@@ -38,9 +38,6 @@ Inside, use Encore to help generate your Webpack configuration.
3838
// the public path used by the web server to access the previous directory
3939
.setPublicPath('/build')
4040
41-
// empty the outputPath dir before each build
42-
.cleanupOutputBeforeBuild()
43-
4441
// will create web/build/app.js and web/build/app.css
4542
.addEntry('app', './assets/js/app.js')
4643
@@ -52,6 +49,12 @@ Inside, use Encore to help generate your Webpack configuration.
5249
5350
.enableSourceMaps(!Encore.isProduction())
5451
52+
// empty the outputPath dir before each build
53+
.cleanupOutputBeforeBuild()
54+
55+
// show OS notifications when builds finish/fail
56+
.enableBuildNotifications()
57+
5558
// create hashed filenames (e.g. app.abc123.css)
5659
// .enableVersioning()
5760
;
@@ -146,15 +149,16 @@ Great! Use ``require()`` to import ``jquery`` and ``greet.js``:
146149
147150
That's it! When you build your assets, jQuery and ``greet.js`` will automatically
148151
be added to the output file (``app.js``). For common libraries like jQuery, you
149-
may want also to :doc:`create a shared entry </frontend/encore/shared-entry>` for better performance.
152+
may want to :doc:`create a shared entry </frontend/encore/shared-entry>` for better
153+
performance.
150154

151155
Multiple JavaScript Entries
152156
---------------------------
153157

154158
The previous example is the best way to deal with SPA (Single Page Applications)
155-
and very simple applications. However, as your application grows, you'll need to
156-
define more entries with the JavaScript and CSS code of some specific sections
157-
(homepage, blog, store, etc.)
159+
and very simple applications. However, as your app grows, you may want to have
160+
page-specific JavaScript or CSS (e.g. homepage, blog, store, etc.). To handle this,
161+
add a new "entry" for each page that needs custom JavaScript or CSS:
158162

159163
.. code-block:: javascript
160164
@@ -166,5 +170,10 @@ define more entries with the JavaScript and CSS code of some specific sections
166170
;
167171
168172
If those entries include CSS/Sass files (e.g. ``homepage.js`` requires
169-
``assets/css/homepage.scss``), two files will be generated for each of them
173+
``assets/css/homepage.scss``), two files will be generated for each:
170174
(e.g. ``build/homepage.js`` and ``build/homepage.css``).
175+
176+
Keep Going!
177+
-----------
178+
179+
Go back to the :ref:`Encore Top List <encore-toc>` to learn more and add new features.

session/locale_sticky_session.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Making the Locale "Sticky" during a User's Session
55
==================================================
66

77
Symfony stores the locale setting in the Request, which means that this setting
8-
is not automtically saved ("sticky") across requests. But, you *can* store the locale
8+
is not automatically saved ("sticky") across requests. But, you *can* store the locale
99
in the session, so that it's used on subsequent requests.
1010

1111
.. _creating-a-LocaleSubscriber:

session/php_bridge.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ the example below:
9090
override this. Instead set ``handler_id: ~``. Note that a save handler
9191
cannot be changed once the session has been started. If the application
9292
starts the session before Symfony is initialized, the save handler will
93-
have already been set. In this case, you will need ``handler_id: ~``.
93+
have already been set. In this case, you will need ``handler_id: ~``.
9494
Only override the save handler if you are sure the legacy application
9595
can use the Symfony save handler without side effects and that the session
9696
has not been started before Symfony is initialized.

0 commit comments

Comments
 (0)