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

Possible ES6-related improvements #11

Closed
pimotte opened this issue Dec 14, 2018 · 4 comments
Closed

Possible ES6-related improvements #11

pimotte opened this issue Dec 14, 2018 · 4 comments

Comments

@pimotte
Copy link
Contributor

pimotte commented Dec 14, 2018

Two small proposals:

  • Replace the commonJS export with an ES6 export.
  • Replace the require with a dynamic import

Both would modernize the code. The dynamic import is not natively supported in firefox and IE (is supported by Chrome/Safari/Edge/NodeJS), but is supported by Babel, so as I see it this shouldn't cause any problems.

@bkaptijn
Copy link
Contributor

I agree.

@pimotte
Copy link
Contributor Author

pimotte commented Dec 18, 2018

Some initial investigation:

  • es6 modules do have native support in node, but it is experimental (both in 10.x and 11.x)
  • Using es6 modules with any of the test frameworks (mocha, jasmine) would require using babel, since these don't have native es6 support yet.

@bkaptijn
Copy link
Contributor

true, never ran into problems with nodejs yet though. The API (and most connectors) need to be able to run (and thus tested) both in nodejs, in browsers and react native (even expo.io) so we'd need or be using babel / browserify (or webpack) already.

@pimotte
Copy link
Contributor Author

pimotte commented Dec 20, 2018

Closed with #13

@pimotte pimotte closed this as completed Dec 20, 2018
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

No branches or pull requests

2 participants