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

Transpile on build #6

Closed
grabbou opened this issue Mar 23, 2017 · 3 comments
Closed

Transpile on build #6

grabbou opened this issue Mar 23, 2017 · 3 comments
Assignees
Milestone

Comments

@grabbou
Copy link
Member

grabbou commented Mar 23, 2017

React Native supports Node >= 4, according to its package.json:

  "engines": {
    "node": ">=4"
  },

We are running latest Node which makes it possible to use ES2015+ features w/o transpiling first. We need a build step that will compile code to Node 4.x (there's preset somewhere I believe).

In dev mode, let's call CLI via cli/index.js which contains requireHook. Production builds should use cli/cli which doesn't have it.

This is done for speed (see how slow is current CLI)

@grabbou grabbou assigned satya164 and zamotany and unassigned satya164 Mar 23, 2017
@grabbou grabbou changed the title Transpile to what's supported by Node Transpile on build Mar 25, 2017
@grabbou
Copy link
Member Author

grabbou commented Mar 25, 2017

FYI @zamotany I have updated the description and title of this issue so it's easier to start.

@grabbou grabbou modified the milestone: Alpha 1.0 Mar 25, 2017
@zamotany
Copy link
Contributor

zamotany commented Mar 27, 2017

In dev mode, let's call CLI via cli/index.js which contains requireHook. Production builds should use cli/cli which doesn't have it.

Are you sure that's possible?? From what I know there is no option to specify witch binary to use depending on environment. I suggest to have single binary entry and there decide whether to use dev CLI or production CLI.

@grabbou
Copy link
Member Author

grabbou commented Mar 27, 2017

Are you sure that's possible?

Yeah, in dev mode you'd call it via node whereas binary would skip the require hook.

Anyway, recent discussion moved us towards direction that uses babel-env with node: current meaning we won't transpile anything but flowtypes on latest Node version.

Having said so, this can be closed for now.

@grabbou grabbou closed this as completed Mar 27, 2017
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