Coder Social home page Coder Social logo

Comments (3)

babel-bot avatar babel-bot commented on May 24, 2024

Hey @karyon! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

from website.

JLHwung avatar JLHwung commented on May 24, 2024

I agree that it could be confusing to users. Here I provide some context:

The current REPL was designed when stage-x presets were still a thing. Later we deprecated the preset in favor of preset-env but we didn't figure out a way to demonstrate Babel's ability to transform many ES proposals on REPL: So the stage-2 preset, as well as other stage presets become convenient toggles on REPL: They let you see how Babel transforms ES proposals like decorators, pipeline operators, records and tuples and so on, since they will not be covered by preset-env until they are advanced to stage 4.

from website.

karyon avatar karyon commented on May 24, 2024

I see. So first I thought that class fields were transpiled because the stage-x presets wasn't updated in five years, as the npm package turned up by the google search suggested. Your comment sounds like they are actually still updated with new proposals. Which made me wonder again, why are class fields transpiled even though they are in stage 4 by now? Looking at the code, it seems like proposals cannot be removed from the stage-x presets because that would be a breaking change, which is understandable but does not make sense in the context of the REPL and adds to the confusion there.

So I see multiple ways to fix my source of confusion:

  • Replace the stage-x presets in the REPL by something that's closer to the recommended way to use such proposal plugins
  • Remove stage-4 proposals from the stage-x presets in the REPL
  • Remove the stage-2 preset from the default presets (preferably together with the fix above)

If the stage-x presets are kept, what would also help:

  • Provide some clarity, like putting them in a "experimental syntax presets" section, and explaining that these presets are just a showcase and not meant to be actually used.
  • Document which plugins are contained. I couldn't find that information apart from searching in babel's code.

from website.

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.