-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Store] Documentation should tell something about store lifetimes #8510
Comments
ah, that is supposed to be optional. Will fix :) some limited documentation for this does exist (and I've updated the RFC with it too here emberjs/rfcs#919) but since we don't publish canary/beta api docs anywhere right now it's only viewable in the source code here: data/packages/store/src/-private/store-service.ts Lines 220 to 237 in 1edb6d0
My hope is that once the initial implementation "settles" (e.g. all current EmberData paradigms integrate with the RequestManager and upgraded cache in a first-class way) that we'll offer something you can plugin to ensure a sensible default lifetime based on either meta, a number of milliseconds in your config, e-tags in the response headers, or even by parsing information out of the |
It is in fact hugely appreciated, I very - very - very rarely get feedback on alpha and beta cycles. In fact the lack of this feedback is part of why EmberData generally does not do beta cycles (hence 4.12 being alpha currently even though it will release next week), because otherwise the length of time between implementation and feedback leads to a very slow dev-cycle with a great deal of context-loss and higher number of patches. |
I upgraded to I don't know the default settings which are in use now by |
Going to reopen until I figure out what's up. Broadly speaking, you shouldn't ever need to set lifetimes but you should need to do the same configuration as is in |
To be crystal clear, I'm extending import Store, { CacheHandler } from '@ember-data/store';
......
export default class StoreService extends Store {
....
} |
@Jopie01 I think for your use case it is, but it means you've got to mirror the setup that ember-data/store would have done. If you're on discord mind finding me and giving me a call? It might help me fix a few things faster here. |
Not much to see in https://github.com/emberjs/data/blob/15049beed153f1375b3eb2bfd9ba31da744b7e14/packages/-ember-data/addon/-private/index.ts which I'm not doing already. But can it be that 'legacy' never reaches a function where
Sorry I don't have discord, but if it helps I can send the code (after cleaning up) |
Yeah access to the repo / at least the store and request manager setup bits would be helpful |
Just pushed everything and added you as collaborator. But I think you will end up doing something similar as |
Sorry for flooding with issues 😢 But hopefully it will help hammering out the nasty details.
When requesting data through the store you will get the error
I found the function here: https://github.com/emberjs/data/blob/main/packages/store/src/-private/cache-handler.ts#L68 and in particular https://github.com/emberjs/data/blob/main/packages/store/src/-private/cache-handler.ts#L15
So I added in the
constructor
of my routeWhich solves the error but to me this basically disables the cache right? So maybe in the documentation the lifetimes of the
store
can be explained in more detail?The text was updated successfully, but these errors were encountered: