Support for decorators stage 3 proposal with accessor
#3373
-
The decorators spec has progressed to stage 3 and has introduced the new Is there any plan to introduce support for decorating Context: we currently have a very large code base on mobx 5. We would like to upgrade to mobx 6 but consider it a risk due to the required Ideally, if mobx were to support the accessor keyword in a future version, we would be able to leapfrog mobx 6 to the next version. https://github.com/tc39/proposal-decorators#class-auto-accessors Links to related issues: Thank you for all your awesome work! |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 14 replies
-
MobX 6 deprecated decorators exactly because we want to be able to switch to the standard proposal in the future. I've been involved designing the proposal, and we'll pick it up further once a transpilers are available.
Please note that a codemod is available |
Beta Was this translation helpful? Give feedback.
-
In principle no, it's a stopgap. But please note that proposals move
slowly, this one has taken 7 years at least so far.
…On Sat, 23 Apr 2022, 23:31 Toby Rahilly, ***@***.***> wrote:
Do you think makeObservable will be required after switching to the new
standard? Or is that unknown at this point?
—
Reply to this email directly, view it on GitHub
<#3373 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBDQYX6ISLLDOWL6LR3VGR23ZANCNFSM5T56BUPQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Typescript 5 will support stage 3 decorators, do you plan supporting it? |
Beta Was this translation helpful? Give feedback.
-
@mweststrate Can I ask where 2022.3/stage 3 decorators place on your timeline/priorities and whether you've outlined any plans/requirements/test cases? This would be a big feature for me both at home and work, so I want to do a PR if you (or someone else on the MobX team) are available to jump on reviews and bounce with me on iterations. |
Beta Was this translation helpful? Give feedback.
-
Technical question: Once the stage 3 decorators support is implemented in mobx, is it possible that the requirement for |
Beta Was this translation helpful? Give feedback.
-
@Matchlighter Sorry for the naive question, but I don't understand something. |
Beta Was this translation helpful? Give feedback.
-
Just merged :) |
Beta Was this translation helpful? Give feedback.
-
Great, but I must say that I'm a bit confused on how my configuration should look like in order to use decorators on my MobX code
Thanks! |
Beta Was this translation helpful? Give feedback.
-
… On Sat, 11 Nov 2023, 18:45 Gil Amran, ***@***.***> wrote:
Great, but I must say that I'm a bit confused on how my configuration
should look like in order to use decorators on my MobX code
- What's the minimal TypeScript version that I must use?
- Should I use experimentalDecorators: true on my tsconfig.json ?
- Same question regarding useDefineForClassFields
- Do I still have to call makeObservable on my constructors?
Thanks!
—
Reply to this email directly, view it on GitHub
<#3373 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBG6VYAIJUBK6TX3IFTYD62UJAVCNFSM5T56BUP2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TONJUGE2TSOA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I still don't understand one thing. First the docs says:
Then the docs says:
So do I still need I believe that this piece is completely unclear and requires rewriting. |
Beta Was this translation helpful? Give feedback.
MobX 6 deprecated decorators exactly because we want to be able to switch to the standard proposal in the future. I've been involved designing the proposal, and we'll pick it up further once a transpilers are available.
Please note that a codemod is available