Skip to content

Commit dea24f6

Browse files
committed
Merge branch '6.2' into 6.3
* 6.2: Updating UX docs to install the new StimulusBundle
2 parents 4f56d81 + df7716b commit dea24f6

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

frontend/encore/simple-example.rst

+12-10
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ After :doc:`installing Encore </frontend/encore/installation>`, your app already
55
has 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

1310
With Encore, think of your ``app.js`` file like a standalone JavaScript
1411
application: 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
2724
your app needs. Encore can do a lot more: minify files, pre-process Sass/LESS,
2825
support 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-
3327
Configuring Encore/Webpack
3428
--------------------------
3529

@@ -222,10 +216,18 @@ easy to attach behavior to HTML. It's powerful, and you will love it! Symfony
222216
even provides packages to add more features to Stimulus. These are called the
223217
Symfony 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

230232
Let's look at a simple Stimulus example. In a Twig template, suppose you have:
231233

0 commit comments

Comments
 (0)