Skip to content

Changing the wording around module.exports #10692

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions frontend/encore/simple-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ The import and export Statements
--------------------------------

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 do the same thing.
has an alternate syntax, which is the new finalized ECMAScript standard for using modules in the browser, including
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose the following reword to not say "the new finalized" (because that expression won't age well):

Instead of using ``require`` and ``module.exports`` like shown above, JavaScript
provides an alternate syntax based on the `ECMAScript 6 modules`_ that includes
the ability to use dynamic imports.

And at the bottom of the article, the URL for the "ECMAScript 6 modules" link must be added:

.. _`ECMAScript 6 modules`: https://hacks.mozilla.org/2015/08/es6-in-depth-modules/

the ability to use dynamic imports

..

To export values using the alternate syntax, use ``exports``:

Expand Down Expand Up @@ -333,8 +335,7 @@ If you want to only compile a CSS file, that's possible via ``addStyleEntry()``:
Encore
// ...

.addStyleEntry('some_page', './assets/css/some_page.css')
;
.addStyleEntry('some_page', './assets/css/some_page.css');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's revert this change because in most examples the Encore config has multiple lines and we always put the last ; in a new line. Thanks!


This will output a new ``some_page.css``.

Expand Down