Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !4222
Something went wrong while fetching comments. Please try again.

Support async generator functions and for-await statements

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/n3tr/babel-async-generator-functions into next 7 years ago
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: n3tr

Aim to resolve #4206 (closed)

Add @babel/plugin-proposal-async-generator-functions in babel config to support async generator functions and for-await statements

async function* agf() {
  await 1;
  yield 2;
}

Test steps

  • yarn create-react-app my-agf-app
  • cd my-agf-app
  • Add async function* agf() { } to index.js
  • yarn start
  • App starts and works
Compare
  • next (base)

and
  • latest version
    b7c50ce5
    1 commit, 2 years ago

2 files
+ 4
- 0

    Preferences

    File browser
    Compare changes
packages/babel-‎preset-react-app‎
inde‎x.js‎ +3 -0
packag‎e.json‎ +1 -0
packages/babel-preset-react-app/index.js
+ 3
- 0
  • View file @ b7c50ce5


@@ -93,6 +93,9 @@ module.exports = function(api, opts) {
require('@babel/plugin-transform-destructuring').default,
// class { handleClick = () => { } }
require('@babel/plugin-proposal-class-properties').default,
// Support async generator functions and for-await
// async function* agf() { await 1; yield 2; }
require('@babel/plugin-proposal-async-generator-functions').default,
// The following two plugins use Object.assign directly, instead of Babel's
// extends helper. Note that this assumes `Object.assign` is available.
// { ...todo, completed: true }
packages/babel-preset-react-app/package.json
+ 1
- 0
  • View file @ b7c50ce5


@@ -13,6 +13,7 @@
],
"dependencies": {
"@babel/core": "7.0.0-beta.42",
"@babel/plugin-proposal-async-generator-functions": "^7.0.0-beta.42",
"@babel/plugin-proposal-class-properties": "7.0.0-beta.42",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.42",
"@babel/plugin-syntax-dynamic-import": "7.0.0-beta.42",
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
2
CLA Signed tag: bug fix
2
CLA Signed tag: bug fix
    Assign labels
  • Manage project labels

Milestone
2.0
2.0 (expired)
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: facebook/create-react-app!4222
Source branch: github/fork/n3tr/babel-async-generator-functions

Menu

Explore Projects Groups Snippets