Skip to content
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

Need logging to explain changes to the plugins spec #10

Open
hzoo opened this issue Feb 20, 2018 · 7 comments
Open

Need logging to explain changes to the plugins spec #10

hzoo opened this issue Feb 20, 2018 · 7 comments

Comments

@hzoo
Copy link
Member

hzoo commented Feb 20, 2018

Basically people are going to complain because the output from babel after updating may be larger than before because the defaults are spec behavior.

  • If they use the plugin explicitly, we can opt-into "loose" for them
  • If they don't, we just need to warn that the default is "spec" or "loose", etc.

Example:
-template-literals - default was previously "spec" -> 'a' + b -> "a".concat(b)

@ljharb
Copy link
Member

ljharb commented Feb 20, 2018

wait, the default for that isn’t spec anymore??

@hzoo
Copy link
Member Author

hzoo commented Feb 20, 2018

Sorry if it doesn't make sense. The v7 default was what was previously spec

@ljharb
Copy link
Member

ljharb commented Feb 20, 2018

Maybe I’m missing context. I’d hope that v7 had more things default to “spec” than in v6; but maybe this issue is about the more generic approach of how to adapt to changing defaults?

@hzoo
Copy link
Member Author

hzoo commented Feb 20, 2018

I'm saying what you are saying, in v7 more things are spec, but that might be unexpected to certain lib authors that didn't want to opt-in to that when they were using loose before.

@ljharb
Copy link
Member

ljharb commented Feb 20, 2018

Makes sense, thanks for clarifying :-)

@noahlemen
Copy link
Member

noahlemen commented Feb 26, 2018

@hzoo i can take a swing at this. thinking about how to most clearly word these notifications

🤔🤔🤔 maybe something like:

-template-literals is now spec-compliant by default. For previous behavior use the loose flag (https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals#loose)

i don't like "For previous behavior" -- not sure how to articulate that bit

@noahlemen
Copy link
Member

noahlemen commented Mar 2, 2018

@hzoo are there any plugins other than the following that are hit here?

  • plugin-proposal-class-properties
  • plugin-transform-template-literals

i haven't yet dug into the code on these to understand completely, but it looks like there were some behavior changes around adding a loose option on there -- but this is a bit of a different case since these didn't have spec previously:

  • plugin-proposal-object-rest-spread
  • plugin-transform-parameters

should we provide some sort of logging on these also?

also -- any thoughts on how this should factor in for users who have loose/spec set on a preset instead of on the standalone plugin? perhaps that's a little bigger than this issue, i need to think more about what might make sense there

edit: oh, that's what you were referring to when you said "explicitly", i get it now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants