babel / babel/proposals

Class Fields (Stage 3)

Open
#12 42 comments 42 reactions 0 assignees View on GitHub
Proposal Issue Transform: In Progress
Dominant language
No language data
Stars
435
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Original issue submitted by @babel-bot in https://github.com/babel/babel/issues/4408

Champions: @jeffmo (public class fields) @littledan (private + combined)
Spec Repo: https://github.com/tc39/proposal-class-fields
Spec Text: https://tc39.github.io/proposal-class-fields/
Slides: https://drive.google.com/file/d/0B-TAClBGyqSxWHpyYmg2UnRHc28/view

> Moved to Stage 3 at the July 2017 meeting: https://github.com/tc39/agendas/blob/master/2017/07.md (https://twitter.com/lbljeffmo/status/890679542007738368)

## Examples

```js
class C {
static x = 1, #y, [a];
z, #w = 2, [b];

a() {
this.z;
this.#w++;
#w; // #w is this.#w
}
}
```

## Parsing/ESTree
- [x] AST handled already in current `classProperties` and `classPrivateProperties`.
- [ ] May need to rename though (new plugin name).
- [x] make sure no "private computed" parse
- [ ] need to support comma separated properties.

## Transform
- [ ] combine the class-properties plugin + tbd private properties one

## Contacts
- [#proposal-class-fields](https://babeljs.slack.com/messages/proposal-class-fields) on Slack!
- @littledan
- @diervo (dval on Slack)
- @Qantas94Heavy

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the current classProperties and classPrivateProperties AST handling, then review the linked TC39 proposal and spec. The remaining checklist covers possible plugin renaming, comma-separated properties, and combining the class-properties and private-properties transforms; done means those Stage 3 requirements are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.