Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine

Setting up Webpack Encore

Video not working?

It looks like your browser may not support the H264 codec. If you're using Linux, try a different browser or try installing the gstreamer0.10-ffmpeg gstreamer0.10-plugins-good packages.

Thanks! This saves us from needing to use Flash or encode videos in multiple formats. And that let's us get back to making more videos :). But as always, please feel free to message us.

So let's get Webpack Encore installed so we can get a proper CSS and JavaScript build system set up.

Installing Encore

Find your terminal and run:

composer require "encore:^1.14"

Tip

If you're using version 2 or higher of symfony/webpack-encore-bundle, be sure to also run:

composer require symfony/stimulus-bundle

The recipe needed to integrate the Symfony UX libraries was moved to this new bundle.

This really installs WebpackEncoreBundle, which will give us a few Twig helper functions. But its true superpower is its recipe.

The Encore Recipe Files

After Composer finishes, run:

git status

Ok: it modified several files, most of which make sense. The .gitignore file is now ignoring the node_modules/ directory and the bundle was automatically enabled in config/bundles.php.

There are also several new config files, which mostly aren't too important. What is important is that it created a package.json file. Let's go check that out. This defines several things that our Webpack Encore setup needs, like Encore itself and stimulus, which we'll talk more about later.

The other hugely important file the recipe added was webpack.config.js - with a basic setup. The recipe also added this assets/ directory. There are a few things in here related to Stimulus: the "controllers" stuff and bootstrap.js. We'll talk about those soon.

To download the dependencies described in package.json, find your terminal and run:

yarn install

Oh, and if you're totally new to Encore and want to dig into it deeper, check out our Webpack Encore: Frontend like a Pro! course.

The Entry Files and First Build

Right now, our app has a pretty standard Webpack Encore setup. We have one entry which is this assets/app.js file. That means that when we build our assets in a few minutes, Webpack will only look at this file to figure out all the JavaScript and CSS needed in the project. It will then output the final, built CSS and JavaScript files into a public/build/ directory.

Of course, when it reads this file, it will follow any imports, like this import of ./styles/app.css... which is a dummy file that sets the background-color to gray.

So, once we have executed Encore and built the assets - which we'll do in a minute - we're going to need script and link tags that point to those new files.

encore_entry_link_tags() & encore_entry_script_tags()

Let's add those to our base layout: templates/base.html.twig.

I already have a couple of link tags up here in the stylesheets block. Add {{ encore_entry_link_tags() }} and pass it app, which is name of that entry.

... lines 1 - 2
<head>
... lines 4 - 5
{% block stylesheets %}
... lines 7 - 9
{{ encore_entry_link_tags('app') }}
{% endblock %}
... lines 12 - 15
</head>
... lines 17 - 76

This will render the built version of the app.css file plus any other CSS that our JavaScript imports. And actually, for performance reasons, Webpack may split that built app.css into multiple files: we'll see that in a few minutes. This function takes care of including all the link tags we need.

Do the same thing in the javascripts block: {{ encore_entry_script_tags() }} and pass app.

... lines 1 - 2
<head>
... lines 4 - 12
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock %}
</head>
... lines 17 - 76

Like with the styles, this will render the built version of app.js plus any JavaScript it imports. And it may also be split into multiple files.

The New <script> defer Attribute

Oh, and you're seeing a recent change in Symfony's TwigBundle recipe for base.html.twig. The javascripts block used to live down here at the bottom of the page. Now it lives up in the head in new projects. Normally... that would not be a good idea, because when your browser sees a script tag, it stops rendering the page until it can download and execute that JavaScript.

But thanks to a new feature in WebpackEncoreBundle - you can see it in config/packages/webpack_encore.yaml, here it is script_attributes - every script tag rendered by Encore will have a defer attribute. That basically means that the JavaScript isn't executed until after the page loads, very similar to having the scripts at the bottom of the page. But with the new setup, our browser does start downloading the files slightly earlier. And this plays nicer with Turbo - the topic of our next tutorial.

If you want to learn more about this change, check out a blog post I wrote on Symfony.com.

Next: let's use Encore to build our assets, see "code splitting" in action and import a third-party CSS package.

Leave a comment!

35
Login or Register to join the conversation
Tac-Tacelosky Avatar
Tac-Tacelosky Avatar Tac-Tacelosky | posted 1 month ago

I'm ridiculously excited about not needing this step and using AssetMapper instead. In the meantime, is it possible to use both AssetMapper and WebpackEncore in the same project, while migrating to just AssetMapper?

