-
Notifications
You must be signed in to change notification settings - Fork 2
[PLAT-8122] upgrade framework - Next v16.2 & React 19.2 #224
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
91adb24
cb6d214
5262eb1
9d32246
faebee3
dc8e507
7145a12
2a26e7c
1273f2e
fec9a98
d9ca99a
2b26539
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| /// <reference path="./.next/types/routes.d.ts" /> | ||
| import "./.next/types/routes.d.ts"; | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import path from "node:path"; | ||
|
|
||
| import type { NextConfig } from "next"; | ||
|
|
||
| const nextConfig: NextConfig = { | ||
| turbopack: { | ||
| // Linked workspace packages live outside this app directory. | ||
| // Turbopack needs its root raised to resolve those symlink targets. | ||
| root: path.join(process.cwd(), ".."), | ||
| // Module resolution aliases for monorepo/portal setup | ||
| // Ensures consistent react/react-dom resolution across packages | ||
| resolveAlias: { | ||
| react: "./node_modules/react", | ||
| "react-dom": "./node_modules/react-dom", | ||
| "react/jsx-runtime": "./node_modules/react/jsx-runtime", | ||
| "react/jsx-dev-runtime": "./node_modules/react/jsx-dev-runtime", | ||
| }, | ||
| // Custom rules for non-standard file types | ||
| rules: { | ||
| "*.worker.js": { | ||
| type: "asset", | ||
| }, | ||
| }, | ||
| }, | ||
|
|
||
| // Webpack config only needed for features not yet supported by Turbopack | ||
| // Most webpack customization has been moved to turbopack config above | ||
| webpack: (config) => { | ||
| config.resolve = config.resolve ?? {}; | ||
| config.resolve.alias = { | ||
| ...(config.resolve.alias ?? {}), | ||
|
Check warning on line 31 in next.config.ts
|
||
| react: path.join(process.cwd(), "node_modules/react"), | ||
| "react-dom": path.join(process.cwd(), "node_modules/react-dom"), | ||
| "react/jsx-runtime": path.join(process.cwd(), "node_modules/react/jsx-runtime"), | ||
| "react/jsx-dev-runtime": path.join( | ||
| process.cwd(), | ||
| "node_modules/react/jsx-dev-runtime" | ||
| ), | ||
|
Comment on lines
+36
to
+40
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these entries are here to keep mismatch version of react from local @vertexvis/viewer-react from conflicting. Could be commented out or maybe added as instruction for local sdk testing in readme 🤔 |
||
| }; | ||
|
|
||
| // Note: Next.js automatically handles: | ||
| // - publicPath (set to /_next/ by default) | ||
| // - assetModuleFilename (handled by Next.js internally) | ||
|
|
||
| return config; | ||
| }, | ||
| }; | ||
|
|
||
| export default nextConfig; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,31 +11,33 @@ | |
| "@mui/material": "^7.3.10", | ||
| "@vertexvis/api-client-node": "^0.42.0", | ||
| "@vertexvis/viewer-react": "^0.24.3", | ||
| "next": "^15.5.15", | ||
| "react": "^18.3.0", | ||
| "react-dom": "^18.3.0", | ||
| "react-hotkeys-hook": "^3.4.7" | ||
| "next": "^16.2.4", | ||
| "react": "^19.2.5", | ||
| "react-dom": "^19.2.5", | ||
| "react-hotkeys-hook": "^5.2.4" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^7.29.0", | ||
| "@types/node": "^22.0.41", | ||
| "@types/react": "^18.0.28", | ||
| "@types/react-dom": "^18.3.7", | ||
| "@typescript-eslint/eslint-plugin": "^5.62.0", | ||
| "@typescript-eslint/parser": "^5.62.0", | ||
| "@types/react": "^19.2.14", | ||
| "@types/react-dom": "^19.2.3", | ||
| "@typescript-eslint/eslint-plugin": "^8.59.0", | ||
| "@typescript-eslint/parser": "^8.59.0", | ||
| "babel-plugin-import": "^1.13.8", | ||
| "eslint": "^8.57.1", | ||
| "eslint-config-next": "^15.5.0", | ||
| "eslint-config-prettier": "^8.10.2", | ||
| "eslint-plugin-simple-import-sort": "^7.0", | ||
| "eslint": "^10.2.1", | ||
| "eslint-config-next": "^16.2.4", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-plugin-simple-import-sort": "^13.0", | ||
| "prettier": "^2.8.8", | ||
| "tslib": "^2.4.0", | ||
| "typescript": "^5.2.0" | ||
| }, | ||
| "scripts": { | ||
| "build": "next build", | ||
| "build": "next build --webpack", | ||
| "build:turbopack": "next build", | ||
| "clean": "rm -rf .next/ node_modules/", | ||
| "dev": "next", | ||
| "dev": "next dev --webpack", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new Next.js wants turbopack. Something with local yarn linking was really not liking turbopack, but seems to work fine when that isn't in play |
||
| "dev:turbopack": "next dev", | ||
| "format": "prettier --write './**/*.+(js|jsx|ts|tsx|json|yml|yaml|md|mdx|html|css)'", | ||
| "lint": "next lint", | ||
| "start": "next start", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| import dynamic from "next/dynamic"; | ||
| import { useRouter } from "next/router"; | ||
| import React from "react"; | ||
| import React, { JSX } from "react"; | ||
| import { useHotkeys } from "react-hotkeys-hook"; | ||
|
|
||
| import { | ||
|
|
@@ -16,7 +17,11 @@ | |
| import { Layout, RightDrawerWidth } from "./Layout"; | ||
| import { encodeCreds, OpenDialog } from "./OpenScene"; | ||
| import { RightDrawer } from "./RightDrawer"; | ||
| import { Viewer } from "./Viewer"; | ||
|
|
||
| const Viewer = dynamic( | ||
| () => import("./Viewer").then((module) => module.Viewer), | ||
| { ssr: false } | ||
| ); | ||
|
|
||
| export interface Props { | ||
| readonly config: Configuration; | ||
|
|
@@ -45,7 +50,12 @@ | |
|
|
||
| // On credentials changes, update URL. | ||
| React.useEffect(() => { | ||
| if (credentials) router.push(encodeCreds(credentials)); | ||
| if (!credentials) return; | ||
|
|
||
| const nextUrl = encodeCreds(credentials); | ||
| if (router.asPath === nextUrl) return; | ||
|
|
||
| void router.replace(nextUrl, undefined, { shallow: true }); | ||
|
Check failure on line 58 in src/components/Home.tsx
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, shouldn't. Will clean |
||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [credentials]); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serverless-next is dead project 😿 . superseded in spirit by OpenNext