dillon1000/react
Commit
Browse files [react-cache] Remove `cache` as argument to `read` (#13865)
* [react-cache] Remove `cache` as argument to `read` Updated is API is `Resource.read(key)` instead of `Resource.read(cache, key)`. The cache is read from context using `readContext`. This also removes cache invalidation entirely (other than the default LRU mechanism), as well as the ability to have multiple caches. We'll add it back once `Context.write` lands and we can implement it the right way. Since there's now only a single cache (the global one), we don't actually need to use context yet, but I've added a dummy context anyway so the user gets an error if they attempt to read outside the render phase. * nits * Add test for thenables that resolve multiple times
Changed paths11 files
First-parent comparisonpackages/react-cache/src/LRU.js AddedM packages/react-cache/src/ReactCache.js ModifiedA packages/react-cache/src/__tests__/ReactCache-test.internal.js AddedD packages/react-cache/src/__tests__/ReactCache-test.js DeletedM packages/react-dom/src/__tests__/ReactDOMSuspensePlaceholder-test.internal.js ModifiedM packages/react-reconciler/src/__tests__/ReactSuspense-test.internal.js ModifiedM packages/react-reconciler/src/__tests__/ReactSuspensePlaceholder-test.internal.js ModifiedM packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.internal.js ModifiedM packages/react/src/__tests__/ReactProfiler-test.internal.js ModifiedM packages/react/src/__tests__/ReactProfilerDOM-test.internal.js ModifiedM scripts/rollup/bundles.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…