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

ECMAScript Private fields not implemented in 3.7? #33925

Closed
chimericdream opened this issue Oct 10, 2019 · 5 comments
Closed

ECMAScript Private fields not implemented in 3.7? #33925

chimericdream opened this issue Oct 10, 2019 · 5 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@chimericdream
Copy link

chimericdream commented Oct 10, 2019

According to the release notes and iteration plan, the private fields proposal for ECMAScript is supposed to be part of 3.7, but #30829 doesn't appear to be merged yet, and the actual syntax still causes an error. Is it still planned for the 3.7 release, or will it come later with a 3.7 patch (or 3.8)?

TypeScript Version: 3.7.0-beta

Search Terms: private fields, ecma private

Code

class FooBar {
    #fizz: string = '';
    private buzz: string = '';
}

Expected behavior: This should be valid syntax in 3.7.0-beta, according to the release notes and issue tracker.

Actual behavior: This does not appear to be valid syntax in the beta.

Playground Link: https://www.typescriptlang.org/play/index.html?ts=3.7-Beta&ssl=1&ssc=1&pln=4&pc=2#code/MYGwhgzhAEBiD28BCYBO0DeAoavoGIAzASwC9SAuaCAF1WIDsBzaAXmgHIOBuHPAB3oA3MDQCm0AEYBXclVr1mbTjywBfIA

@j-oliveras
Copy link
Contributor

According to the beta release notes is not part, the PR is not merged #30829.

@chimericdream
Copy link
Author

Good point. It is mentioned a few times in the iteration plan (#33352), though. So I was mainly wondering if it's still planned to happen in 3.7 (even if not the initial release) or if it's been bumped to 3.8.

@kitsonk
Copy link
Contributor

kitsonk commented Oct 10, 2019

Wouldn't it be better to ask that question on the iteration plan issue, or the existing issues instead of opening a new one? I don't know if you have noticed, but there is a lot of noise, which you are adding to.

@DanielRosenwasser DanielRosenwasser added the Question An issue which isn't directly actionable in code label Oct 10, 2019
@typescript-bot
Copy link
Collaborator

This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow.

@RyanCavanaugh
Copy link
Member

Right before the 3.7 feature window closed, we were made aware of a post made to a private TC39 forum that indicated the class fields proposal was possibly not going to move forward with the currently-proposed semantics. Additionally, the proposal covers both private and public fields, the latter of which has runtime breaking change impact on many TypeScript users, and we've exercised additional caution in the interests of not causing more ambiguity or migration pain than absolutely necessary.

For these reasons, we held off on merging the feature in 3.7. We're committed to merging the feature once it is clear that the semantics of private and public fields are headed to stage 4 without major changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

6 participants