Skip to content

Commit e343afa

Browse files
authored
[next.js] Remove error from Next.js 16 with default Turbopack support (#28)
* [next.js] Remove error from Next.js 16 with default Turbopack support * changeset * Set up Next.js devtools MCP * Remove eslint from next.config.ts * Remove eslint and migrate to biome * Migrate to Biome and disable checks until the next PR * Fix unit tests * Finish cleanup * Fix comment * Stop running CI for Node.js 18
1 parent 44098b9 commit e343afa

File tree

40 files changed

+510
-874
lines changed

40 files changed

+510
-874
lines changed

.changeset/smart-donkeys-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vercel/microfrontends': patch
3+
---
4+
5+
Remove an error from withMicrofrontends when using Next.js 16 with default Turbopack support.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
node-version: [18.x, 20.x, 22.x]
20+
node-version: [20.x, 22.x]
2121

2222
steps:
2323
- name: Checkout
@@ -34,7 +34,7 @@ jobs:
3434
uses: actions/setup-node@v4
3535
with:
3636
node-version: ${{ matrix.node-version }}
37-
cache: "pnpm"
37+
cache: 'pnpm'
3838

3939
- name: Install Dependencies
4040
id: pnpm-install

.mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"next-devtools": {
4+
"command": "npx",
5+
"args": ["-y", "next-devtools-mcp@latest"]
6+
}
7+
}
8+
}

.syncpackrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"dependencies": ["next", "@next/**"],
4141
"dependencyTypes": ["!peer"],
4242
"packages": ["**"],
43-
"pinVersion": "15.5.4"
43+
"pinVersion": "16.0.10"
4444
},
4545
{
4646
"dependencies": ["react", "react-dom"],

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md

CLAUDE.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,20 @@ This is a monorepo for `@vercel/microfrontends`, a library that enables splittin
2929
- `pnpm typecheck` - Run TypeScript type checking
3030
- `pnpm checks` - Run build, lint, test, and typecheck on all packages (run before submitting PRs)
3131

32-
### Start examples
32+
When running commands for a specific application, do not `cd` into the directory. Run commands from the root. The above commands can be run for a particular package by using a filter option: `pnpm checks -F <package name>`. Use this.
33+
34+
Make sure that `pnpm checks` is successful for the entire repository when verifying a change.
35+
36+
### Dev examples
3337

3438
- `pnpm dev:nextjs-app` - Run the Next.js App Router example
3539
- `pnpm dev:nextjs-pages` - Run the Next.js Pages Router example
3640
- `pnpm dev:react-router` - Run the React Router example
3741
- `pnpm dev:single-spa` - Run the single-spa example
3842
- `pnpm dev:sveltekit` - Run the SvelteKit example
3943

44+
When testing a change, make sure that these dev commands all start up the server successfully. If the server is running and there are no errors after 30 seconds, consider that successful.
45+
4046
### NPM Package Management
4147

4248
- `pnpm changeset` - Create a changeset for releasing

biome.jsonc

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true,
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"indentStyle": "space",
14+
"indentWidth": 2,
15+
"lineWidth": 80,
16+
"lineEnding": "lf",
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": {
21+
"recommended": true,
22+
"correctness": {
23+
// TODO: Re-enable after fixing unused function parameters across the codebase
24+
"noUnusedFunctionParameters": "off",
25+
// TODO: Re-enable after cleaning up unused imports
26+
"noUnusedImports": "off",
27+
// TODO: Re-enable after fixing unused variables
28+
"noUnusedVariables": "off",
29+
// TODO: Consider re-enabling - disabled for parseInt without radix
30+
"useParseIntRadix": "off",
31+
// TODO: Re-enable after fixing React hook dependencies
32+
"useExhaustiveDependencies": "off",
33+
// TODO: Re-enable after fixing unknown CSS media features
34+
"noUnknownMediaFeatureName": "off",
35+
},
36+
"suspicious": {
37+
// TODO: Re-enable after adding proper TypeScript types
38+
"noExplicitAny": "off",
39+
// TODO: Re-enable if not using document.cookie directly
40+
"noDocumentCookie": "off",
41+
// TODO: Re-enable after verifying CSS @rules
42+
"noUnknownAtRules": "off",
43+
// TODO: Already fixed duplicate properties, can be re-enabled
44+
"noDuplicateProperties": "off",
45+
// TODO: Already fixed suspicious semicolons, can be re-enabled
46+
"noSuspiciousSemicolonInJsx": "off",
47+
// TODO: Consider re-enabling after reviewing array key usage
48+
"noArrayIndexKey": "off",
49+
// TODO: Re-enable after reviewing iterable callback returns
50+
"useIterableCallbackReturn": "off",
51+
// TODO: Re-enable after switching to Number.isNaN
52+
"noGlobalIsNan": "off",
53+
},
54+
"a11y": {
55+
// TODO: Re-enable after adding titles to SVGs
56+
"noSvgWithoutTitle": "off",
57+
// TODO: Re-enable after fixing anchor elements
58+
"useValidAnchor": "off",
59+
// TODO: Re-enable after adding keyboard handlers to interactive elements
60+
"noStaticElementInteractions": "off",
61+
},
62+
"style": {
63+
// TODO: Re-enable if using Node.js import protocol
64+
"useNodejsImportProtocol": "off",
65+
// TODO: Re-enable after reviewing non-null assertions
66+
"noNonNullAssertion": "off",
67+
// TODO: Re-enable after adding import type annotations
68+
"useImportType": "off",
69+
// TODO: Re-enable after reviewing const vs let usage in Svelte components
70+
"useConst": "off",
71+
},
72+
"performance": {
73+
// TODO: Re-enable after reviewing delete operations in tests
74+
"noDelete": "off",
75+
},
76+
"security": {
77+
// TODO: Re-enable after reviewing dangerouslySetInnerHTML usage
78+
"noDangerouslySetInnerHtml": "off",
79+
},
80+
"complexity": {
81+
// TODO: Re-enable after reviewing React fragments usage
82+
"noUselessFragments": "off",
83+
},
84+
},
85+
},
86+
"javascript": {
87+
"formatter": {
88+
"quoteStyle": "single",
89+
"jsxQuoteStyle": "double",
90+
"semicolons": "always",
91+
"trailingCommas": "all",
92+
},
93+
},
94+
"assist": {
95+
// TODO: Re-enable assist after initial migration
96+
"enabled": false,
97+
},
98+
"css": {
99+
"parser": {
100+
"cssModules": true,
101+
"tailwindDirectives": true,
102+
},
103+
"linter": {
104+
// TODO: Re-enable after initial migration
105+
"enabled": false,
106+
},
107+
},
108+
}

