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 types for Next.js #22836

Merged
merged 3 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ executors:
default: 'small'
working_directory: /tmp/storybook
docker:
- image: mcr.microsoft.com/playwright:v1.32.3-focal
- image: mcr.microsoft.com/playwright:v1.34.3-focal
environment:
NODE_OPTIONS: --max_old_space_size=6144
resource_class: <<parameters.class>>
Expand Down
5 changes: 2 additions & 3 deletions code/frameworks/nextjs/src/routing/app-router-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import type {
PathnameContext as TPathnameContext,
SearchParamsContext as TSearchParamsContext,
} from 'next/dist/shared/lib/hooks-client-context';
// @ts-expect-error (TODO: valentin needs to fix this)
import type { FlightRouterState } from 'next/dist/server/app-render';
import type { FlightRouterState } from 'next/dist/server/app-render/types';
import type { RouteParams } from './types';

/**
Expand Down Expand Up @@ -83,7 +82,7 @@ const AppRouterProvider: React.FC<AppRouterProviderProps> = ({ children, action,
childNodes: new Map(),
tree: [pathname, { children: getParallelRoutes([...segments]) }],
url: pathname,
// @ts-expect-error (TODO: valentin needs to fix this)
// @ts-expect-error Necessary for earlier versions of Next 13. Remove as soon as Next.js should not be supported anymore.
headRenderedAboveThisLevel: true,
}}
>
Expand Down
6 changes: 2 additions & 4 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,12 @@
"defaults"
],
"resolutions": {
"@playwright/test": "1.32.3",
"@playwright/test": "1.34.3",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/experimental-utils": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"esbuild": "^0.17.0",
"eslint": "^8.28.0",
"playwright": "1.32.3",
"serialize-javascript": "^3.1.0"
},
"dependencies": {
Expand All @@ -99,7 +98,7 @@
"@jest/globals": "^29.3.1",
"@linear/sdk": "^1.21.0",
"@nx/workspace": "16.2.1",
"@playwright/test": "1.32.3",
"@playwright/test": "^1.34.3",
"@storybook/addon-a11y": "workspace:*",
"@storybook/addon-actions": "workspace:*",
"@storybook/addon-backgrounds": "workspace:*",
Expand Down Expand Up @@ -246,7 +245,6 @@
"node-gyp": "^8.4.0",
"nx": "16.2.1",
"nx-cloud": "16.0.5",
"playwright": "1.32.3",
"prettier": "2.8.0",
"process": "^0.11.10",
"raf": "^3.4.1",
Expand Down
33 changes: 16 additions & 17 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5013,19 +5013,19 @@ __metadata:
languageName: node
linkType: hard

"@playwright/test@npm:1.32.3":
version: 1.32.3
resolution: "@playwright/test@npm:1.32.3"
"@playwright/test@npm:1.34.3":
version: 1.34.3
resolution: "@playwright/test@npm:1.34.3"
dependencies:
"@types/node": "*"
fsevents: 2.3.2
playwright-core: 1.32.3
playwright-core: 1.34.3
dependenciesMeta:
fsevents:
optional: true
bin:
playwright: cli.js
checksum: d09e4135c868b4067f45b8c297d02b0d8ddb8298657c942a06c72f3d9a3236af94586718dc7590693dbb31ea4b8fcceeb8a1e8811072f2add7d952c5c9129df3
checksum: b87b3666568378997e6e300c28a5062d099377f66894c2d30855ef0b574a0874f5e4e6e7d25d93f1db1e5e402ccc1a254a1c24ec829a64ec47b4c8071082c9a7
languageName: node
linkType: hard

Expand Down Expand Up @@ -7217,7 +7217,7 @@ __metadata:
"@jest/globals": ^29.3.1
"@linear/sdk": ^1.21.0
"@nx/workspace": 16.2.1
"@playwright/test": 1.32.3
"@playwright/test": ^1.34.3
"@storybook/addon-a11y": "workspace:*"
"@storybook/addon-actions": "workspace:*"
"@storybook/addon-backgrounds": "workspace:*"
Expand Down Expand Up @@ -7364,7 +7364,6 @@ __metadata:
node-gyp: ^8.4.0
nx: 16.2.1
nx-cloud: 16.0.5
playwright: 1.32.3
prettier: 2.8.0
process: ^0.11.10
raf: ^3.4.1
Expand Down Expand Up @@ -25037,23 +25036,23 @@ __metadata:
languageName: node
linkType: hard

"playwright-core@npm:1.32.3":
version: 1.32.3
resolution: "playwright-core@npm:1.32.3"
"playwright-core@npm:1.34.3":
version: 1.34.3
resolution: "playwright-core@npm:1.34.3"
bin:
playwright: cli.js
checksum: 8b94feb15084813607abac69ef3d4f78b345bcc89e322706e62c203b79e74096caf499ce4cd4103b1bfc853f17a9ff0573f636dc0ee88f56a5cb6ed18ce55f06
playwright-core: cli.js
checksum: 2e3ec8394b69bcd55db3a01a0a2cf63ee4b924bd79852c237d3eb045273f056b5784ab2147f60a7bb2db7998b8f7c5ec34d8554dd7648cc77d5affc9d91a85c8
languageName: node
linkType: hard

"playwright@npm:1.32.3":
version: 1.32.3
resolution: "playwright@npm:1.32.3"
"playwright@npm:^1.24.2":
version: 1.34.3
resolution: "playwright@npm:1.34.3"
dependencies:
playwright-core: 1.32.3
playwright-core: 1.34.3
bin:
playwright: cli.js
checksum: 26a3a8897d1a41cd5d001859521ee44b3ac21618e638d3b2a58615672b2f325a6cdeb614dabc6b120999d8874f260c9786683644b13fe07476d4a3a47fcfff1f
checksum: e17c0dbfc87f8764d1e34762b27d561d34a1e3dccc5d4e5d08edbf58e582d49e86ecf161f7f21af103a35045ae5a9cf0169204aa9c0a808046116cb2cc9f415c
languageName: node
linkType: hard

Expand Down
3 changes: 1 addition & 2 deletions scripts/utils/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export const addPackageResolutions = async ({ cwd, dryRun }: YarnOptions) => {
...storybookVersions,
'enhanced-resolve': '~5.10.0', // TODO, remove this
// this is for our CI test, ensure we use the same version as docker image, it should match version specified in `./code/package.json` and `.circleci/config.yml`
'@playwright/test': '1.32.3',
playwright: '1.32.3',
'@playwright/test': '^1.34.3',
};
await writeJSON(packageJsonPath, packageJson, { spaces: 2 });
};
Expand Down