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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark cached as a MethodDecorator instead of PropertyDecorator #20579

Merged
merged 1 commit into from Dec 12, 2023

Conversation

boris-petrov
Copy link
Contributor

I believe that's more correct as cached uses/needs descriptor which is only available in MethodDecorator.

cc @dfreeman, @chriskrycho, @jamescdavis, @wagenet

Sorry for pinging so many people but I'm not sure who I should. 馃槃 Is there like a TypeScript team that I can mention?

@kategengler
Copy link
Member

@emberjs/typescript-core ^

@gitKrystan
Copy link
Contributor

I've run into this also. Pinging the rest of the TS team to see if there's a reason it was typed as PropertyDecorator in the first place.

@chriskrycho
Copy link
Contributor

As you can see here at the implementation, it is鈥β爊ot well-typed, and I think the use of PropertyDecorator was basically just someone鈥檚 guess at the right thing at some point, which has stuck around. 馃槀 On digging back through the relevant TS docs, I think this should actually be an accessor decorator (see here specifically), and as far as I can tell the only corresponding type TS supplies is indeed MethodDecorator, so this seems like the right move. 馃憤馃徏

@kategengler kategengler merged commit 3b8d412 into emberjs:main Dec 12, 2023
17 of 18 checks passed
@kategengler
Copy link
Member

Thank you!

@boris-petrov boris-petrov deleted the cached-type branch December 14, 2023 07:51
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.

None yet

4 participants