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

No support for plugin options in babel standalone #8831

Open
mateuszluczak opened this Issue Oct 9, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@mateuszluczak

mateuszluczak commented Oct 9, 2018

Bug Report

Current Behavior
There is no way to pass configurations for plugins in babel standalone which causes REPL to not work with for example decorators.

Babel Configuration (.babelrc, package.json, cli command)
Example

Environment

  • Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34] 7.0.0-rc4
  • How you are using Babel: [e.g. cli, register, loader] standalone
@babel-bot

This comment has been minimized.

Show comment
Hide comment
@babel-bot

babel-bot Oct 9, 2018

Collaborator

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

Collaborator

babel-bot commented Oct 9, 2018

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

@mateuszluczak mateuszluczak changed the title from No support for plugin configurations in babel standalone to No support for plugin options in babel standalone Oct 9, 2018

@nicolo-ribaudo

This comment has been minimized.

Show comment
Hide comment
@nicolo-ribaudo

nicolo-ribaudo Oct 9, 2018

Member

It is possible: see babel/website#1816 for an example

Member

nicolo-ribaudo commented Oct 9, 2018

It is possible: see babel/website#1816 for an example

@mateuszluczak

This comment has been minimized.

Show comment
Hide comment
@mateuszluczak

mateuszluczak Oct 9, 2018

Is there any way to do it in using standalone used on my own?
I am injecting it to the page and data-plugins on <script> tag don't want to cooperate - I tried switching to stage-0 preset but looks like everywhere decoratorsBeforeExport is not being set by default causing any transpilation to fail as I am unable to set it.

mateuszluczak commented Oct 9, 2018

Is there any way to do it in using standalone used on my own?
I am injecting it to the page and data-plugins on <script> tag don't want to cooperate - I tried switching to stage-0 preset but looks like everywhere decoratorsBeforeExport is not being set by default causing any transpilation to fail as I am unable to set it.

@nicolo-ribaudo

This comment has been minimized.

Show comment
Hide comment
@nicolo-ribaudo

nicolo-ribaudo Oct 9, 2018

Member

Currently it is only supported if you are calling Babel standalone programmatically

Member

nicolo-ribaudo commented Oct 9, 2018

Currently it is only supported if you are calling Babel standalone programmatically

@mateuszluczak

This comment has been minimized.

Show comment
Hide comment
@mateuszluczak

mateuszluczak Oct 9, 2018

Ok, thanks for clarification. I was thinking about creating custom preset and somehow injecting it, but not sure if this would work.

Could you provide some context why decoratorsBeforeExport have no default value in this particular plugin? I would say receiving this error is something that I would not expect based on documentation and if Babel is trying to follow zero configuration trend some default should be provided.

mateuszluczak commented Oct 9, 2018

Ok, thanks for clarification. I was thinking about creating custom preset and somehow injecting it, but not sure if this would work.

Could you provide some context why decoratorsBeforeExport have no default value in this particular plugin? I would say receiving this error is something that I would not expect based on documentation and if Babel is trying to follow zero configuration trend some default should be provided.

@nicolo-ribaudo

This comment has been minimized.

Show comment
Hide comment
@nicolo-ribaudo

nicolo-ribaudo Oct 9, 2018

Member

TC39 has not decided where decorators should go yet, so we don't want to default to a value which might soon become uncompliant.

Zero-config only if you are not using experimental features 😝

Member

nicolo-ribaudo commented Oct 9, 2018

TC39 has not decided where decorators should go yet, so we don't want to default to a value which might soon become uncompliant.

Zero-config only if you are not using experimental features 😝

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