Skip to content

Commit

Permalink
[be] Remove unshipped experimental <Cache> element type (facebook#28698)
Browse files Browse the repository at this point in the history
Removes the `<Cache />` element type since we're going with a simpler
caching strategy.
  • Loading branch information
josephsavona authored and AndyPengc12 committed Apr 15, 2024
1 parent 1099242 commit c74c7e8
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 1,643 deletions.
2 changes: 0 additions & 2 deletions packages/react-devtools-shared/src/__tests__/store-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,6 @@ describe('Store', () => {
<FakeHigherOrderComponent />
<MemoizedFakeHigherOrderComponent />
<ForwardRefFakeHigherOrderComponent />
<React.unstable_Cache />
<MemoizedFakeHigherOrderComponentWithDisplayNameOverride />
<ForwardRefFakeHigherOrderComponentWithDisplayNameOverride />
</React.Fragment>
Expand Down Expand Up @@ -1603,7 +1602,6 @@ describe('Store', () => {
<Baz> [withFoo][withBar]
<Baz> [Memo][withFoo][withBar]
<Baz> [ForwardRef][withFoo][withBar]
<Cache>
<memoRefOverride>
<forwardRefOverride>
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
Profiler,
StrictMode,
Suspense,
unstable_Cache as Cache,
} from 'react';

const Context = createContext('abc');
Expand Down
20 changes: 0 additions & 20 deletions packages/react-reconciler/src/ReactFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
isHostSingletonType,
} from './ReactFiberConfig';
import {
enableCache,
enableProfilerTimer,
enableScopeAPI,
enableLegacyHidden,
Expand Down Expand Up @@ -66,7 +65,6 @@ import {
ScopeComponent,
OffscreenComponent,
LegacyHiddenComponent,
CacheComponent,
TracingMarkerComponent,
} from './ReactWorkTags';
import {OffscreenVisible} from './ReactFiberActivityComponent';
Expand Down Expand Up @@ -104,7 +102,6 @@ import {
REACT_SCOPE_TYPE,
REACT_OFFSCREEN_TYPE,
REACT_LEGACY_HIDDEN_TYPE,
REACT_CACHE_TYPE,
REACT_TRACING_MARKER_TYPE,
} from 'shared/ReactSymbols';
import {TransitionTracingMarker} from './ReactFiberTracingMarkerComponent';
Expand Down Expand Up @@ -560,11 +557,6 @@ export function createFiberFromTypeAndProps(
return createFiberFromScope(type, pendingProps, mode, lanes, key);
}
// Fall through
case REACT_CACHE_TYPE:
if (enableCache) {
return createFiberFromCache(pendingProps, mode, lanes, key);
}
// Fall through
case REACT_TRACING_MARKER_TYPE:
if (enableTransitionTracing) {
return createFiberFromTracingMarker(pendingProps, mode, lanes, key);
Expand Down Expand Up @@ -807,18 +799,6 @@ export function createFiberFromLegacyHidden(
return fiber;
}

export function createFiberFromCache(
pendingProps: any,
mode: TypeOfMode,
lanes: Lanes,
key: null | string,
): Fiber {
const fiber = createFiber(CacheComponent, pendingProps, key, mode);
fiber.elementType = REACT_CACHE_TYPE;
fiber.lanes = lanes;
return fiber;
}

export function createFiberFromTracingMarker(
pendingProps: any,
mode: TypeOfMode,
Expand Down
Loading

0 comments on commit c74c7e8

Please sign in to comment.