You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typescript preset does nothing in current REPL beta #8117
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.
Reacted by Bruno Lemos, Andrew Bradley and Evan Henley
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.
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)
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.
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.
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.
Activity
babel-bot commentedon Jun 5, 2018
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.
loganfsmyth commentedon Jun 5, 2018
This is pending babel/website#1666 because the filename is currently hard-coded to "repl", so the presets doesn't see it as a
.tsfile.loganfsmyth commentedon Jun 5, 2018
This was a change from https://github.com/babel/babel/pull/7955/files#diff-a31d321b4911bbbc31e1d19a726637c6R30 so that Babel differentiates
.js,.ts, and.tsx.simonbuchan commentedon Jun 5, 2018
Alternative fix is to provide
allExtensions: truein the preset (and presumablyisTSX: trueifreactis provided, though I assume that just also enablessyntax-jsx?)#7955 seems a little odd to force this, since you could use
overridesfor the same behavior (though, obviously for more work)loganfsmyth commentedon Jun 5, 2018
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?
simonbuchan commentedon Jun 5, 2018
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.
loganfsmyth commentedon Jun 5, 2018
Fair!
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.
danez commentedon May 25, 2019
Closing as this is website related and there is already discussion in the linked PR.
JLHwung commentedon Nov 11, 2019
It is now fixed.