Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Conversation

nicolo-ribaudo
Copy link
Contributor

Classes are more supported than generators, so it's possible that Babel users only compile generators:

  "transform-regenerator": {
    "chrome": "50",
    "opera": "37",
    "edge": "13",
    "firefox": "53",
    "safari": "10",
    "node": "6",
    "ios": "10",
    "samsung": "5",
    "electron": "1.1"
  },
  "transform-classes": {
    "chrome": "46",
    "opera": "33",
    "edge": "13",
    "firefox": "45",
    "safari": "10",
    "node": "5",
    "ios": "10",
    "samsung": "5",
    "electron": "0.36"
  },

Compiling generators inside uncompiled classes is already supported (generator methods), this PR adds support for uncompiled classes inside generators.

Fixes #407

benjamn added 2 commits July 23, 2021 11:04
Assuming the presence of leaping children by passing true is a
safe/conservative strategy, but we can reduce unnecessary explosion in
the common case when neither the superclass expression nor any computed
class property names contain yield expressions or other "leaping" nodes.
@benjamn benjamn self-assigned this Jul 23, 2021
@benjamn
Copy link
Contributor

benjamn commented Jul 23, 2021

Thanks for diving into this, and sorry for the long wait @nicolo-ribaudo!

While attempting to add a few more tests, I think I discovered a bug in @babel/plugin-transform-classes: #487

Since this seems to be an upstream bug, I don't think it needs to hold up the release of these changes.

@benjamn
Copy link
Contributor

benjamn commented Jul 23, 2021

Just published these changes to npm as regenerator-transform@0.15.0, though I used the next tag for now instead of latest.

@nicolo-ribaudo nicolo-ribaudo deleted the fix-class branch July 24, 2021 10:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support generators containing classes
4 participants