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

Run client-side JS through Babel if desired #213

Closed
wants to merge 1 commit into from

Conversation

raphinesse
Copy link
Contributor

@raphinesse raphinesse commented Oct 10, 2019

Platforms affected

The ones we want to be affected

Motivation and Context

Closes #206

Description

This allows to set babel targets for each platform, so that the latest and greatest JavaScript we write will be compiled to whatever is compatible with the platform we're building for.

Testing

The babel transform is also applied to the cordova-js build for our automated tests (which also include code from the Android and iOS platforms). The tests still pass after that.

@raphinesse raphinesse changed the title Run client-side JS through Babel if requested Run client-side JS through Babel if desired Oct 10, 2019
Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

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

👍

@raphinesse

This comment has been minimized.

@raphinesse raphinesse force-pushed the babel branch 2 times, most recently from d44ac89 to d5f1294 Compare October 12, 2019 10:42
@raphinesse
Copy link
Contributor Author

Unfortunately the code transformed by Babel is missing polyfills. Babel can include require statements to load only the necessary ones, but the bundling would have to be done by a bundler. Which we don't have at the moment. However, IMHO having a custom build system and depending on a bundler would be suboptimal.

Alternatively we could easily add a pre-bundled version of core-js, but that would add ~140 KB to our bundle which is now about 70 KB. So that's not really acceptable either.

Closing this until I figure out how to solve this.

@raphinesse raphinesse closed this Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run client-side JS through Babel
2 participants