Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Support ES-Next #91

Closed
christopherjbaker opened this issue Jun 9, 2017 · 3 comments
Closed

Support ES-Next #91

christopherjbaker opened this issue Jun 9, 2017 · 3 comments

Comments

@christopherjbaker
Copy link

Feathersjs runs properly with es-next (imports, arrow functions, etc), though the generator always creates es 5. While I do think the default should be es-next, at the very least it should be switchable with a command line flag.

The line additions should also use whatever syntax is currently in the file.

There is also a related bug: if services/index.js contains export default function() { instead of module.exports = function() {, feathers does not know what to do here. I didn't make this its own bug, as the above support would necessitate this handling.

@daffl
Copy link
Member

daffl commented Jun 9, 2017

The generator will only generate code that is compatible with Node 6+ (eventually latest) without transpilation. It used to support Babel before but it caused many issues (more tools in the chain where things can break) and increased startup time and memory usage. As you pointed out, the codeshift transformations are also not set up to support ES6 imports and exports yet and will require quite a bit of additional work.

At least for us we are not planning on adding support for ES imports until it is included in a stable Node release.

@christopherjbaker
Copy link
Author

That makes sense.

@daffl
Copy link
Member

daffl commented Jun 16, 2017

We'll definitely keep this in mind once it has been figured out how native support in Node is going to look like. I'm also going to try and write up a guide on how to customize the generator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants