Update jsx binary to latest jstransform + latest flow syntax features #3143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
import type
and type casts)--es6module
and--non-strict-es6module
flags to thejsx
executableWhy a special flag for es6 modules, you ask?
ES6 modules are parsed in a different mode than regular scripts: (1) They are implictly strict-mode (2) Only modules can have
import
/export
declarations (scripts cannot); So the parser needs to know which mode it should parse the file.Whats up with
--non-strict-es6module
you ask?There are a lot of non-ES6 modules out in the wild (i.e. CommonJS modules) that are just begging to be converted to ES6 modules. However, because es6 modules are implicit-strict, it's not immediately safe to just convert the
require()
s toimport
s and call it a day. So this new--non-strict-es6module
is a compatibility mode that lets people switch to the new syntax and defer the strict-mode conversion until they have time to come around to it.cc @sebmck w.r.t. the new Flow syntax features (see facebookarchive/jstransform@de1173c and facebookarchive/jstransform@a4099d9)