-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[v10] feat(cache): promise based caching with workers #3245
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
base: master
Are you sure you want to change the base?
Conversation
This reverts commit f23ecaf.
…ixedStages also has substepDeltas returning an array of deltas for each substep
…alues and now that we have deltas there are useland ways to hanlde this
feat: implement update lifecycle with useUpdate
Releases: @react-three/[email protected] @react-three/[email protected] [skip ci]
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5e53956:
|
|
|
@CodyJasonBennett How can I check if this PR fixes the issue trying to be solved by #3243 ? |
|
I'll add tests once we can reproduce issues with error boundaries also. I don't expect that to be addressed here. |
packages/fiber/src/core/hooks.tsx
Outdated
| // Apply loader extensions | ||
| if (extensions) extensions(loader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to keep this and deopt calls to useLoader with extensions to only cache for the caller component? Can pass React.useId to discern the component.
useLoaderin favor of passing in already extended loader instances.Caching was hidden behind
react-suspendand did not offer any way to utilize browser APIs or extend it. This PR addsPromiseCacheclass that creates a local cache compatible withReact.usebacked by the webCacheAPI. TheCacheAPI offers many benefits such as:fetch.The
PromiseCacheaccesses and processes resources from the global cache while handling promises for you.It looks like this when combined with
React.use:TODO
Testing is broken.jestdoesn't mock theCacheAPI orfetch. Trying to polyfill either proved harder than I expected.