I know, I need to be patient and wait for https://symfonycasts.com/screencast/asset-mapper/stimulus -- can't wait!

Reply

Hey @Tac-Tacelosky!

I'm ridiculously excited about not needing this step

There are a few rough edges still (which we talk about in the tutorial), but yea, it's fun :).

In the meantime, is it possible to use both AssetMapper and WebpackEncore in the same project, while migrating to just AssetMapper?

Probably not. Well, it definitely is possible, but I think it will be too easy to "cross wires" both in the code and mentally for this to be worth it. Migrating is both simple but tedious:

A) Most items (everything you actually USE in your JavaScript, so everything except for encore, & other build toolds) in package.json should be added to importmap.php via importmap:require
B) All ./relative imports need to change to ./relative.js
C) CSS needs to be updated to add a link tag to base.html.twig (and anywhere you're importing CSS from inside a JS file needs to be reworked).

... and I think that might be it. I did it on ux.symfony.com and Jolicode did it on a fun app they built - https://github.com/jolicode/qotd/pull/53. The reason I won't typically recommend that people switch (unless they really want to) is that it's a bunch of work that takes you from a functional system to a functional system :P. Not a lot of immediate gain. But if the build system is giving you a headache, then it could totally be worth it.

Cheers!

Reply
Chris N. Avatar
Chris N. Avatar Chris N. | posted 1 year ago

I was using PHP 8.0 (which the composer,json seems to support) but the flex recipes wouldn't run. This prevented me from running `yarn install` because the package.json didn't exist (along with other config changes to the project).

Important note for everyone, be sure to use PHP 7.4 and then run the `composer install` first before moving on through the tutorial.

Reply

Hey Chris,

We're sorry for this. Yes, this course should work on PHP 8, you're right. We will take a closer look why it does not work. Could you share a bit more information what exactly was wrong on PHP 8? Did you have any errors in the console?

P.s. thanks for sharing a temporary workaround with others suggesting using PHP 7.4!

Cheers!

Reply
Chris N. Avatar

No problem. I've just downloaded the project code again. Using the "start" directory.
PHP 8.0.16 - Composer version 2.2.6 2022-02-04 17:00:38 (MacOS 12.2.1, PHP, etc, installed via brew)
`composer install` produces the new "trust" prompt from composer for symfony/flex - I choose 'y'
Composer seems to run just fine. The post-install scripts run (cache:clear, assets:install)

```
~/Downloads/code-stimulus/start
❯ composer require encore
Using version ^1.14 for symfony/webpack-encore-bundle
./composer.json has been updated
Running composer update symfony/webpack-encore-bundle
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking symfony/webpack-encore-bundle (v1.14.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing symfony/webpack-encore-bundle (v1.14.0): Extracting archive
Generating optimized autoload files
75 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Run composer recipes at any time to see the status of your Symfony recipes.

Executing script cache:clear [OK]
Executing script assets:install public [OK]
```
No evidence the flex recipes have run. No package.json, the bundles.php has not been modified.

However, running the same steps from PHP 7.4.28 and everything works as expected.

I hope this helps.

Reply

Hey Chris N.!

Sorry for the short reply - Victor wanted to continue helping you with this, but he's currently unavailable. But I'm happy to fill in :).

This is *super* weird. I just tried it myself and it works. However, 12 days ago (so 2 days after you posted this), we added the little change to composer.json so that Flex is already trusted (without it needing to ask you). But even without this, I can't imagine what difference PHP 7.4 would make vs PHP 8 for this - that is a mystery.

Cheers!

Reply
Chris N. Avatar

I agree, super weird. I've not had any other Flex related issues - but then, I don't install a fresh project that often. Maybe just a weird combination of packages and bad timing. Composer, Symfony, etc, have all had updates since I first posted this. If I get change, I'll try it again and will only post if it still fails.
Thanks all. Keep up the great work.

Reply
Marco P. Avatar
Marco P. Avatar Marco P. | posted 2 years ago | edited

Hi,
I have a symfony app with webpack 0.30.0, what is the correct procedure to install stymulus? I am attaching my package.json


