Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not transpile async functions #353

Closed
nikku opened this issue Nov 11, 2019 · 2 comments · Fixed by #354
Closed

Do not transpile async functions #353

nikku opened this issue Nov 11, 2019 · 2 comments · Fixed by #354

Comments

@nikku
Copy link
Contributor

nikku commented Nov 11, 2019

Thanks for providing react-form@4 ❤️.

I'm working with front-end requirements that would allow me to use async functions out of the box. Unfortunately I still need to bundle the regenerator runtime in order to use react-form@4.0.0....

This leads me to the question if you could drop transpilation of async functions.

At this point, all browsers except for IE 11 (dead) support async functions, cf. caniuse.

Using babel@7 people that still need to support IE 11 or other (older) browsers could transpile async via overrides.

@timcosta
Copy link

I literally just ran into this same issue when compiling a Gatsby site after adding react-form:

  555 |   _asyncToGenerator(
  556 |   /*#__PURE__*/
> 557 |   regeneratorRuntime.mark(function _callee() {
      | ^
  558 |     var e,
  559 |         needsResubmit,
  560 |         fieldValidationPromises,


  WebpackError: ReferenceError: regeneratorRuntime is not defined

  - index.es.js:557 useForm
    node_modules/react-form/dist/index.es.js:557:1

Love the library, but this sneaky third party dep is causing some pain.

nikku added a commit to nikku/react-form that referenced this issue Nov 11, 2019
@tannerlinsley
Copy link
Collaborator

Yeah, let's do it. One of you wanna submit a PR for that?

nikku added a commit to nikku/react-form that referenced this issue Nov 11, 2019
tannerlinsley pushed a commit that referenced this issue Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants