-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add alias for react-spring in webpack config #16196
Conversation
webpack.config.js
Outdated
resolve: { | ||
alias: { | ||
// Added for compatibility with IE. | ||
'react-spring$': 'react-spring/web.cjs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach doesn't solve the issue in the root packages though. And we'd have to duplicate the fix in Core's webpack config file. I wonder if we should be explicit in the imports instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we'll have to specify react-spring/web.cjs
in every single import, right? Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes probably, we could try to write a custom eslint rule to prevent root imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re eslint: it should be possible to use no-restricted-syntax
rule for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. Thanks for the fix. I didn't test in IE cause it's going to be hard for me to set a Windows machine now. but I verified the eslint rule works as intended.
@youknowriad @tellthemachines An alternative solution would be to transpile react-spring to es5 using a pretty basic babel-preset-env. That might easier to enforce across Gutenberg? That's how we handle this kind of thing over in Calypso and eventually in calypso-build. |
Description
Fixes #16194
Added an alias in webpack config for react-spring to fix incompatibility with Internet Explorer.
How has this been tested?
Tested locally on Internet Explorer, on Windows 7 and Windows 10.
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: