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

ES2015 support in server.js #339

Closed
matthewdavidson opened this issue Jan 3, 2017 · 2 comments
Closed

ES2015 support in server.js #339

matthewdavidson opened this issue Jan 3, 2017 · 2 comments

Comments

@matthewdavidson
Copy link
Contributor

Component authors are limited to writing server.js in es5 regardless of the node version the component registry is running on. I believe this is due to the usage of uglify (which at present supports only es5) in the component packaging process.

I see three options:

  1. Introduce babel into the packaging process.
  2. Drop uglify in favor of a minifier that supports es2015 (e.g. babili is the only one i know of 😒 )
  3. Wait for uglify to support es6

Rationale: At best, it's awkward for component authors who write their client side code in es2015 to be limited to es5 in server.js. At worst it's confusing for newcomers to the codebase to see different javascript syntax across files.

Thoughts?

@matteofigus
Copy link
Member

Agree, this has been on my list like forever. I was waiting for uglify to catchup and resisting to add babel because it would make the cli to grow quite a lot - but perhaps it's now time to reconsider.

I didn't know babili but looking at the code it looks to me that it is anyways a combination of babel + uglify, so I think my preference would for short term doing 1. with es2015 preset (as a pre-minification process) and then 3. long term when uglify will be ready.

@matteofigus
Copy link
Member

Done with #346

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

No branches or pull requests

2 participants