Skip to content
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

Reuse babel options and specify polyfills for karma explicitely #1456

Merged
merged 18 commits into from
Mar 11, 2021

Conversation

kof
Copy link
Member

@kof kof commented Feb 17, 2021

Fixes #1455

I was looking into why we didn't catch that with tests, it turned out we load all polyfills in karma, but as I was looking I made the babel config reusable, it didn't change anything but still good to have.

@kof kof requested a review from TrySound February 17, 2021 11:52
babelOptions.js Outdated
plugins: [
['@babel/proposal-class-properties', {loose: true}],
['@babel/transform-runtime', {useESModules}],
['@babel/plugin-proposal-export-namespace-from'],
Copy link
Member

Choose a reason for hiding this comment

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

Is this plugin actually used?

Copy link
Member Author

Choose a reason for hiding this comment

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

I searched for export * as - nothing found

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess we can remove it

@@ -0,0 +1,9 @@
exports.getBabelOptions = ({useESModules}) => ({
Copy link
Member

Choose a reason for hiding this comment

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

Do you remember why we didn't use babel.config.js?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, but I would guess the useESModules option is dynamic, that's why?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but it can be used only for rollup. There is no difference between inlined and imported helpers.

Copy link
Member Author

Choose a reason for hiding this comment

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

using the option for rollup only is fine, it's still better than having the entire babel config duplicted

Copy link
Member

Choose a reason for hiding this comment

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

Btw, babel 7.13 does not require useESModules flag anymore. Right version is detected automatically.

Copy link
Member Author

Choose a reason for hiding this comment

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

then we can remove the flag along with upgrading babel, probably better separately

…true}] the spread is doing a different thing
tests/utils.js Outdated
return [...style.sheet.cssRules]
const rulesArr = []
const {cssRules} = style.sheet
for (const key in cssRules) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe better for(;;)?

Copy link
Member Author

@kof kof Mar 11, 2021

Choose a reason for hiding this comment

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

hah, for in failed in safari ... good catch

@kof kof changed the title Reuse babel options Reuse babel options and specify polyfills for karma explicitely Mar 11, 2021
@kof kof mentioned this pull request Mar 11, 2021
2 tasks
@kof kof merged commit eb8270c into master Mar 11, 2021
@kof kof deleted the reuse-babel-options branch March 11, 2021 18:07
@kof
Copy link
Member Author

kof commented Mar 14, 2021

Released in v10.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using Number.isNaN breaks JSS in IE11
2 participants