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

convert common.js modules to new standard ESM module syntax #815

Merged
merged 1 commit into from
Dec 4, 2017

Conversation

FredKSchott
Copy link
Contributor

Node.js, Browser Vendors, and the rest of the JS ecosystem are moving towards a standard module syntax for JavaScript. It's "strict" by default, standard across environments, and easier for compilers to optimize for.

Why now? This work is driven by our switch from Flow to TypeScript, so that we can add powerful typing support to our new API request interface. TypeScript uses ESM exclusively, so this is the first step. See #812 for more info.

No changes to Babel were needed, it successfully compiles down to Node-style common.js modules for distribution. Tests continue to pass.

/cc @intelliot

@intelliot
Copy link
Collaborator

What did you use to do this conversion?

@FredKSchott
Copy link
Contributor Author

A few regex find and replaces did most of the work, and then the no-commonjs eslint rule to confirm I got everything.

Copy link
Collaborator

@intelliot intelliot left a comment

Choose a reason for hiding this comment

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

This looks good.

@intelliot intelliot merged commit 7e5b994 into XRPLF:develop Dec 4, 2017
@FredKSchott
Copy link
Contributor Author

🤘

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