-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WCM] Updating the Encore documentation + New recipe #10128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a316586
to
a2c7ad4
Compare
This will match up with a recipe change.
a2c7ad4
to
d159ba5
Compare
frontend/encore/installation.rst
Outdated
=================== | ||
|
||
First, make sure you `install Node.js`_ and also the `Yarn package manager`_. | ||
|
||
Then, install Encore into your project with Yarn: | ||
Option A) If you are using Symfony Flex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do like you did with the non-flex installation page (with a tip at the top)? It's kind of ugly to have options on the "main" page about Encore installation as 99% of the time, people will have Flex.
frontend/encore/simple-example.rst
Outdated
Encore's job is simple: to read *all* of ``require`` statements and create one | ||
final ``app.js`` (and ``app.css``) that contain *everything* your app needs. Of | ||
course, Encore can do a lot more: minify files, pre-process Sass/LESS, support | ||
ReactVue.js and a *lot* more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ReactVue.js
+ React, Vue.js
@@ -163,7 +121,7 @@ Great! Use ``require()`` to import ``jquery`` and ``greet.js``: | |||
// assets/js/app.js | |||
|
|||
// loads the jquery package from node_modules | |||
const $ = require('jquery'); | |||
var $ = require('jquery'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure using var
should be encouraged nowadays since it's a lot less intuitive than const
/let
.
Did you change it to be more consistent with the rest of the doc? Wouldn't it be better to go over the others var
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yea, I didn't want to introduce a potentially new concept here. This page now consistently uses var
, but we use const
in many other places in the docs. I can't think of anything better to do than what this PR does: use var
in the beginning, then let const
be shown in other places. Showing var
everywhere isn't ideal, since it's not really used as often in practice anymore.
frontend/encore/simple-example.rst
Outdated
--------------------------- | ||
Instead of using ``require`` and ``module.exports`` like shown above, JavaScript | ||
has an alternate syntax, which is a more accepted standard. Choose whichever you | ||
want: they funtion identically: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- funtion
+ function
See symfony/recipes#440
Basically, after a year+ of using Encore, I updated the recipe to follow best practices & clarity. This updates the docs to follow that recipe. Hopefully it makes Encore even more accessible :).
Cheers!