Skip to content

Commit

Permalink
Remove some unused methods
Browse files Browse the repository at this point in the history
When Float was first implemented the HostDispatcher was set and unset during each render. Now that we support dispatching globally the host extensions that did this Dispatcher shuffling is now a noop. Since these methods exist in all HostConfigs and they noop everywhere now we shoudl just remove them.
  • Loading branch information
gnoff committed Apr 5, 2023
1 parent 1d0c328 commit ed97c69
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 53 deletions.
8 changes: 0 additions & 8 deletions packages/react-art/src/ReactARTHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,3 @@ export function suspendInstance(type, props) {}
export function waitForCommitToBeReady() {
return null;
}
// eslint-disable-next-line no-undef
export function prepareRendererToRender(container: Container): void {
// noop
}

export function resetRendererAfterRender(): void {
// noop
}
10 changes: 0 additions & 10 deletions packages/react-dom-bindings/src/client/ReactDOMHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -1931,16 +1931,6 @@ export function prepareToCommitHoistables() {
tagCaches = null;
}

// It is valid to preload even when we aren't actively rendering. For cases where Float functions are
// called when there is no rendering we track the last used document. It is not safe to insert
// arbitrary resources into the lastCurrentDocument b/c it may not actually be the document
// that the resource is meant to apply too (for example stylesheets or scripts). This is only
// appropriate for resources that don't really have a strict tie to the document itself for example
// preloads
export function prepareRendererToRender(rootContainer: Container) {}

export function resetRendererAfterRender() {}

// global collections of Resources
const preloadPropsMap: Map<string, PreloadProps> = new Map();
const preconnectsSet: Set<string> = new Set();
Expand Down
8 changes: 0 additions & 8 deletions packages/react-native-renderer/src/ReactFabricHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,3 @@ export function suspendInstance(type: Type, props: Props): void {}
export function waitForCommitToBeReady(): null {
return null;
}

export function prepareRendererToRender(container: Container): void {
// noop
}

export function resetRendererAfterRender() {
// noop
}
8 changes: 0 additions & 8 deletions packages/react-native-renderer/src/ReactNativeHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,3 @@ export function suspendInstance(type: Type, props: Props): void {}
export function waitForCommitToBeReady(): null {
return null;
}

export function prepareRendererToRender(container: Container): void {
// noop
}

export function resetRendererAfterRender(): void {
// noop
}
3 changes: 0 additions & 3 deletions packages/react-noop-renderer/src/createReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
},

waitForCommitToBeReady,

prepareRendererToRender() {},
resetRendererAfterRender() {},
};

const hostConfig = useMutation
Expand Down
4 changes: 0 additions & 4 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ import {
afterActiveInstanceBlur,
getCurrentEventPriority,
errorHydratingContainer,
prepareRendererToRender,
resetRendererAfterRender,
startSuspendingCommit,
waitForCommitToBeReady,
preloadInstance,
Expand Down Expand Up @@ -1850,7 +1848,6 @@ export function shouldRemainOnPreviousScreen(): boolean {
}

function pushDispatcher(container: any) {
prepareRendererToRender(container);
const prevDispatcher = ReactCurrentDispatcher.current;
ReactCurrentDispatcher.current = ContextOnlyDispatcher;
if (prevDispatcher === null) {
Expand All @@ -1864,7 +1861,6 @@ function pushDispatcher(container: any) {
}

function popDispatcher(prevDispatcher: any) {
resetRendererAfterRender();
ReactCurrentDispatcher.current = prevDispatcher;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ describe('ReactFiberHostContext', () => {
waitForCommitToBeReady() {
return null;
},
prepareRendererToRender: function () {},
resetRendererAfterRender: function () {},
supportsMutation: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ export const preloadInstance = $$$hostConfig.preloadInstance;
export const startSuspendingCommit = $$$hostConfig.startSuspendingCommit;
export const suspendInstance = $$$hostConfig.suspendInstance;
export const waitForCommitToBeReady = $$$hostConfig.waitForCommitToBeReady;
export const prepareRendererToRender = $$$hostConfig.prepareRendererToRender;
export const resetRendererAfterRender = $$$hostConfig.resetRendererAfterRender;

// -------------------
// Microtasks
Expand Down
8 changes: 0 additions & 8 deletions packages/react-test-renderer/src/ReactTestHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,3 @@ export function suspendInstance(type: Type, props: Props): void {}
export function waitForCommitToBeReady(): null {
return null;
}

export function prepareRendererToRender(container: Container): void {
// noop
}

export function resetRendererAfterRender(): void {
// noop
}

0 comments on commit ed97c69

Please sign in to comment.