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

Switch to es6 + generators #8

Open
briancavalier opened this issue May 7, 2014 · 8 comments
Open

Switch to es6 + generators #8

briancavalier opened this issue May 7, 2014 · 8 comments

Comments

@briancavalier
Copy link
Owner

Why?

  1. It's the future, let's get experience using es6 features
  2. The code will become ridiculously simple since we won't have to code iterables by hand.

One strategy would be to move all source files to a src dir tree (ie move <root>gent.js to src/gent.js, etc.), and use traceur to build back to the root dir (ie build src/gent.js to <root>/gent.js, etc.) in commonjs format on prepublish.

@Raynos
Copy link

Raynos commented May 7, 2014

use regenerator instead of traceur, i believe it has a cleaner compiled output.

@briancavalier
Copy link
Owner Author

@Raynos sounds interesting. Does it support other es6 features, like arrows and modules as well?

@Raynos
Copy link

Raynos commented May 7, 2014

no. just generators.

Which means you can run your module WITHOUT a compile step in node --harmony-generators and with a compile step in browsers.

You can even use gnode to run your module without a compile step in node < 0.12

@briancavalier
Copy link
Owner Author

Cool, thanks for the info. I'll have a look at regenerator. I'd really like to use arrows, but I'm not really sure yet if it's practical or just too annoying with a build step.

@Raynos
Copy link

Raynos commented May 7, 2014

@briancavalier for open source modules i highly recommend avoiding a build step.

For applications (private or open, just not published to npm) go nuts.

@Raynos
Copy link

Raynos commented May 7, 2014

@briancavalier remember that when i use your module and it breaks i have to read an unreadable auto generated stack trace from traceur.

@briancavalier
Copy link
Owner Author

i have to read an unreadable auto generated stack trace from traceur

Yeah, this quite a compelling point ... traceur stack traces are useless in my experience.

@unscriptable
Copy link

Yes, good point, @Raynos. The less code transformations, the better, imho.

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

3 participants