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

Add type-information for the cached decorator #1482

Closed
1 of 21 tasks
boris-petrov opened this issue Feb 15, 2022 · 4 comments
Closed
1 of 21 tasks

Add type-information for the cached decorator #1482

boris-petrov opened this issue Feb 15, 2022 · 4 comments
Labels
types:core Something is wrong with the Ember type definitions

Comments

@boris-petrov
Copy link

Which package(s) does this enhancement pertain to?

  • @types/ember
  • @types/ember__string
  • @types/ember__polyfills
  • @types/ember__object
  • @types/ember__utils
  • @types/ember__array
  • @types/ember__engine
  • @types/ember__debug
  • @types/ember__runloop
  • @types/ember__error
  • @types/ember__controller
  • @types/ember__component
  • @types/ember__routing
  • @types/ember__application
  • @types/ember__test
  • @types/ember__test-helpers
  • @types/ember__service
  • @types/ember-data
  • @types/rsvp
  • Other
  • I don't know

Please write a user story for this feature

import { cached } from '@glimmer/tracking'; leads to Module '"@glimmer/tracking"' has no exported member 'cached'.. As of Ember 4 the cached decorator is available by default.

I currently work-around that issue by adding:

declare module '@glimmer/tracking' {
  export const cached: PropertyDecorator;
}
@chriskrycho
Copy link
Member

Thanks for writing this up, @boris-petrov. As per the usual flow, we need it documented in Ember itself, and then a PR to DefinitelyTyped will be very welcome and we'll merge it!

@chriskrycho chriskrycho added the types:core Something is wrong with the Ember type definitions label Mar 15, 2022
@andreyfel
Copy link

It is in the docs since Ember 4.5:
https://api.emberjs.com/ember/4.5/functions/@glimmer%2Ftracking/cached

@dfreeman
Copy link
Member

Just a note for posterity here, @glimmer/tracking's types aren't managed in DT—it ships its own declarations, and there's an issue over their noting the missing export: glimmerjs/glimmer.js#408

@boris-petrov
Copy link
Author

Thanks, @dfreeman! In that case, I guess this one can be closed! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types:core Something is wrong with the Ember type definitions
Projects
None yet
Development

No branches or pull requests

4 participants