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

Fix for IE 11-compatible Babel transpilation #242

Merged
merged 9 commits into from
Nov 4, 2019
Merged

Conversation

opyh
Copy link
Member

@opyh opyh commented Oct 31, 2019

This cleans up browserslist / babel/preset-env configuration and fixes IE11 by moving babel-plugin-ttag out of the way when Next.js / Webpack / Babel transpiles our code.

Here is a more detailed description of the issue: ttag-org/babel-plugin-ttag#138

For fun, it includes little changes to remove deprecation warnings in Next 9.

@opyh opyh requested a review from mutaphysis October 31, 2019 14:06
{
"preset-env": {
"useBuiltIns": "entry",
"corejs": 3,
Copy link
Member Author

Choose a reason for hiding this comment

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

Newer than the default. Default would be 2, also this line is necessary to get rid of a warning.

},
"transform-runtime": {
"corejs": 3,
"useESModules": false
Copy link
Member Author

Choose a reason for hiding this comment

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

Without this, the server code would crash on start.

"babel-plugin-styled-components"
],
"env": {
"ttag": {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the configuration used when running Babel with BABEL_ENV=ttag.

Copy link
Collaborator

Choose a reason for hiding this comment

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

did you test the pot file extraction with these changes?

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 didn't look in detail at the .pot file, but it was generated correctly.

"pull-translations": "tx pull -af",
"retranslate": "npm run build && npm run pull-translations && NEW_SOURCE_PO='./src/static/i18n/en_US.txt' retranslate/run.sh",
Copy link
Member Author

Choose a reason for hiding this comment

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

static is deprecated

Comment on lines -187 to +192
"> 1%"
"> 0.25%",
"not dead"
Copy link
Member Author

Choose a reason for hiding this comment

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

Support a few more browsers because why not :)

@@ -313,72 +313,70 @@ export default class App extends BaseApp {
};

return (
<Container>
Copy link
Member Author

Choose a reason for hiding this comment

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

Next.js 9 doesn't need this component wrapper anymore. Everything below this line in this file is just Prettier's re-indentation, feel free to ignore :)

Copy link
Collaborator

@mutaphysis mutaphysis left a comment

Choose a reason for hiding this comment

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

LGTM

"babel-plugin-styled-components"
],
"env": {
"ttag": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you test the pot file extraction with these changes?

@mutaphysis mutaphysis merged commit c8f8aad into master Nov 4, 2019
@mutaphysis mutaphysis deleted the bugfix/ie-11 branch November 4, 2019 15:45
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.

2 participants