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 standards #167

Open
bluzi opened this issue Jul 17, 2017 · 14 comments
Open

ES2015 standards #167

bluzi opened this issue Jul 17, 2017 · 14 comments

Comments

@bluzi
Copy link

bluzi commented Jul 17, 2017

Hi,

I am using this generator to kickstart most of my ExpressJS projects, and it's real good, but I always wonder why you use var and functions instead of let/const and arrow functions?
I always change it myself when I kickstart a project.

Is there any particular reason for that? If not, I can make change and and create a pull request.

@dougwilson
Copy link
Contributor

Hi @bluzi the generator is designed to support the same version range of Node.js that Express.js itself supports, which is Node.js 0.10 and higher. Node.js 0.10 does not understand let/const and arrow functions, which is why the generated code doesn't use them.

Now, that's just the history. There is no reason why someone could not add in the ability to generate both the old ES5 style and the newer ES2015 style under a switch to let the users choose between the two. The generator could even automatically generate using ES2015 if the user didn't specify which one and the generator was run on a version of Node.js that supported ES2015.

@bluzi
Copy link
Author

bluzi commented Jul 17, 2017

Hi @dougwilson , Thanks for the response.
I will create a PR soon :)

sisisin added a commit to sisisin/generator that referenced this issue Aug 26, 2017
sisisin added a commit to sisisin/generator that referenced this issue Aug 26, 2017
@benhalverson
Copy link

@dougwilson @bluzi Is this still being worked on? What else needs to be done?

@bluzi
Copy link
Author

bluzi commented Oct 9, 2017

Hi @benhalverson, I couldn't find time to work on it yet. However, it seems like @sisisin created an ES2015 template on his fork, so maybe you should check that out.

@laoshaw
Copy link

laoshaw commented Dec 18, 2017

yes I guess majority of us are embracing eslint and es6 these days, if express-generator can catch up on this it will be fantastic.

@SilencerWeb
Copy link

Why don't you add babel for compile ES6?

@wmthor
Copy link

wmthor commented Jan 23, 2018

This is quite long overdue. I think it will help a lot more people for this to be implemented than to maintain compatibility. What's stopping this from being implemented? I can make a pull request with my fork that is merged with version 4.15. Shall I merge it with 4.16?

@bferris1
Copy link

Pull request #176 addresses this and looks close to completion. They just need to figure out how it should behave and be tested on older versions of node.

@ogrotten
Copy link

ogrotten commented Feb 18, 2018

If you want to keep compatibility with legacy node, a commandline flag would be a good choice for this.

The help output would look like

-6, --es6      generate output using ES6 features
-7, --es7      generate output using ES7 features

with the default choice being current/ES5 output.

Is node 0.10.0 even LTS anymore?

@thatlizarddude
Copy link

@ogrotten no, Node.js 0.10.0 has been released in 2013... The current LTS is 8.10.0, and express-generator still didn't seem to adapt to this new version.

@tim-rohrer
Copy link

I wish I was smart enough to help get PR #176 ready to be merged, but I'm not there yet with my coding.

However, as a new guy, I'm trying to focus my learning on ES2015/classes designs, and this would really help. Any update?

Thanks, guys.

@danielkhan
Copy link

As #176 seems to have stalled and contains too many unrelated changes anyways I've created #200 that adds an --es6 flag. Feedback appreciated.

@Ayc0
Copy link

Ayc0 commented Jan 11, 2019

@dougwilson, why do you need to maintain old version of node?
Express-generator is here to help developers to generate new express repositories. If someone generated its own repo for node 0.10 or node 4, its build will still be valid, even if we upgrade express-generator to node v6.

Or we can say that if you want to generate a repo for node v0.10, you'll have to use express-generator vX.X, but those versions aren't maintained anymore.

@pubmikeb
Copy link

Any roadmap when ES6 will be supported by a stable version of ExpressJS Generator out-of-box?

@p4nu p4nu mentioned this issue May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.