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

refactor(babelrc): migrate babelrc to babel.config.json #1338

Merged
merged 2 commits into from
Mar 24, 2021

Conversation

orbitalsqwib
Copy link
Contributor

Problem

It is good practice in Babel 7.x to use a project-wide babel.config.json instead of .babel.rc, which
is a relic of Babel 6.x (we are on 7.x).

Closes #1264

Solution

  • implemented babel.config.json based on FormSG's current configuration

@orbitalsqwib orbitalsqwib requested a review from LoneRifle March 22, 2021 09:17
Copy link
Contributor

@liangyuanruo liangyuanruo left a comment

Choose a reason for hiding this comment

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

This can be a sensitive part of the codebase, so make sure to test thoroughly (with IE11 if necessary).

@orbitalsqwib
Copy link
Contributor Author

orbitalsqwib commented Mar 23, 2021

I've tested the latest commit with Chrome, Firefox, Safari and also verified that at minimum the transition and landing pages for IE 11 work properly (though the transition page has some styling issues that leave the background completely white).

As such, I believe that the new config should be ready for merging as of the latest commit, though I may want to postpone the merge until the team can discuss whether they want to add the additional plugins for babel.

@liangyuanruo
Copy link
Contributor

You also need to test functionality, since this PR is modifying the JS transpilation process.

@orbitalsqwib
Copy link
Contributor Author

As for functionality, I’ve done the end to end tests for the platforms specified in my previous comment with the exception of IE11, as there were some issues with the VM i was using

It is good practice in Babel 7.x to use a project-wide babel.config.json instead of .babel.rc, which
is a relic of Babel 6.x (we are on 7.x).
- implemented babel.config.json based on FormSG's current configuration

fix #1264
- Added corejs and regenerator-runtime dependencies for babel preset-env

fix #1264
@LoneRifle
Copy link
Contributor

snyk test errored out, not an actual failure

@LoneRifle LoneRifle dismissed liangyuanruo’s stale review March 24, 2021 06:27

Functionality tested on IE11, all good

@LoneRifle LoneRifle merged commit 280ca4f into develop Mar 24, 2021
@LoneRifle LoneRifle deleted the refactor/babelrc branch March 24, 2021 06:28
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.

Use project-wide babel.config.json configured to target supported browsers
3 participants