Skip to content

Commit

Permalink
Upgrade to webpack version 5
Browse files Browse the repository at this point in the history
Ran the following:

npm install webpack@latest \
            webpack-cli@latest \
            copy-webpack-plugin@latest \
            tsconfig-paths-webpack-plugin@latest \
            ts-loader@latest

Part of #1184.

This is the commit message #2:

remove polyfill configuration

let’s see if this still works

https://webpack.js.org/migrate/5/#clean-up-configuration

"If you are using something like node.fs: 'empty' replace it with
resolve.fallback.fs: false"

This is the commit message #3:

emit ES5 runtime code

> Webpack 4 used to only emit ES5 code. Webpack 5 can generate both ES5
and ES6/ES2015 code now.

https://webpack.js.org/blog/2020-10-10-webpack-5-release/#improved-code-generation

we seem to be assuming ES5 in our codebase (see gruntfile config of
ECMASCRIPT5 and “lib” in tsconfig.json) — without this, we had failure
of `npm run check-closure-compiler`

this config option doesn't exist in webpack 4

tested this commit in web worker, in https://github.com/ably-labs/ably-js-react-native-example, commit 48eee78
tested this commit in react native, in https://github.com/ably-labs/ably-js-web-worker-example, commit 88ccaae

TODO what about

/**
 * Webpack v4 is used as Webpack v5 does not offer support for ES3 and creates issues for ES3 support such as discarding string literal keyword property names.
 */

what is our supported ES version? f2014f7 is "Update to ES5" but I can’t
find anything about the motivation, and we still mention ES3 above and
in the gruntfile.

TODO what about

> Without a browserslist webpack's runtime code uses ES2015 syntax (e.g., arrow function) to build smaller bundles. Hence you'll need to set target: ['web', 'es5'] to use the ES5 syntax for browsers (like IE11) which don't support ES2015 syntax .
>
> For Node.js, builds include the supported Node.js version in the target option and webpack will automatically figure out which syntax is supported, e.g. target: 'node8.6'.

what is our supported node version? what is our supported browser
version?
  • Loading branch information
lawrence-forooghian committed Apr 20, 2023
1 parent 108cde1 commit 350c1a2
Show file tree
Hide file tree
Showing 3 changed files with 1,316 additions and 6,543 deletions.
Loading

0 comments on commit 350c1a2

Please sign in to comment.