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

Separate "static" private and public fields into a different flag #7111

Closed
littledan opened this issue Dec 27, 2017 · 11 comments
Closed

Separate "static" private and public fields into a different flag #7111

littledan opened this issue Dec 27, 2017 · 11 comments
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@littledan
Copy link

TC39 demoted static private and public field declarations to Stage 2 (PR). They are being pursued in a separate proposal instead. Static fields should be moved to a separate flag which is included in the Stage 2 preset.

@babel-bot
Copy link
Collaborator

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

@Jessidhia
Copy link
Member

I'm not sure this is possible at all without splitting it into two separate transforms 🤔

@littledan
Copy link
Author

I implemented the split in V8 by throwing a syntax error when seeing static fields in the syntax. The actual implementation under that stayed untouched, so most of the work was getting the tests split up properly.

@littledan
Copy link
Author

By the way, about compatibility with existing users of the transform: What if we made two smaller transforms, public-instance-fields and public-static-fields, and made the existing transform alias the combination?

@nicolo-ribaudo
Copy link
Member

That shouldn't be a problem, since we already removed the old export-extensions plugin when we split it.

@xtuc
Copy link
Member

xtuc commented Nov 6, 2018

@nicolo-ribaudo what should we do here? could we close this issue now?

@xtuc xtuc added the i: stale label Nov 6, 2018
@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Nov 6, 2018

We can do this, it should be straightforward and non-breaking with the new class-features plugin.

@littledan We were planning to have only three flags: "class fields", "private methods" and "decorators". What would you prefer?

@xtuc xtuc removed the i: stale label Nov 6, 2018
@xtuc
Copy link
Member

xtuc commented Nov 6, 2018

Ok, should we change this issue to a beginner-friendly one?

@nicolo-ribaudo
Copy link
Member

Yes 👍
I'll write a good description on how to separate them later.

@littledan
Copy link
Author

At this point, I am not sure if there is much demand for separating out static and instance features. The current split seems fine to me.

@nicolo-ribaudo
Copy link
Member

Ok 👍

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

5 participants