Skip to content
GitLab
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
  • !366

Use fast-async for async/await support

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/timdorr/fast-async into master Aug 04, 2016
  • Overview 5
  • Commits 1
  • Pipelines 0
  • Changes 3

Created by: timdorr

fast-async is based on nodent, a generator-optional implementation of async/await support.

By default, it does not use generators, which saves the usage of regenerator if generator functions are not otherwise used. It is also significantly faster, with order-of-magnitude perf gains on mobile browsers in particular.

It also smaller, reducing gzipped file size by 1.44KB in a simple test case:

File sizes after gzip:

  48.7 KB (+1.44 KB)  build/static/js/main.c60c74db.js
  289 B               build/static/css/main.9a0fe4f1.css

Test case code:

class App extends Component {
  async componentDidMount() {
    try {
      const response = await fetch('https://jsonplaceholder.typicode.com/posts/1');
      const data = await response.json();
      console.log(data);
    } catch (lol) {
      alert('oh noes')
    }
  }

  //...
}

I'm not an expert on this library, so there may be further gains to be had from better tuning. But on the surface, we're already getting a good bump on both speed and size.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/timdorr/fast-async