{
    "devDependencies": {
        "@symfony/webpack-encore": "^0.30.0",
        "autocomplete.js": "^0.37.1",
        "autoprefixer": "^9.8.4",
        "axios": "^0.20.0",
        "bootstrap": "^4.5.0",
        "core-js": "^3.0.0",
        "eslint": "^7.6.0",
        "eslint-plugin-vue": "^7.0.0-beta.2",
        "jquery": "^3.5.1",
        "node-sass": "4.13.0",
        "popper.js": "^1.16.1",
        "postcss-loader": "^3.0.0",
        "regenerator-runtime": "^0.13.2",
        "sass-loader": "8.0.0",
        "vue": "^2.6.11",
        "vue-loader": "15.9.1",
        "vue-template-compiler": "^2.6.11",
        "webpack-notifier": "^1.6.0"
    },
    "license": "UNLICENSED",
    "private": true,
    "scripts": {
        "dev-server": "encore dev-server",
        "dev": "encore dev",
        "watch": "encore dev --watch",
        "build": "encore production --progress"
    },
    "dependencies": {
        "@sweetalert2/themes": "3.2.0",
        "bootstrap-vue": "^2.17.1",
        "chart": "^0.1.2",
        "chart.js": "^2.9.3",
        "color": "^3.1.2",
        "css-loader": "^4.2.1",
        "eslint-config-airbnb-base": "^14.2.0",
        "eslint-plugin-import": "^2.22.0",
        "flag-icon-css": "^3.5.0",
        "font-awesome": "^4.7.0",
        "lodash": "^4.17.20",
        "material-design-icons": "^3.0.1",
        "material-design-icons-iconfont": "^5.0.1",
        "perfect-scrollbar": "^1.5.0",
        "progressbar.js": "^1.1.0",
        "react": "^16.13.1",
        "react-dom": "^16.13.1",
        "select2": "^4.0.13",
        "sweetalert2": "^9.17.0",
        "themify-icons": "^1.0.0",
        "ti-icons": "^0.1.2",
        "typicons.font": "^2.0.9",
        "validate-color": "^2.1.0",
        "vue-sweetalert-icons": "^4.3.0",
        "vue-sweetalert2": "3.0.8",
        "vuedraggable": "^2.24.3",
        "x-editable": "^1.5.1"
    },
    "browserslist": [
        "> 5%"
    ]
}

Thanks

Reply

Hey Marco,

First of all, commit all the changes in the project to have a clear repo. Then, upgrade your symfony/webpack-encore-bundle to the latest available version. You can do it with Composer, execute:

$ composer update symfony/webpack-encore-bundle

And make sure you have the latest version installed, currently I see it's v1.12.0.

Then, upgrade its recipe, you can do this with Composer again:

$ composer recipe:install symfony/webpack-encore-bundle --force

And after this use git diff to check the changes, you may want to revert some default code to your custom that you had before, but you want to keep the new changes related to Stimulus. After you validate the changes and sync them together - it should work. Don't forget to run "yarn install" and "yarn watch" after to make sure you pull new Node JS dependencies.

I hope this helps!

Cheers!

Reply
Pawel Avatar
Pawel Avatar Pawel | Victor | posted 1 year ago | edited

I tried this , but after
yarn add bootstrap --dev
get message
<blockquote>error @symfony/webpack-encore@2.1.0: The engine "node" is incompatible with this module. Expected version "^12.13.0 || >=14.0.0". Got "12.5.0"
error Found incompatible module.</blockquote>
My configuration
node v16.16.0, php 8.1.6 npm 8.15.1

How can I solve this better ?

yarn install --ignore-engines enable to run yarn watch, but it not perfect i suppose.

Reply

Hey Pawel,

Hm, are you sure you have Node v16 installed? Because the error message says that you have v12.5.0. Please, double check the node version. And it seems like you have to upgrade it to the ^12.13.0 at least as it's said in the error message.

I think you can check it with "node --version" in your terminal.

Another possible solution - try to upgrade dependencies, it might help, but also may cause more issue.

Cheers!

Reply
Pawel Avatar

yes, command "node -v" return value v16.16.0

Reply

Hey Pawel,

Ah, looks like the error is related to the "engine" key in that package.json of that @ symfony/webpack-encore package, for example see that file https://github.com/symfony/... . So, looks like the package installed in the project requires the node 12.5.0 explicitly, and most probably you either need to downgrade your NodeJS to that version, or upgrade dependencies that may cause some issues but probably might be worth to try, or just use that "--ignore-engines" option when you install Yarn deps - it should be OK for learning purposes when you work around the course project code to follow the tutorial.

I hope this helps!

Cheers!

Reply
Marco P. Avatar
Marco P. Avatar Marco P. | Victor | posted 2 years ago | edited

