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

Cool it with the transpilation craze #66

Closed
fasterthanlime opened this issue Dec 8, 2015 · 6 comments
Closed

Cool it with the transpilation craze #66

fasterthanlime opened this issue Dec 8, 2015 · 6 comments

Comments

@fasterthanlime
Copy link
Collaborator

Maybe another way is possible?

Right now installing the whole shebang with npm is insanely long :|

@fasterthanlime
Copy link
Collaborator Author

Basically in https://github.com/fasterthanlime/lightweight-electron-setup, with Electron v0.35.0 (node 4.1 + Chromium 45?), we get:

  • let (block-scoped decls)
  • fat arrow function
  • string interpolation a-la ${}
  • t7 replaces JSX kinda (and we can still make components)
  • nodent async/await based on promises or generators
    • note: nodent seems to handle error handling well (can catch async errors, stack traces are workable (it does translation))

What we don't get:

  • import/export (have to use good ol' require + module.exports) but at least
    • we know in what order stuff gets ran
    • we know exactly what we're importing
  • destructuring assignment, e.g. let {name, age} = person
  • default parameter values, e.g. function greet(message = 'Hi') { console.log(message) }, have to use if (typeof message === 'undefined') { message = 'Hi' }

Other advantages:

  • CI builds actually have a chance of running quickly (instead of having to npm install half the universe, and yes, upgrading to npm 3, or babel 6, or both, make it significantly worse and it's already quite bad)
  • JS tooling works better? tern-based completion in Atom is suddenly useful (who knew?), standardjs still works although having it in devDependencies pulls a bunch of babel stuff again so I'm gently edging towards just having it in the editor, it's just a style guide it's not survival.
  • 1s-to-6s flow-breaking recompile delay is gonezo

@fasterthanlime
Copy link
Collaborator Author

TL;DR converting the current codebase to be runnable without transco would imply:

  • Turning import/export into require/module.exports
  • Rewriting default parameters
  • Converting JSX to t7 (or whatever else, I'm not married to it)

Is it me or does it sound pretty reasonable ?

@fasterthanlime
Copy link
Collaborator Author

As far as styling goes, not planning on moving away from SCSS, but maybe we don't need grunt for that, yes? I wish we could use tup everywhere but it's still half-bleeped on OSX and entirely-bleeped on Windows.

Maybe we can just require sassc to be present? it's pretty fast.

@fasterthanlime fasterthanlime changed the title Cool it with the transcompilation craze Cool it with the transpilation craze Dec 8, 2015
fasterthanlime added a commit that referenced this issue Dec 9, 2015
@fasterthanlime
Copy link
Collaborator Author

Almost all non-spec code has been converted, attacking the React components with t7

@grifdail
Copy link

grifdail commented Dec 9, 2015

What is the probleme with transpilation and long npm install ?

@fasterthanlime
Copy link
Collaborator Author

What is the probleme with transpilation and long npm install ?

I talk a bit about it here: http://itch.io/post/4873

TL;DR fast CI runs are good, fast/lean anything is good, the shorter iteration cycles are the faster we can move.

fasterthanlime added a commit that referenced this issue Dec 9, 2015
fasterthanlime added a commit that referenced this issue Dec 10, 2015
fasterthanlime added a commit that referenced this issue Dec 10, 2015
fasterthanlime added a commit that referenced this issue Dec 10, 2015
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