Replace Mustache.js templates with template literals. An effort was made
to minimize additional refactoring, so feel free to ask for more but it
ain't coming in this PS.
Bug: T165036
Change-Id: I4a6a1d93a2922c3a9ef3ae93c47da17a35c644f0
Enable the Babel transpiler so that ES6 template literals,
destructuring, and arrow functions can be used in production.
"last n versions" syntax was not used so that builds are more
reproducible.
Bug: T165036
Change-Id: I553b6d14cc368c7b4366f68d13038c3d505f5429
Webpack has some simple but useful options for specifying performance
limits. This patch enables asset and entry point (+ all dependencies)
filesize requirements for production builds. This helps us track
minified but uncompressed filesizes which are reported by
mw.loader.inspect() (including CSS).
https://webpack.js.org/configuration/performance/
Bug: T165036
Change-Id: I331ff34f50270be2912fd8cef5219cafc6957e80
- Add SVG Inline Loader for Webpack. This allows SVG files to be
imported.
- Update the Webpack and test configurations to use the new loader.
- Scope the ESLint rules down to just JavaScript files so that linting
isn't attempted on the SVG.
Bug: T165036
Change-Id: I00bccff4c3167975c19d577be6343dcaca7ddb2d
Clarify why we don't have source maps in production and the interaction
with ResourceLoader's production mode, and reference phab task.
Bug: T188081
Change-Id: I4c5f60585429792ee3047268ad44449ab47fcff4
When bundled by ResourceLoader this can interfere with debugging
of other concatenated files.
The nomin instruction introduced in 7bd29bb058
was meant to avoid RL minifying an already
uglified bundle, but that shouldn't matter here.
Bug: T177344
Change-Id: I90829668544e7c4ff7ddfdbb90d91b88a27a69f4
We cannot serve .map files from production servers. This makes
Popups extension difficult to debug. As a simplest solution we
decided to store map files as .json files so we can easily access
js maps files.
Changes:
- changed webpack config to store map files under .json extension
Bug: T173491
Change-Id: Iaa55f75a8c5f3e8f1f169b3ac33241cc54f0413f
It enables certain optimizations, see:
* https://webpack.js.org/guides/production-build/
Code is minified by uglifyjs.
Aditional changes:
* Add banner so that sources are not minified by ResourceLoader
Bug: T160061
Change-Id: I50c9148ebf2d860db42a24225bc128bfcfe56927
Webpack 1.14.0 is an old version, switch to using latest stable which
has better documentation, tree shaking, ES2015 modules and a core team
of contributors with funding. See https://webpack.js.org/
Additional changes:
* Recompile the frontend assets
Change-Id: I2c5940276e99dee104d04c6a0b83d8ab36a99df5
Instead of importing the modules from sources (which you should do if
you properly define NODE_ENV and use uglifyjs from webpack) import the
already compiled files on the npm packages.
This results in 5kb less on the compiled bundle.
Change-Id: I83732ea79a59b611c117ddcf4c262948c795f642
This way, src contains sources, and dist contains distribution files.
Also, add some documentation about the folders in the README and an adr.
Change-Id: Ie0b9f6475b8423b90e927633d883bde3cd5d5e4d
In order to automatically verify in CI that the built assets are up to
date with the commited sources, we need to keep the built assets in
a folder separate from the RL assets.
* Rename the compiled assets folder to industry standard `dist`
Change-Id: I8c5898f9bb29fee7164a7038b835a5f7efd33dbc
boot.js is renamed to index.js and popups is now bundled
up inside popups.js
To support qunit tests, the library is still exposed as
mw.popups with a FIXME to remove later when it is no longer
necessary
Bug: T156333
Change-Id: Ieb6b4b0344af2701f99ef0fcc786d2378fd2fceb
Generate changeListeners via webpack
We now use a build folder to build the JavaScript for
our ResourceLoader modules. This is the first change
in a line of changes.
A source map is provided for debug support.
Bug: T156333
Change-Id: I771843d1ddb4b50adedc3fa53b30c2f1d8a76acb