-
Notifications
You must be signed in to change notification settings - Fork 892
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
Rollup JS files with rollup-typescript-plugin #8503
Conversation
|
a520ce5
to
eed8644
Compare
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected ProductsNo changes between base commit (a377fb2) and merge commit (0ccfec9).Test Logs |
eed8644
to
c0115ea
Compare
The rollup-typescript-plugin does not transpile JS files using the TS compiler by default. This means that external dependencies that provide JS bundles will not be transpiled to the target ES version specified in the TypeScript config used by the plugin. This resulted in one of our dependencies (https://github.com/jakearchibald/idb) being included in the CDN bundles without being transpiled to ES5 (the target ES version). Since this dependencies bundle uses ES2018 syntax (object spread operator `{ ...x }`), this upgraded our CDN bundles' minimum ES version requirement to ES2018 which isn't compatible with older browser versions. To see the ES2018 syntax in one of the CDN bundles, see https://www.gstatic.com/firebasejs/10.13.1/firebase-app.js and search for `...oldTraps`.
c0115ea
to
dc115a2
Compare
The rollup-typescript-plugin does not transpile JS files using the TS compiler by default. This means that external dependencies that provide JS bundles will not be transpiled to the target ES version specified in the TypeScript config used by the plugin.
In other words, if one of our dependencies has a bundle that uses newer JS features that aren't supported in all browsers, it will be included in our bundle without being translated into an older JS version that we promise our bundles are compatible with.
This resulted in one of our dependencies (https://github.com/jakearchibald/idb) being included in the CDN bundles without being transpiled to ES5 (the target ES version). Since this dependencies bundle uses ES2018 syntax (object spread operator
{ ...x }
), this upgraded our CDN bundles' minimum ES version requirement to ES2018 which isn't compatible with older browser versions. To see the ES2018 syntax in one of the CDN bundles, see https://www.gstatic.com/firebasejs/10.13.1/firebase-app.js and search for...oldTraps
.After enabling
allowJs
in the typescript plugin CDN config, this ES2018 code now gets transpiled into ES5 code.I verified the bundle is now es5 compliant by using ESLint Playground.