examples/nextjs-app/docs/.eslintrc.cjs

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/nextjs-app/docs/next.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import { withVercelToolbar } from '@vercel/toolbar/plugins/next';
44

55
const nextConfig: NextConfig = {
66
reactStrictMode: true,
7-
eslint: {
8-
ignoreDuringBuilds: true,
9-
},
107
typescript: {
118
ignoreBuildErrors: true,
129
},

examples/nextjs-app/docs/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
"private": true,
55
"scripts": {
66
"build": "MFE_DEBUG=1 next build",
7-
"dev": "next dev --turbo --port $(microfrontends port)",
8-
"lint": "next typegen && eslint .",
9-
"lint-fix": "eslint . --fix",
7+
"dev": "next dev --port $(microfrontends port)",
8+
"lint": "next typegen && biome lint",
109
"start": "next start",
1110
"typecheck": "next typegen && tsc --noEmit"
1211
},
@@ -21,7 +20,7 @@
2120
"clsx": "^2.1.1",
2221
"flags": "^3.2.0",
2322
"lucide-react": "0.542.0",
24-
"next": "15.5.7",
23+
"next": "16.0.10",
2524
"react": "19.0.0",
2625
"react-dom": "19.0.0",
2726
"tailwind-merge": "^2.6.0",
@@ -32,7 +31,6 @@
3231
"@types/react": "18.3.1",
3332
"@types/react-dom": "18.3.0",
3433
"autoprefixer": "^10.4.20",
35-
"eslint-config-custom": "workspace:*",
3634
"postcss": "^8.4.47",
3735
"tailwindcss": "^3.4.14",
3836
"ts-config": "workspace:*",

0 commit comments

Comments
 (0)