@@ -5,10 +5,7 @@ After :doc:`installing Encore </frontend/encore/installation>`, your app already
55has a few files, organized into an ``assets/ `` directory:
66
77* ``assets/app.js ``
8- * ``assets/bootstrap.js ``
9- * ``assets/controllers.json ``
108* ``assets/styles/app.css ``
11- * ``assets/controllers/hello_controller.js ``
129
1310With Encore, think of your ``app.js `` file like a standalone JavaScript
1411application: it will *require * all of the dependencies it needs (e.g. jQuery or React),
@@ -27,9 +24,6 @@ statements and create one final ``app.js`` (and ``app.css``) that contains *ever
2724your app needs. Encore can do a lot more: minify files, pre-process Sass/LESS,
2825support React, Vue.js, etc.
2926
30- The other files - ``bootstrap.js ``, ``controllers.json `` and ``hello_controller.js ``
31- relate to a topic you'll learn about soon: `Stimulus & Symfony UX `_.
32-
3327Configuring Encore/Webpack
3428--------------------------
3529
@@ -222,10 +216,18 @@ easy to attach behavior to HTML. It's powerful, and you will love it! Symfony
222216even provides packages to add more features to Stimulus. These are called the
223217Symfony UX Packages.
224218
225- If you followed the setup instructions, you should already have Stimulus installed
226- and ready to go! In fact, that's the purpose of the ``assets/bootstrap.js `` file:
227- to initialize Stimulus and automatically load any "controllers" from the
228- ``assets/controllers/ `` directory.
219+ To use Stimulus, first install StimulusBundle:
220+
221+ .. code-block :: terminal
222+
223+ $ composer require symfony/stimulus-bundle
224+
225+ The Flex recipe should add several files/directories:
226+
227+ * ``assets/bootstrap.js `` - initializes Stimulus;
228+ * ``assets/controllers/ `` - a directory where you'll put your Stimulus controllers;
229+ * ``assets/controllers.json `` - file that helps load Stimulus controllers form UX
230+ packages that you'll install.
229231
230232Let's look at a simple Stimulus example. In a Twig template, suppose you have:
231233
0 commit comments