Comments (11)
Sadly babel-preset-react-native
is not a superset of ES2015 but it's pretty close. I will keep this a superset of ES2015 and then add in the stuff RN uses, and I will nag the React Native folks separately to add the missing ES2015 features.
from create-react-app.
I'm against using babel-eslint for now. It is very fragile (no offense to maintainers, it's just a hard thing to do) and so people have been historically bumping into its issues many times.
We can revisit this later if properties advance in TC39.
from create-react-app.
Iām š on this if RN is a superset of ES2015.
from create-react-app.
For reference:
- React Native: https://github.com/facebook/react-native/blob/master/babel-preset/configs/main.js#L16
- ES2015: https://babeljs.io/docs/plugins/preset-es2015/
from create-react-app.
Missing from react-native:
- transform-es2015-block-scoped-functions
- transform-es2015-duplicate-keys
- transform-es2015-object-super
- transform-es2015-sticky-regex
- transform-es2015-typeof-symbol
- transform-es2015-unicode-regex
Different defaults
- transform-es2015-for-of { loose: true }
- transform-es2015-modules-commonjs { strict: false, allowTopLevelThis: true }
from create-react-app.
For React Native, as a philosophy, we want to use es2015 and next. So if those transforms don't break any of our current apps and don't add any weight, we should add them to the preset.
from create-react-app.
In react-native but afaict not (yet) in create-react-app:
- 'syntax-async-functions'
- 'syntax-class-properties'
- 'syntax-trailing-function-commas'
- 'transform-class-properties'
- 'transform-object-assign'
from create-react-app.
- 'syntax-async-functions': we're already embedding regenerator with es2015 and it's already implemented in browsers so should be good to go
- 'syntax-trailing-function-commas': seems like a no-brainer, we should enable it
- 'syntax-class-properties' & 'transform-class-properties': would be nice to wait until end of next week as we're presenting a revised version to tc39. See how it goes.
- 'transform-object-assign': this is a polyfill kind of thing, we don't really need it.
from create-react-app.
fully agree with ^^
from create-react-app.
OK, the problem is the linting. Both async functions and class properties are not supported by eslint. We could use https://github.com/babel/babel-eslint but perhaps that is too nonstandard / not worth it just for this extra bit of compatibility. Any thoughts one way or the other?
from create-react-app.
OK well you mostly did this in #43 so this issue is all set, with the exception of async
. I think it would be cleaner to put that in a new issue so I'll do that
from create-react-app.
Related Issues (20)
- Building breaks css with calc and var and double brackets HOT 2
- Need a v4 of react-scripts with 4.47.0 <= webpack < 5
- cannot create react app HOT 1
- facing installing problem while install
- checkForLatestVersion() in createReactApp.js dos not respect npm registry config setting HOT 1
- Install windows HOT 1
- err
- create-react-app my-app
- Why react app keep calling ws/info and ws/iframe.html ? HOT 2
- Split off eslint-config-react-app from the rest of this project HOT 1
- Erron installiation create-react-app HOT 1
- Issue while creating an react app HOT 3
- Snyk Package Analysis - Incomplete List of Disallowed Inputs Vulnerability HOT 1
- Snyk Package Analysis - Sandbox Bypass Copy link to issue Vulnerability HOT 1
- Snyk Package Analysis - Regular Expression Denial of Service (ReDoS) Vulnerability HOT 1
- Snyk Package Analysis - Regular Expression Denial of Service (ReDoS) Vulnerability HOT 1
- Snyk Package Analysis - Improper Input Validation Vulnerability HOT 1
- Snyk Package Analysis - Prototype Pollution Vulnerability HOT 1
- Snyk Package Analysis - Missing Release of Resource after Effective Lifetime Vulnerability HOT 1
- Docs: code splitting links to old/incorrect React page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-react-app.