-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Support @bound decorator #3635
Comments
Yeah, we don't plan to support decorators until their specification is more stable. There is no Babel plugin that implements the current specification so supporting them now would create a burden on our users in the future. |
@gaearon Is there a particular stage you guys are waiting for? Not critiquing, just curious. Dropping this here to watch for everyone interested in decorator support babel/proposals#11 |
It's really interesting. @gaearon what proposal stage is acceptable for a certain feature to be included in CRA? |
@miraage we generally only accept stage 4 (finalized) or very few stage 3 if they're known to be exceptionally stable, or we're willing to provide a code mod migrating people off the specification |
@Timer thank you for the information |
Use of the @bound decorator is important to React people
Instead of having the hack:
We would want to write, in the name of canonical stack traces:
This is made possible by decorators from the fine @babel project
And we can use @brigand class-bind or other to get this done today
I apologize for this looking like 90s Java code, but it is actually great
Here’s the preparation:
And here’s a test-patch for src/App.js:
The browser console output:
Here’s what it could look like when live:
Awesomeness and profit…
The text was updated successfully, but these errors were encountered: