Skip to content
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

fix: fully support react 19 typings #8154

Draft
wants to merge 14 commits into
base: next
Choose a base branch
from
4 changes: 2 additions & 2 deletions dev/design-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"dependencies": {
"@sanity/icons": "^3.5.6",
"@sanity/ui": "^2.10.14",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
8 changes: 4 additions & 4 deletions dev/embedded-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
"dependencies": {
"@sanity/ui": "^2.10.14",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
},
"devDependencies": {
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "5.7.2",
"vite": "^5.4.11"
Expand Down
5 changes: 2 additions & 3 deletions dev/page-building-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
"dependencies": {
"@sanity/vision": "workspace:*",
"babel-plugin-react-compiler": "19.0.0-beta-55955c9-20241229",
"react": "^18.2.0",
"react-compiler-runtime": "19.0.0-beta-55955c9-20241229",
"react-dom": "^18.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-icons": "^5.2.1",
"sanity": "workspace:*",
"styled-components": "^6.1.8"
Expand Down
2 changes: 1 addition & 1 deletion dev/page-building-studio/sanity.cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default defineCliConfig({
projectId: 'ppsg7ml5',
dataset: 'page-building',
},
reactCompiler: {target: '18'},
reactCompiler: {target: '19'},
})
4 changes: 2 additions & 2 deletions dev/starter-next-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"dependencies": {
"next": "^14.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
5 changes: 2 additions & 3 deletions dev/starter-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
},
"dependencies": {
"babel-plugin-react-compiler": "19.0.0-beta-55955c9-20241229",
"react": "^18.3.1",
"react-compiler-runtime": "19.0.0-beta-55955c9-20241229",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion dev/starter-studio/sanity.cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export default defineCliConfig({
projectId: 'ppsg7ml5',
dataset: 'test',
},
reactCompiler: {target: '18'},
reactCompiler: {target: '19'},
})
4 changes: 2 additions & 2 deletions dev/strict-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"start": "../.bin/sanity start"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
5 changes: 2 additions & 3 deletions dev/studio-e2e-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
"@sanity/ui": "^2.10.14",
"@sanity/vision": "3.68.3",
"babel-plugin-react-compiler": "19.0.0-beta-55955c9-20241229",
"react": "^18.3.1",
"react-compiler-runtime": "19.0.0-beta-55955c9-20241229",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"sanity-plugin-markdown": "^5.0.0",
"sanity-plugin-media": "^2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion dev/studio-e2e-testing/sanity.cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default defineCliConfig({
projectId: process.env.SANITY_E2E_PROJECT_ID,
dataset: process.env.SANITY_E2E_DATASET,
},
reactCompiler: {target: '18'},
reactCompiler: {target: '19'},
vite: {
define: {
'process.env.SANITY_E2E_PROJECT_ID': JSON.stringify(process.env.SANITY_E2E_PROJECT_ID),
Expand Down
4 changes: 2 additions & 2 deletions dev/test-create-integration-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
},
"dependencies": {
"@sanity/code-input": "^5.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
7 changes: 3 additions & 4 deletions dev/test-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@sanity/tsdoc": "1.0.157",
"@sanity/types": "workspace:*",
"@sanity/ui": "^2.10.14",
"@sanity/ui-workshop": "^1.0.0",
"@sanity/ui-workshop": "^2.0.20",
"@sanity/util": "workspace:*",
"@sanity/uuid": "^3.0.1",
"@sanity/vision": "workspace:*",
Expand All @@ -51,9 +51,8 @@
"history": "^5.3.0",
"lodash": "^4.17.21",
"qs": "^6.10.2",
"react": "^18.3.1",
"react-compiler-runtime": "19.0.0-beta-55955c9-20241229",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-refractor": "^2.1.6",
"refractor": "^3.6.0",
"rxjs": "^7.8.0",
Expand Down
4 changes: 2 additions & 2 deletions dev/test-studio/sanity.cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default defineCliConfig({
reactStrictMode: true,
reactCompiler: millionLintEnabled
? {
target: '18',
target: '19',
sources: (filename) => {
/**
* This is the default filter when `sources` is not defined.
Expand All @@ -43,7 +43,7 @@ export default defineCliConfig({
)
},
}
: {target: '18'},
: {target: '19'},
vite(viteConfig: UserConfig): UserConfig {
const reactProductionProfiling = process.env.REACT_PRODUCTION_PROFILING === 'true'

Expand Down
4 changes: 2 additions & 2 deletions examples/blog-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"start": "sanity dev --port 3336"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/clean-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"start": "sanity dev --port 3338"
},
"dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/ecommerce-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"dependencies": {
"@sanity/cli": "3.68.3",
"@sanity/ui": "^2.10.14",
"react": "^18.3.1",
"react": "^19.0.0",
"react-barcode": "^1.4.1",
"react-dom": "^18.3.1",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/movies-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
},
"dependencies": {
"@sanity/google-maps-input": "^4.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.0"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"@types/glob": "^7.2.0",
"@types/lodash": "^4.17.7",
"@types/node": "^22.10.0",
"@types/react": "^18.3.12",
"@types/react": "^19.0.2",
"@types/semver": "^7.5.6",
"@types/yargs": "^17.0.7",
"@typescript-eslint/eslint-plugin": "^7.18.0",
Expand Down
7 changes: 5 additions & 2 deletions packages/@sanity/block-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
},
"dependencies": {
"@sanity/types": "3.68.3",
"@types/react": "^18.3.5",
"get-random-values-esm": "1.0.2",
"lodash": "^4.17.21"
},
Expand All @@ -60,11 +59,15 @@
"@sanity/schema": "3.68.3",
"@types/jsdom": "^20.0.0",
"@types/lodash": "^4.17.7",
"@types/react": "^19.0.2",
"@vercel/stega": "0.1.2",
"@vitest/coverage-v8": "^2.1.1",
"@vitest/coverage-v8": "^2.1.8",
"jsdom": "^23.0.1",
"vitest": "^2.1.8"
},
"peerDependencies": {
"@types/react": "18 || 19"
},
"publishConfig": {
"access": "public"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/cli/test/__fixtures__/v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
},
"dependencies": {
"groq": "^3.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "^3.0.0",
"styled-components": "^6.1.0"
}
Expand Down
28 changes: 14 additions & 14 deletions packages/@sanity/cli/test/test-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@
"typegen": "sanity schema extract && sanity typegen generate"
},
"dependencies": {
"@sanity/assist": "^3.0.8",
"@sanity/assist": "^3.0.9",
"@sanity/icons": "^3.5.7",
"@sanity/image-url": "^1.0.2",
"@sanity/preview-url-secret": "^2.0.0",
"@sanity/vision": "^3.62.0",
"@sanity/image-url": "^1.1.0",
"@sanity/preview-url-secret": "^2.0.5",
"@sanity/vision": "^3.68.3",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^22.7.8",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vercel/speed-insights": "^1.0.13",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@vercel/speed-insights": "^1.1.0",
"autoprefixer": "^10.4.20",
"date-fns": "^4.1.0",
"next": "^15.0.0",
"next-sanity": "^9.7.0",
"next": "^15.1.3",
"next-sanity": "^9.8.30",
"postcss": "^8.4.47",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sanity": "^3.62.0",
"sanity-plugin-asset-source-unsplash": "^3.0.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"sanity": "^3.68.3",
"sanity-plugin-asset-source-unsplash": "^3.0.2",
"server-only": "^0.0.1",
"styled-components": "^6.1.13",
"tailwindcss": "^3.4.14",
"typescript": "5.7.2"
},
"devDependencies": {
"eslint": "^9.13.0",
"eslint-config-next": "^15.0.0"
"eslint-config-next": "^15.1.3"
}
}

2 changes: 1 addition & 1 deletion packages/@sanity/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@sanity/icons": "^3.5.7",
"@types/lodash": "^4.17.7",
"@types/object-inspect": "^1.13.0",
"@types/react": "^18.3.12",
"@types/react": "^19.0.2",
"rimraf": "^5.0.10",
"vitest": "^2.1.8"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"@repo/package.config": "workspace:*",
"@repo/test-config": "workspace:*",
"@sanity/insert-menu": "1.0.18",
"@types/react": "^18.3.5",
"@types/react": "^19.0.2",
"@vitejs/plugin-react": "^4.3.4",
"react": "^18.3.1",
"react": "^19.0.0",
"rimraf": "^5.0.10",
"vitest": "^2.1.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/vision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@
"@sanity/util": "workspace:*",
"@types/lodash": "^4.17.7",
"babel-plugin-react-compiler": "19.0.0-beta-55955c9-20241229",
"react": "^18.3.1",
"react": "^19.0.0",
"sanity": "workspace:*",
"styled-components": "^6.1.13"
},
"peerDependencies": {
"react": "^18 || ^19.0.0",
"react": "^18 || ^19",
"styled-components": "^6.1"
}
}
2 changes: 1 addition & 1 deletion packages/@sanity/vision/src/components/ResultView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {ResultViewWrapper} from './ResultView.styled'

const lru = new LRU({maxSize: 50000})

export function ResultView(props: {data: unknown; datasetName: string}): JSX.Element {
export function ResultView(props: {data: unknown; datasetName: string}): React.JSX.Element {
const {data, datasetName} = props
const workspaceDataset = useDataset()

Expand Down
10 changes: 5 additions & 5 deletions packages/@sanity/vision/src/components/VisionGui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ interface VisionGuiState {
}

export class VisionGui extends PureComponent<VisionGuiProps, VisionGuiState> {
_visionRoot: RefObject<HTMLDivElement>
_queryEditorContainer: RefObject<HTMLDivElement>
_paramsEditorContainer: RefObject<HTMLDivElement>
_operationUrlElement: RefObject<HTMLInputElement>
_customApiVersionElement: RefObject<HTMLInputElement>
_visionRoot: RefObject<HTMLDivElement | null>
_queryEditorContainer: RefObject<HTMLDivElement | null>
_paramsEditorContainer: RefObject<HTMLDivElement | null>
_operationUrlElement: RefObject<HTMLInputElement | null>
_customApiVersionElement: RefObject<HTMLInputElement | null>
_resizeListener: ResizeObserver | undefined
_querySubscription: Subscription | undefined
_listenSubscription: Subscription | undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "prj-with-react-19",
"private": true,
"dependencies": {
"react": "19.0.0-rc-f994737d14-20240522",
"react-dom": "19.0.0-rc-f994737d14-20240522",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"styled-components": "^6.1.0"
}
}
Loading
Loading