`Running webpack ...

WARNING Webpack Encore requires version ^4.0.0 || ^5.0.0 of postcss-loader, but your version (3.0.0) is too old. The related feature will probably not work correctly.
WARNING Webpack Encore requires version ^4.0.0 || ^5.0.0 of postcss-loader, but your version (3.0.0) is too old. The related feature will probably not work correctly.
WARNING Webpack Encore requires version ^9.0.1 || ^10.0.0 || ^11.0.0 || ^12.0.0 of sass-loader, but your version (8.0.0) is too old. The related feature will probably not work correctly.
WARNING Webpack Encore requires version ^4.0.0 || ^5.0.0 of postcss-loader, but your version (3.0.0) is too old. The related feature will probably not work correctly.
WARNING Webpack Encore requires version ^9.0.1 || ^10.0.0 || ^11.0.0 || ^12.0.0 of sass-loader, but your version (8.0.0) is too old. The related feature will probably not work correctly.
WARNING Webpack Encore requires version ^4.0.0 || ^5.0.0 of postcss-loader, but your version (3.0.0) is too old. The related feature will probably not work correctly.
WARNING Webpack Encore requires version ^15.9.5 of vue-loader, but your version (15.9.1) is too old. The related feature will probably not work correctly.
RECOMMEND To create a smaller (and CSP-compliant) build, see https://symfony.com/doc/current/frontend/encore/vuejs.html#runtime-compiler-build
[webpack-cli] Error: Compiling RuleSet failed: Properties generator are unknown (at ruleSet[0].rules[0].oneOf[1]: [object Object])

at RuleSetCompiler.error (/Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:373:10)
at RuleSetCompiler.compileRule (/Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:196:15)
at /Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:154:9
at Array.map (<anonymous>)
at RuleSetCompiler.compileRules (/Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:153:16)
at RuleSetCompiler.compileRule (/Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:192:30)
at /Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:154:9
at Array.map (<anonymous>)
at RuleSetCompiler.compileRules (/Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:153:16)
at RuleSetCompiler.compileRule (/Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:184:30)
at /Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:154:9
at Array.map (<anonymous>)
at RuleSetCompiler.compileRules (/Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:153:16)
at RuleSetCompiler.compile (/Users/prest90/development/DataNet/node_modules/webpack/lib/rules/RuleSetCompiler.js:68:22)
at VueLoaderPlugin.apply (/Users/prest90/development/DataNet/node_modules/vue-loader/lib/plugin-webpack5.js:45:39)
at createCompiler (/Users/prest90/development/DataNet/node_modules/webpack/lib/webpack.js:74:12)

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
`

i tried but i get the following errors, unfortunately these packages are needed!

i have updated these packages and everything seems to work, now i have to do some testing.

Thank you very much for helping!

Reply
Marco P. Avatar

Hi, after updating on some older browsers I get the error ReferenceError: Can't find variable: globalThis. Is there any setting in webpack to solve the problem? Thank you

Reply

Hey Marco,

Hm, could you link me to the chapter where we have that "globalThis" variable? I can't find it, probably you made a misprint in yoir code? Try to do "git grep globalThis" to find that spot, or search in files with PhpStorm, it should help too. Most probably you just need to fix that misprint :)

Cheers!

Reply
Marco P. Avatar
Marco P. Avatar Marco P. | Victor | posted 2 years ago | edited

I noticed that after the update
(self.webpackChunk = self.webpackChunk || [])
has become
(globalThis ["webpackChunk"] = globalThis ["webpackChunk"] || [])
could it be something related to Babel?

Reply

Hey Marco,

Hm, that file is autogenerated, and so different versions may generate a slightly different code. What exactly it should be - difficult to say, I'd suppose that the code you have in that file is correctly generated by the Webpack. I think you need to find a problem in a different place. First of all, make sure you upgraded your symfony/webpack-encore-bundle which is v1.12.0 for today, you can check it with "composer info symfony/webpack-encore-bundle". Then, sync its recipe in your project. You can do it by leveraging "symfony recipe:installl --force" command or manually, coping the latest changes in the recipe manually into your project from https://github.com/symfony/... . Then, make sure you use the same minimum constraints for the JS dependencies in package.json and install the deps with "yarn install". I'd suggest you to completely remove the node_modules/ directory first and install the fresh deps from scratch just in case. And finally, compile your assets with webpack, usually it's just "yarn watch" but depends on your project.

Also, after recompiling the assets, I'd recommend you to try in Chrome Incognito mode just in case the browser cached some JS files locally.

