Skip to content

Typescript preset does nothing in current REPL beta #8117

Closed

Description

@simonbuchan

Bug Report

Current Behavior

The typescript preset in the repl since 7.0.0-beta.48 doesn't enable any plugins, leading to syntax errors on any typescript syntax.

Input Code

Note the UI shows a version behind due to #6174 - is something still holding up #7039?

Searching for and enabling (the second?) syntax-typescript allows parsing again, so it's something about the preset, not the plugins being broken or something.

Activity

  1. babel-bot commented on Jun 5, 2018

    @babel-bot
    Collaborator

    Hey @simonbuchan! 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.

  2. loganfsmyth commented on Jun 5, 2018

    @loganfsmyth
    Member

    This is pending babel/website#1666 because the filename is currently hard-coded to "repl", so the presets doesn't see it as a .ts file.

  3. loganfsmyth commented on Jun 5, 2018

    @loganfsmyth
    Member
  4. simonbuchan commented on Jun 5, 2018

    @simonbuchan
    Author

    Alternative fix is to provide allExtensions: true in the preset (and presumably isTSX: true if react is provided, though I assume that just also enables syntax-jsx?)

    #7955 seems a little odd to force this, since you could use overrides for the same behavior (though, obviously for more work)

  5. loganfsmyth commented on Jun 5, 2018

    @loganfsmyth
    Member

    We could, but the more we do stuff like that, the more the REPL diverges from what users would actually see in their own project, which I'd rather avoid.

    What specifically makes that PR seem odd?

  6. simonbuchan commented on Jun 5, 2018

    @simonbuchan
    Author

    Right, that makes sense, though the UX about switching to typescript seems like it would be tricky to get feeling right.

    Sorry, probably "surprising" is a better term? I just didn't expect plugins to have the power to apply presets per file, so it seems a little magic coming from babel 6. From the tsc side, it makes perfect sense, and means it's much easier to migrate and set up.

  7. loganfsmyth commented on Jun 5, 2018

    @loganfsmyth
    Member

    Sorry, probably "surprising" is a better term?

    Fair!

    I just didn't expect plugins to have the power to apply presets per file

    Yeah, it's all relatively new, but where we're ending up is that presets are allowed to set configuration like that, but plugins don't have nearly as much access to that kind of thing.

  8. danez commented on May 25, 2019

    @danez
    Member

    Closing as this is website related and there is already discussion in the linked PR.

  9. added
    outdated
    on Aug 24, 2019
  10. locked as resolved and limited conversation to collaborators on Aug 24, 2019
  11. JLHwung commented on Nov 11, 2019

    @JLHwung
    Contributor

    It is now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdated

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions