Git Product home page Git Product logo

Comments (11)

lacker avatar lacker commented on March 28, 2024 1

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.

gaearon avatar gaearon commented on March 28, 2024 1

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.

gaearon avatar gaearon commented on March 28, 2024

Iā€™m šŸ‘ on this if RN is a superset of ES2015.

from create-react-app.

vjeux avatar vjeux commented on March 28, 2024

For reference:

from create-react-app.

vjeux avatar vjeux commented on March 28, 2024

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.

vjeux avatar vjeux commented on March 28, 2024

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.

lacker avatar lacker commented on March 28, 2024

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.

vjeux avatar vjeux commented on March 28, 2024
  • '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.

gaearon avatar gaearon commented on March 28, 2024

fully agree with ^^

from create-react-app.

lacker avatar lacker commented on March 28, 2024

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.

lacker avatar lacker commented on March 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.