Skip to content

feat: React 19 / Next 16 support (INTER-2317)#203

Open
JuroUhlar wants to merge 4 commits into
inter-2316/dependency-refresh-dedupefrom
inter-2317/react-19-next-16-support
Open

feat: React 19 / Next 16 support (INTER-2317)#203
JuroUhlar wants to merge 4 commits into
inter-2316/dependency-refresh-dedupefrom
inter-2317/react-19-next-16-support

Conversation

@JuroUhlar

@JuroUhlar JuroUhlar commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Widen react peer range to >=18 <20; add CI job build-and-check-react-19 that overrides the pnpm catalog to React 19 for build/lint/test/test:dts (React 18 stays default).
  • Bump examples/next and examples/next-appDir to Next.js 16.2.10 (tsconfig moduleResolution/jsx updated by next build; target cleaned up to es2020).
  • Replace eslint-config-next with @next/eslint-plugin-next (the former bundles eslint-plugin-react, incompatible with this repo's ESLint 10), scoped to the two Next examples, with settings.next.rootDir set so its rules actually find pages/app instead of silently no-op'ing.
  • Re-add @eslint-react overrides (no-use-context, no-context-provider) for React 19-only idioms, scoped to src//__tests__/.
  • Update README requirements to "React 18 or 19"; drop stale "Next 14" reference in examples/next-appDir/README.md.
  • Changeset added (minor).

Manual verification

  • pnpm build/lint/test/test:dts green under both React 18 and React 19 (CI job's override run locally).
  • Manual browser check (real API key, visitor ID resolves, no SDK errors) on all 6 examples under React 18 and 19: next, next-appDir, vite, create-react-app, webpack-based, preact (doesn't use react at all, so version doesn't apply there).
    • Found and fixed along the way: bumping only an example's React version (not the root package) caused a "multiple React copies" crash in CRA/webpack-based,resolved by bumping root too, matching what the CI job's override already does.

Known gap: the CI React-19 job only bumps the root SDK package, not the examples, so example behavior under React 19 is verified manually here but not continuously in CI. Real CI coverage (build/typecheck per example) is a bigger change and will follow in a separate PR.

Widen the react peer range to >=18 <20, verify the SDK against React 19
via a second CI matrix job (catalog stays pinned to 18 as the default
dev/test toolchain), and bump the Next.js examples to 16.2.10.

Add @next/eslint-plugin-next lint rules scoped to the Next examples
instead of eslint-config-next, since the latter bundles
eslint-plugin-react which only supports ESLint below version 10.
Re-add the two @eslint-react rule overrides for React 19-only idioms
so linting stays green under both supported versions.
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 82.84% 111/134
🟡 Branches 67.57% 50/74
🟢 Functions 80.95% 34/42
🟢 Lines 82.31% 107/130

Test suite run success

22 tests passing in 15 suites.

Report generated by 🧪jest coverage report action from ffc711f

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 82.83 67.56 80.95 82.3
🟢  src 88.52 74.07 83.33 88.33
🟢   detect-env.ts 90 83.33 100 90 15,87
🟢   env.ts 100 100 100 100
🟢   env.types.ts 83.33 0 50 83.33 14
🟡   ...nt-context.ts 75 100 0 75 8
🟡   get-env.ts 60 0 100 60 8-9
🟢   ssr.ts 100 100 100 100
🟢   ...sitor-data.ts 95.65 100 80 95.65 102
🟢  src/components 91.66 58.33 91.66 91.17
🟢   ...-provider.tsx 90.32 54.54 90.9 89.65 47,52,85
🟢   ...vironment.tsx 100 100 100 100
🟡  src/utils 64.86 69.56 66.66 63.88
🟡   ...is-defined.ts 50 75 100 50 3
🟡   to-error.ts 66.66 50 100 66.66 6
🟢   ...mise-store.ts 91.3 92.3 100 90.9 20,26
🔴   wait-until.ts 0 0 0 0 8-19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK and example apps to support React 19 and Next.js 16, adds CI coverage for React 19, and adjusts linting/TypeScript settings to keep the repo green under the new toolchain constraints.

Changes:

  • Expand react peer dependency range to >=18 <20 and update README requirements accordingly.
  • Upgrade Next.js example apps to Next.js 16.2.10 and apply the TypeScript config changes Next recommends (moduleResolution: bundler, jsx: react-jsx, target: es2020).
  • Add a React 19 CI job and scope Next.js ESLint rules to the two Next examples via @next/eslint-plugin-next.

Reviewed changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Updates documented React requirement to “React 18 or 19”.
package.json Widens React peer range; adjusts lint to avoid ignored-file warnings; adds @next/eslint-plugin-next.
pnpm-lock.yaml Locks new Next.js 16 + lint plugin dependency graph.
eslint.config.mjs Adds Next.js example-only lint rules; ignores regenerated Next next-env.d.ts; reintroduces React 19-related rule overrides for src/ + tests.
examples/next/package.json Bumps Next.js to 16.2.10 in the pages-router example.
examples/next/tsconfig.json Aligns TS settings with Next 16 defaults and modernizes compilation target.
examples/next/next-env.d.ts Updates Next-generated TS env file (now references generated typed-routes file).
examples/next-appDir/package.json Bumps Next.js to 16.2.10 in the app-router example.
examples/next-appDir/tsconfig.json Aligns TS settings with Next 16 defaults and includes additional generated type paths.
examples/next-appDir/next-env.d.ts Updates Next-generated TS env file (now references generated typed-routes file).
.github/workflows/ci.yml Adds a second CI job that installs React 19 into the workspace for SDK checks.
.changeset/react-19-next-16-support.md Records a minor release for React 19 / Next 16 support.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/next/package.json
Comment thread examples/next-appDir/package.json
Next.js 16 requires Node >=20.9.0; declare it explicitly so
contributors on older Node get a clear engine error instead of a
confusing runtime failure.
no-html-link-for-pages (and other core-web-vitals rules) default to
looking for pages/app at the repo root, so they silently no-op since
both Next examples live under examples/. Set settings.next.rootDir to
point at them explicitly.
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Following releases will be created using changesets from this PR:

@fingerprint/react@3.1.0

Minor Changes

  • Add support for React 19 and Next.js 16. The react peer range now accepts >=18 <20. (b539205)

Patch Changes

  • Bump @fingerprint/agent dependency to ^4.1.2 (87b776f)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 13 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants