Skip to content

Commit

Permalink
Revert "Fix/use editor state inside canvas" (#6105)
Browse files Browse the repository at this point in the history
Reverts #6099
balazsbajorics authored Jul 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7591c49 commit 4271d2e
Showing 8 changed files with 65 additions and 138 deletions.
1 change: 0 additions & 1 deletion editor/src/components/canvas/canvas-component-entry.tsx
Original file line number Diff line number Diff line change
@@ -112,7 +112,6 @@ const CanvasComponentEntryInner = React.memo((props: CanvasComponentEntryProps)
</>
)
})
CanvasComponentEntryInner.displayName = 'CanvasComponentEntryInner'

function DomWalkerWrapper(props: UiJsxCanvasPropsWithErrorCallback) {
let [updateInvalidatedPaths] = useDomWalkerInvalidateCallbacks()
40 changes: 19 additions & 21 deletions editor/src/components/canvas/remix/utopia-remix-root-component.tsx
Original file line number Diff line number Diff line change
@@ -5,7 +5,12 @@ import type { DataRouteObject, Location, RouteObject } from 'react-router'
import { createMemoryRouter, RouterProvider } from 'react-router'
import { UTOPIA_PATH_KEY } from '../../../core/model/utopia-constants'
import type { ElementPath } from '../../../core/shared/project-file-types'
import { Substores, useSelectorWithCallback } from '../../editor/store/store-hook'
import {
useRefEditorState,
useEditorState,
Substores,
useSelectorWithCallback,
} from '../../editor/store/store-hook'
import * as EP from '../../../core/shared/element-path'
import { PathPropHOC } from './path-props-hoc'
import { atom, useAtom, useSetAtom } from 'jotai'
@@ -18,11 +23,6 @@ import { AlwaysFalse, usePubSubAtomReadOnly } from '../../../core/shared/atom-wi
import { CreateRemixDerivedDataRefsGLOBAL } from '../../editor/store/remix-derived-data'
import { patchRoutesWithContext } from '../../../third-party/remix/create-remix-stub'
import type { AppLoadContext } from '@remix-run/server-runtime'
import {
useAllowRerenderOnlyOnAllElements,
useCanvasState,
useRefCanvasState,
} from '../ui-jsx-canvas-renderer/canvas-state-hooks'

type RouteModule = RouteModules[keyof RouteModules]
type RouterType = ReturnType<typeof createMemoryRouter>
@@ -77,20 +77,19 @@ export function useRemixNavigationContext(
}

function useGetRouteModules(basePath: ElementPath) {
const remixDerivedDataRef = useRefCanvasState((store) => store.derived.remixData)
const projectContentsRef = useRefCanvasState((store) => store.editor.projectContents)
const fileBlobsRef = useRefCanvasState((store) => store.editor.canvas.base64Blobs)
const hiddenInstancesRef = useRefCanvasState((store) => store.editor.hiddenInstances)
const displayNoneInstancesRef = useRefCanvasState((store) => store.editor.displayNoneInstances)
const remixDerivedDataRef = useRefEditorState((store) => store.derived.remixData)
const projectContentsRef = useRefEditorState((store) => store.editor.projectContents)
const fileBlobsRef = useRefEditorState((store) => store.editor.canvas.base64Blobs)
const hiddenInstancesRef = useRefEditorState((store) => store.editor.hiddenInstances)
const displayNoneInstancesRef = useRefEditorState((store) => store.editor.displayNoneInstances)

let metadataContext: UiJsxCanvasContextData = forceNotNull(
`Missing UiJsxCanvasCtxAtom provider`,
usePubSubAtomReadOnly(UiJsxCanvasCtxAtom, AlwaysFalse),
)

const defaultExports = useCanvasState(
const defaultExports = useEditorState(
Substores.derived,
useAllowRerenderOnlyOnAllElements(),
(store) => {
const routeModuleCreators = store.derived.remixData?.routeModuleCreators ?? {}
return Object.values(routeModuleCreators).map(
@@ -172,18 +171,17 @@ export const RouteExportsForRouteObject: Array<keyof RouteObject> = [
function useGetRoutes(
getLoadContext?: (request: Request) => Promise<AppLoadContext> | AppLoadContext,
) {
const routes = useCanvasState(
const routes = useEditorState(
Substores.derived,
useAllowRerenderOnlyOnAllElements(),
(store) => store.derived.remixData?.routes ?? [],
'UtopiaRemixRootComponent routes',
)

const remixDerivedDataRef = useRefCanvasState((store) => store.derived.remixData)
const projectContentsRef = useRefCanvasState((store) => store.editor.projectContents)
const fileBlobsRef = useRefCanvasState((store) => store.editor.canvas.base64Blobs)
const hiddenInstancesRef = useRefCanvasState((store) => store.editor.hiddenInstances)
const displayNoneInstancesRef = useRefCanvasState((store) => store.editor.displayNoneInstances)
const remixDerivedDataRef = useRefEditorState((store) => store.derived.remixData)
const projectContentsRef = useRefEditorState((store) => store.editor.projectContents)
const fileBlobsRef = useRefEditorState((store) => store.editor.canvas.base64Blobs)
const hiddenInstancesRef = useRefEditorState((store) => store.editor.hiddenInstances)
const displayNoneInstancesRef = useRefEditorState((store) => store.editor.displayNoneInstances)

let metadataContext: UiJsxCanvasContextData = forceNotNull(
`Missing UiJsxCanvasCtxAtom provider`,
@@ -292,7 +290,7 @@ export interface UtopiaRemixRootComponentProps {
}

export const UtopiaRemixRootComponent = (props: UtopiaRemixRootComponentProps) => {
const remixDerivedDataRef = useRefCanvasState((store) => store.derived.remixData)
const remixDerivedDataRef = useRefEditorState((store) => store.derived.remixData)

const routes = useRoutesWithIdEquality(props.getLoadContext)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -59,4 +59,3 @@ export const RemixSceneComponent = React.memo((props: React.PropsWithChildren<Re
</div>
)
})
RemixSceneComponent.displayName = 'RemixSceneComponent'
39 changes: 18 additions & 21 deletions editor/src/components/canvas/ui-jsx-canvas.tsx
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ import {
getListOfEvaluatedFiles,
} from '../../core/shared/code-exec-utils'
import { forceNotNull } from '../../core/shared/optional-utils'
import { EditorStateContext, useRefEditorState } from '../editor/store/store-hook'
import { useRefEditorState } from '../editor/store/store-hook'
import { matchRoutes } from 'react-router'
import { useAtom } from 'jotai'
import { RemixNavigationAtom } from './remix/utopia-remix-root-component'
@@ -559,26 +559,23 @@ export const UiJsxCanvas = React.memo<UiJsxCanvasPropsWithErrorCallback>((props)
all: 'initial',
}}
>
{/* deliberately breaking useEditorState and useRefEditorState to enforce the usage of useCanvasState */}
<EditorStateContext.Provider value={null}>
<Helmet>{parse(linkTags)}</Helmet>
<ElementsToRerenderContext.Provider
value={useKeepReferenceEqualityIfPossible(ElementsToRerenderGLOBAL.current)} // TODO this should either be moved to EditorState or the context should be moved to the root level
>
<RerenderUtopiaCtxAtom.Provider value={rerenderUtopiaContextValue}>
<UtopiaProjectCtxAtom.Provider value={utopiaProjectContextValue}>
<CanvasContainer
validRootPaths={rootValidPathsArray}
canvasRootElementElementPath={storyboardRootElementPath}
>
<SceneLevelUtopiaCtxAtom.Provider value={sceneLevelUtopiaContextValue}>
{StoryboardRoot}
</SceneLevelUtopiaCtxAtom.Provider>
</CanvasContainer>
</UtopiaProjectCtxAtom.Provider>
</RerenderUtopiaCtxAtom.Provider>
</ElementsToRerenderContext.Provider>
</EditorStateContext.Provider>
<Helmet>{parse(linkTags)}</Helmet>
<ElementsToRerenderContext.Provider
value={useKeepReferenceEqualityIfPossible(ElementsToRerenderGLOBAL.current)} // TODO this should either be moved to EditorState or the context should be moved to the root level
>
<RerenderUtopiaCtxAtom.Provider value={rerenderUtopiaContextValue}>
<UtopiaProjectCtxAtom.Provider value={utopiaProjectContextValue}>
<CanvasContainer
validRootPaths={rootValidPathsArray}
canvasRootElementElementPath={storyboardRootElementPath}
>
<SceneLevelUtopiaCtxAtom.Provider value={sceneLevelUtopiaContextValue}>
{StoryboardRoot}
</SceneLevelUtopiaCtxAtom.Provider>
</CanvasContainer>
</UtopiaProjectCtxAtom.Provider>
</RerenderUtopiaCtxAtom.Provider>
</ElementsToRerenderContext.Provider>
</div>
)
})
6 changes: 2 additions & 4 deletions editor/src/components/editor/store/store-hook.ts
Original file line number Diff line number Diff line change
@@ -128,10 +128,9 @@ export const useEditorState = <K extends StoreKey, S extends (typeof Substores)[
selector: StateSelector<Parameters<S>[0], U>,
selectorName: string,
equalityFn: (oldSlice: U, newSlice: U) => boolean = shallowEqual,
storeContext: React.Context<UtopiaStoreAPI | null> = EditorStateContext,
): U => {
const storeKey: K = storeKey_.name as K
const context = React.useContext(storeContext)
const context = React.useContext(EditorStateContext)

const wrappedSelector = useWrapSelectorInPerformanceMeasureBlock(storeKey, selector, selectorName)

@@ -222,9 +221,8 @@ export const useSelectorWithCallback = <K extends StoreKey, S extends (typeof Su
export const useRefEditorState = <U>(
selector: StateSelector<EditorStorePatched, U>,
explainMe = false,
storeContext: React.Context<UtopiaStoreAPI | null> = EditorStateContext,
): { readonly current: U } => {
const context = React.useContext(storeContext)
const context = React.useContext(EditorStateContext)
if (context == null) {
throw new Error('useStore is missing from editor context')
}
Original file line number Diff line number Diff line change
@@ -1259,12 +1259,12 @@ Array [

exports[`React Render Count Tests - Clicking on opacity slider with a less simple project 2`] = `
Array [
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedFunctionComponent(DomWalkerWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedClass(RemoteDependencyBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedClass(CanvasErrorBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedFunctionComponent(DomWalkerWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedClass(RemoteDependencyBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedClass(CanvasErrorBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedClass(CanvasErrorBoundary)/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/Symbol(react.memo)()",
"/UtopiaSpiedClass(CanvasErrorBoundary)/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
@@ -1274,7 +1274,6 @@ Array [
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.provider))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.provider))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
@@ -1558,12 +1557,12 @@ Array [
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))/EventHandlersSection/Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))/EventHandlersSection/UtopiaSpiedExoticType(Symbol(react.fragment))",
"//UtopiaSpiedExoticType(Symbol(react.fragment))/PropertyLabel/Symbol(react.forward_ref)(EmotionCssPropInternal)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedFunctionComponent(DomWalkerWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedClass(RemoteDependencyBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedClass(CanvasErrorBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedFunctionComponent(DomWalkerWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedClass(RemoteDependencyBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedClass(CanvasErrorBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedClass(CanvasErrorBoundary)/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/Symbol(react.memo)()",
"/UtopiaSpiedClass(CanvasErrorBoundary)/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
@@ -1574,7 +1573,6 @@ Array [
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.provider))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.provider))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
@@ -2403,12 +2401,12 @@ Array [

exports[`React Render Count Tests - Clicking on opacity slider with a simple project 2`] = `
Array [
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedFunctionComponent(DomWalkerWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedClass(RemoteDependencyBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedClass(CanvasErrorBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedFunctionComponent(DomWalkerWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedClass(RemoteDependencyBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedClass(CanvasErrorBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedClass(CanvasErrorBoundary)/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/Symbol(react.memo)()",
"/UtopiaSpiedClass(CanvasErrorBoundary)/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
@@ -2418,7 +2416,6 @@ Array [
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.provider))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.provider))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
@@ -2690,12 +2687,12 @@ Array [
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))/TextShadowSubsection/Symbol(react.forward_ref)(Styled(div))",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))/TextShadowSubsection/div",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))/TextShadowSubsection/UtopiaSpiedFunctionComponent(InspectorContextMenuWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedFunctionComponent(DomWalkerWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedClass(RemoteDependencyBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedClass(CanvasErrorBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/CanvasComponentEntryInner/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedFunctionComponent(DomWalkerWrapper)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedClass(RemoteDependencyBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedClass(CanvasErrorBoundary)",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)//UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedClass(CanvasErrorBoundary)/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/Symbol(react.memo)()",
"/UtopiaSpiedClass(CanvasErrorBoundary)/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedClass(RemoteDependencyBoundary)/UtopiaSpiedFunctionComponent(DomWalkerWrapper)/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
@@ -2706,7 +2703,6 @@ Array [
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedFunctionComponent(Provider)",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.provider))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//UtopiaSpiedExoticType(Symbol(react.provider))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))//div",
"/UtopiaSpiedExoticType(Symbol(react.provider))/Symbol(react.provider)/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
"/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedFunctionComponent(Provider)/UtopiaSpiedExoticType(Symbol(react.fragment))",
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ describe('React Render Count Tests -', () => {

const renderCountAfter = renderResult.getNumberOfRenders()
// if this breaks, GREAT NEWS but update the test please :)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`791`)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`789`)
expect(renderResult.getRenderInfo()).toMatchSnapshot()
})

@@ -127,7 +127,7 @@ describe('React Render Count Tests -', () => {

const renderCountAfter = renderResult.getNumberOfRenders()
// if this breaks, GREAT NEWS but update the test please :)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`1139`)
expect(renderCountAfter - renderCountBefore).toMatchInlineSnapshot(`1137`)
expect(renderResult.getRenderInfo()).toMatchSnapshot()
})

0 comments on commit 4271d2e

Please sign in to comment.