-
Notifications
You must be signed in to change notification settings - Fork 3
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
Update Babel Config to Support Internet Explorer #532
Conversation
It looks like the frontend tests are failing |
…portal into internet-explorer
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.
I tested locally and functionality I tested (mostly code generation stuff) works as expected in Chrome for me (just wanted to make sure it didn't mess things up in Chrome). Approved so we can test further in staging
@@ -1,7 +1,7 @@ | |||
// Jest Snapshot v1, https://goo.gl/fbAQLP | |||
|
|||
exports[`Footer renders correctly 1`] = ` | |||
<Component | |||
<_temp2 |
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.
Any idea why these changed?
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.
No I’m not sure.
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.
It seems to be working for me - just have a few concerns:
Not sure if it's related or possibly just my internet, but I was having some trouble loading assets on the ManageMembers page. Easiest way to reproduce it was logging in -> going to settings -> then going to manage members. The table would be empty, but going to a different page and coming back would load them in. Not sure if it's a loading speed issue, or something else is going on.
Last concern is the babel message that pops up in console when running the app (see below). It seems like the fix is relatively easy though: relevant stackoverflow.
The Babel and console issues come from you using Windows. See line 17 of |
Ah ok, makes sense - thanks for clarifying. It doesn’t seem to be impacting anything other than the console messages, so if I’m the only one it affects I don’t really mind. |
Updates Babel and Webpack configs. They were a bit weird before so it was good we revisited them.
Previously
webpack.common.js
for web andbabel.config.js
for testing, this was awkard.babel-polyfill
package to add our polyfills. This copied the entirebabel-polyfill
package todist/polyfill.js
.Now
Only configure babel in
![DeepinScreenshot_select-area_20200829124559](https://user-images.githubusercontent.com/20446774/91644926-a3a54c80-e9f5-11ea-89fe-16b7c26ea27e.png)
babel.config.js
. IfNODE_ENV == test
, target Node. Otherwise, target broswerslist's "default" query. Babel now reports it is targeting these browsers:Babel-polyfill is now deprecated. So, I followed their instructions and installed corejs@3 explicitly. I added the
useBuiltIns
option in Babelwith thewith theusage
flag. This adds polyfills as imports to the transpiled js filesentry
flag. This required placing someimports
at the top ofclient/index.js
. See the docs for a better explanation of all this.I couldn't get theNow, afterentry
flag to work, but it seemsusage
is more efficient anyway? (this confused me a bit)npm run build
, there is nopolyfill.js
file indist/
, sodist/
is about a MB smaller since we only are using the polyfills we need, not all of them :)-
NOTE: IE11 still does not work because we are using Mbox 5+. See here and here for details, this puts us at an impass for IE support.Internet Explorer Support
@fvilers/disable-react-devtools
package in the webpack config, so it is also transpiled by Babel. It causes an error in IE without being transpiled.client/index.js
. This makes the cloud functions work in IE11. See firebase docs.