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

[JavaScript] Implemented decorators. #1483

Merged
merged 3 commits into from
May 7, 2018

Conversation

Thom1729
Copy link
Collaborator

@Thom1729 Thom1729 commented Mar 27, 2018

Supersedes #1236.

Implements the decorators proposal, resolving #1477. The proposal is just shy of our usual standard of adoption: it's Stage 2 and expected to advance, and a conformant implementation is expected for Babel 7 (though a nonconformant implementation has existed for years). For historical reasons, there's a fair bit of code out there using decorators anyway, and because the feature is on the standards track I think it's reasonable to add it.

The proposed syntax is not completely finalized, but it is a virtual certainty that it will be a subset of this implementation (based on the LeftExpression production). Radical change is extremely unlikely at this point.

Currently, decorators are the sole major core ECMAScript feature supported by Babel-sublime but absent from the core syntax. JS Custom offers an implementation, though it's lower-quality than this one. It is likely that Babel-sublime will be "rebased" off the core syntax some time after the next stable release, and core decorator support would be an asset to that change.

@Thom1729
Copy link
Collaborator Author

Thom1729 commented May 3, 2018

Because this proposal is expected to be included in Babel 7 (currently in beta), and because this is the last major piece of JavaScript syntax supported by Babel-sublime but missing from core, it would be really nice if this would make the upcoming stable release.

There is one open question regarding the syntax of the decorators proposal. However, this PR should be compatible with either possible outcome. This PR actually highlights a superset of valid syntax, which simplifies the implementation and handles errors more gracefully.

@wbond wbond merged commit fc5336d into sublimehq:master May 7, 2018
@Thom1729 Thom1729 deleted the javascript-decorators branch May 7, 2018 02:26
deathaxe pushed a commit to deathaxe/sublime-packages that referenced this pull request Jun 9, 2019
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

Successfully merging this pull request may close these issues.

2 participants