Skip to content

Convert to ES6 import/export syntax #74

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

Merged
merged 2 commits into from
Feb 11, 2018
Merged

Convert to ES6 import/export syntax #74

merged 2 commits into from
Feb 11, 2018

Conversation

jacobp100
Copy link
Contributor

  • Converts all imports/exports to ES6
  • Bundles with rollup

I question what we should do about babel though? I've kept it as-is, but RN will run babel on node_modules, so our babel config could be doing too much. Some projects will use this in node, but any maintained version of node supports classes and arrow functions. Should we ship ES6 code? @mxstbr

@kristerkari
Copy link
Contributor

kristerkari commented Feb 10, 2018

Some projects will use this in node, but any maintained version of node supports classes and arrow functions. Should we ship ES6 code?

Looks like ES2015 is quite well supported in Node v6+:
http://node.green/

Node 4 is soon dead, so Node 6 is already the minimum version for many projects:
https://github.com/nodejs/Release#release-schedule

@kristerkari
Copy link
Contributor

kristerkari commented Feb 11, 2018

I'm getting this warning when running the build

> rollup ./src/index.js -o index.js --f cjs && babel index.js -o index.js


./src/index.js → index.js...
(!) Mixing named and default exports
Consumers of your bundle will have to use bundle['default'] to access the default export, which may not be what you want. Use `exports: 'named'` to disable this warning

Should probably set exports: 'named' to hide it.

@jacobp100
Copy link
Contributor Author

That was how Babel does it, so I was going to leave it as-is for now. Maybe we should turn Babel off after node 4 is officially out.

@jacobp100 jacobp100 merged commit b41f4f4 into master Feb 11, 2018
@kristerkari
Copy link
Contributor

@jacobp100 There are again a bunch of fixes, what about releasing a new minor version?

@jacobp100
Copy link
Contributor Author

Will do!

@jacobp100 jacobp100 deleted the import-statements branch May 21, 2018 10:16
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