I hope this helps!

Cheers!

Reply
Marco P. Avatar

Hi, thanks for the help you are giving me! I have compared the symfony/webpack-encore-bundle files with my project and I can't find any differences. Then I compared the @babel folder in node_modules with a working project and there are differences. I tried to replace this folder with the one of the working project but the yarn watch and yarn build scripts no longer work! Luckily I had made a backup and put everything back in place. Can @babel be updated without breaking everything? Before making updates I would like to know how to make a backup, thank you very much for your patience

Reply

Hey Marco,

Hm, are you sure the constraints you have in your packages.json for deps are exactly the same as in the recipe? If you think that Babel version installed in your project is the problem - try to figure out what version is installed on working project, and install the exact same version in your project, you can specify the exact version of Babel in packages.json. I only see this way of solving then

Cheers!

Reply
Marco P. Avatar

hi Victor,
the problem is that in the package.json file of the two projects there is no babel, only @babel/preset-react is present but in node_modules I have @babel, babel-loader etc ... I think they have been installed as a dependency of some other package.

Cheers!

Reply

Hey Marco,

Yes, you're right, most probably that was installed as a dependency of another direct dependency that you have in your packages.json file.

Cheers!

Reply
Marco P. Avatar
Marco P. Avatar Marco P. | Victor | posted 2 years ago | edited

Hi .... I'm going crazy! When I install a package with yarn I get these warnings:

