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)
- Create react app HOT 1
- login issue
- my sign in not working
- HMR not working
- [email protected]
- "npx create-react-app" doesn't generate src or public folders HOT 1
- Usage override/workaround/hack with ESLint 9
- Frontend Host doesn't match the current host in the browser, so it's probably incorrect. Links in emails and file downloads from the API will not work. Click here to update. HOT 1
- [https://newsroom.spotify.com/news/](https://deezer.page.link/fCBsxrTRUZvKbLkA8) HOT 3
- react-scripts/v/5.1.0-next.14 contains multiple security vulnerabilities for inner modules
- Issue in creating react app HOT 4
- cra打包路由切换FiberRootNode会新增,webpack打包就不会 HOT 1
- Error -4048 and Error -4058 and ENOENT, HOT 1
- Des erreurs apres installation de mui sur un projet React 18.0.0 ou supérieur HOT 1
- del proyecto
- how i can run react program in vs code HOT 4
- React JS HOT 4
- @babel/plugin-proposal-private-property-in-object missing from babel-preset-react-app dependencies
- Npx create-react-app: 8 vulnerabilities (2 moderate, 6 high) in new react app HOT 1
- 不动 啊
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.