warning "@symfony/webpack-encore> @babel/preset-env> @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@ 7.14.5" has incorrect peer dependency "@babel/core @^7.13.0 ".`<br />warning "@symfony/webpack-encore> @babel/preset-env> @babel/plugin-proposal-class-static-block @7.14.5" has incorrect peer dependency "@babel/core @^7.12.0".

I think they could be the cause of the problem!
Thank you

Reply

Hey Marco P.

Have you tried upgrading and clearing Yarn's cache? those warnings seems odd to me. I'd try deleting the node_modules directory and reinstall it, in case nothing works

Cheers!

Reply
Marco P. Avatar
Marco P. Avatar Marco P. | MolloKhan | posted 2 years ago | edited

Hi,
I deleted the node_modules directory and launched yarn run ... the errors remain. Fortunately, everything still seems to work! The problem is that since I updated webpack-encore-bundle to make Stimulus work, after compiling with yarn build I get all the .js files with the globalThis variable as they were previously generated with self. The application is run by several browsers and not all of them support globalThis. Cheers!

Reply

Ohh that makes sense. I think you're missing Babel's polyfill, try installing it in your project https://babeljs.io/docs/en/...

Cheers!

Reply
Marco P. Avatar
Marco P. Avatar Marco P. | MolloKhan | posted 2 years ago | edited

Hi Diego,
actually polifill was not installed, I ran: yarn add @babel/polyfill ...the error remains! I realized that the packages that give the error require a more up-to-date version of @babel/core so I ran yarn add @babel/core. Then I installed the packages that made the compilation fail: yarn add @babel/plugin-syntax-dynamic-import, yarn add @babel/plugin-proposal-class-properties, yarn add @babel/preset-env. There are no more errors !!! ... but the GlobalThis variable remained🙁

1 Reply

It seems like the GlobalThis is not part of Babel's polyfill. I found this library that may help you out, you can give it a try :)
https://www.npmjs.com/packa...

Cheers!

Reply
Marco P. Avatar

is in several files: runtime.js jsonp chunk loading, line 46 var chunkLoadingGlobal = globalThis ["webpackChunk"] = globalThis ["webpackChunk"] || []; but there are others

Reply
Macarena I. Avatar
Macarena I. Avatar Macarena I. | posted 2 years ago | edited

I have problems width encore instalation:
`/usr/bin/node /usr/local/lib/node_modules/yarn/bin/yarn.js install
yarn install v1.22.10
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
warning urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @symfony/webpack-encore > resolve-url-loader > rework > css > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @symfony/webpack-encore > resolve-url-loader > rework > css > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @symfony/webpack-encore > resolve-url-loader > rework > css > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
[2/4] Fetching packages...
error webpack-dev-server@4.0.0-beta.3: The engine "node" is incompatible with this module. Expected version ">= 12.13.0". Got "10.19.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Process finished with exit code 1
`

Reply

Hey Macarena I.

It seems like your Node version it's kind of old, try upgrading it to version 12.13 at least, and give it another shot.

Cheers!

Reply

Git status is fine :) Buuuuuutt git not initialized and no docs about it ..... Houpe it help to create Best Of The Best Tutorial

Reply

Hey Mepcuk

Yea, you're right, we don't say anything about git in the README, though, it's quite simple, you only have to run git init on the root of your project and answer the questions. I hope it helps

Cheers!

Reply

Thanks a lot, i know... but if this tutorial will watch young developer, it maybe create him a problem. Just all tuto is step by step, there are look missing small step..

Thanks for reply 😉

Reply

Yea, I agree. I'm going to talk about it with the team. Thanks for your feedback!

Reply
Cat in space

"Houston: no signs of life"
Start the conversation!

This tutorial works perfectly with Stimulus 3!

What PHP libraries does this tutorial use?

// composer.json
{
    "require": {
        "php": ">=8.1",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "composer/package-versions-deprecated": "1.11.99.1", // 1.11.99.1
        "doctrine/annotations": "^1.0", // 1.11.1
        "doctrine/doctrine-bundle": "^2.2", // 2.2.3
        "doctrine/doctrine-migrations-bundle": "^3.0", // 3.0.2
        "doctrine/orm": "^2.8", // 2.8.1
        "phpdocumentor/reflection-docblock": "^5.2", // 5.2.2
        "sensio/framework-extra-bundle": "^5.6", // v5.6.1
        "symfony/asset": "5.2.*", // v5.2.3
        "symfony/console": "5.2.*", // v5.2.3
        "symfony/dotenv": "5.2.*", // v5.2.3
        "symfony/flex": "^1.3.1", // v1.18.5
        "symfony/form": "5.2.*", // v5.2.3
        "symfony/framework-bundle": "5.2.*", // v5.2.3
        "symfony/property-access": "5.2.*", // v5.2.3
        "symfony/property-info": "5.2.*", // v5.2.3
        "symfony/proxy-manager-bridge": "5.2.*", // v5.2.3
        "symfony/security-bundle": "5.2.*", // v5.2.3
        "symfony/serializer": "5.2.*", // v5.2.3
        "symfony/twig-bundle": "5.2.*", // v5.2.3
        "symfony/ux-chartjs": "^1.1", // v1.2.0
        "symfony/validator": "5.2.*", // v5.2.3
        "symfony/webpack-encore-bundle": "^1.9", // v1.11.1
        "symfony/yaml": "5.2.*", // v5.2.3
        "twig/extra-bundle": "^2.12|^3.0", // v3.2.1
        "twig/intl-extra": "^3.2", // v3.2.1
        "twig/twig": "^2.12|^3.0" // v3.2.1
    },
    "require-dev": {
        "doctrine/doctrine-fixtures-bundle": "^3.4", // 3.4.0
        "symfony/debug-bundle": "^5.2", // v5.2.3
        "symfony/maker-bundle": "^1.27", // v1.30.0
        "symfony/monolog-bundle": "^3.0", // v3.6.0
        "symfony/stopwatch": "^5.2", // v5.2.3
        "symfony/var-dumper": "^5.2", // v5.2.3
        "symfony/web-profiler-bundle": "^5.2" // v5.2.3
    }
}

What JavaScript libraries does this tutorial use?

// package.json
{
    "devDependencies": {
        "@babel/preset-react": "^7.0.0", // 7.12.13
        "@popperjs/core": "^2.9.1", // 2.9.1
        "@symfony/stimulus-bridge": "^2.0.0", // 2.1.0
        "@symfony/ux-chartjs": "file:vendor/symfony/ux-chartjs/Resources/assets", // 1.1.0
        "@symfony/webpack-encore": "^1.0.0", // 1.0.4
        "bootstrap": "^5.0.0-beta2", // 5.0.0-beta2
        "core-js": "^3.0.0", // 3.8.3
        "jquery": "^3.6.0", // 3.6.0
        "react": "^17.0.1", // 17.0.1
        "react-dom": "^17.0.1", // 17.0.1
        "regenerator-runtime": "^0.13.2", // 0.13.7
        "stimulus": "^2.0.0", // 2.0.0
        "stimulus-autocomplete": "^2.0.1-phylor-6095f2a9", // 2.0.1-phylor-6095f2a9
        "stimulus-use": "^0.24.0-1", // 0.24.0-1
        "sweetalert2": "^10.13.0", // 10.14.0
        "webpack-bundle-analyzer": "^4.4.0", // 4.4.0
        "webpack-notifier": "^1.6.0" // 1.13.0
    }
}
userVoice