chore!: next.js 16 prep: pin 'next' peer dep to ^16 (#933)#942
Open
frano-m wants to merge 5 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the library’s Next.js version expectations as part of the Next.js 16 upgrade plan, ensuring local development and CI resolve and run against Next 16.
Changes:
- Added
next@^16todevDependenciesso CI/local installs use Next 16. - Updated
peerDependencies.nextfrom^15.5.13to^16. - Refreshed
package-lock.jsonto reflect the new resolved Next 16 dependency graph.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| package.json | Adds Next 16 as a dev dependency and updates the published peer dependency range for next. |
| package-lock.json | Updates lockfile to the resolved Next 16.2.6 tree and related metadata changes. |
next-mdx-remote v5 has a known arbitrary-code-execution advisory (GHSA-g4xw-jxrg-5f6m). v6 is the patched major; subpath export (/serialize) and MDXRemoteSerializeResult type are unchanged, so the two findable-ui import sites work without source edits. Also picks up safe transitive fixes via npm audit fix: handlebars, fast-uri, picomatch, vite, ws, yaml, @tootallnate/once, and most brace-expansion sites. Reduces audit count from 15 vulns (1 critical / 4 high / 9 moderate / 1 low) to 7 moderate, all of which are transitive of next / next-auth / glob and need upstream upgrades to resolve. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
…els (#933) next 16 auto-rewrites consumer tsconfig.moduleResolution to "bundler", which requires explicit `.d.ts` / `.js` substitution in the package exports map and cannot resolve folder/index patterns via wildcards. this commit reworks the exports map and removes the trivial barrel files that prevented a clean wildcard-only setup. BREAKING CHANGE: consumers must update imports: - ErrorBoundary: import from @databiosphere/findable-ui/lib/components/ErrorBoundary/errorBoundary - TempError: import from @databiosphere/findable-ui/lib/components/TempError/tempError - theme/components: import each override from its file (e.g. .../lib/theme/components/muiAlert) — the barrel has been removed - Index: file renamed from index.tsx to indexView.tsx; import from @databiosphere/findable-ui/lib/components/Index/indexView (and its styles from indexView.styles) the exports map now uses conditional types/default wildcards and adds a .js-suffix wildcard for runtimes that require explicit extensions (node esm, playwright). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
next-mdx-remote@6 flipped blockJS default from false to true, which
strips javascript expressions during compilation — including jsx
attribute expressions like <Breadcrumbs breadcrumbs={[...]} />.
the resulting compiled output passes empty props to components,
silently breaking any mdx that uses prop-expression attributes.
set blockJS: false as the default in buildStaticProps so consumers
using this helper get correct behavior out of the box. consumers
calling serialize() directly should pass blockJS: false themselves
(documented in the readme). the narrower blockDangerousJS: true
default is preserved as the safety net against eval / new Function /
setTimeout(string) patterns.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
document the wiring consumers must add when upgrading to next.js 16: - @mui/material-nextjs AppCacheProvider in _app.tsx - documentGetInitialProps + DocumentHeadTags in _document.tsx - @emotion/server peer install - next-mdx-remote@6 blockJS: false note - turbopack opt-out (next dev/build --webpack) until vercel/next.js#82607 is fixed includes a terminology note for static-export deployments: the mui helpers reference "ssr" / "document" but the work runs at next build time, not at request time. no runtime server is involved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #884 (Next.js 16 upgrade plan). This PR lands the findable-ui-side work needed for consumers to upgrade to Next 16 cleanly.
Peer-dep + audit
next: ^15.5.13→^16next-mdx-remote: ^5.0.0→^6.0.0(fixes GHSA-g4xw-jxrg-5f6m)next: ^16, bumpnext-mdx-remote: ^6.0.0npm audit fix— picks up safe transitive fixes forhandlebars(critical),fast-uri,picomatch,vite(high),ws,yaml,@tootallnate/once, and mostbrace-expansionsitesSubpath resolution + barrel cleanup
Next 16 auto-rewrites consumer
tsconfig.moduleResolutionto"bundler", which requires explicit.d.ts/.jssubstitution inexportsand cannot resolve folder/index.{js,d.ts}patterns via wildcards. Reworked the exports map and removed the trivial barrels that prevented a clean wildcard setup:src/components/ErrorBoundary/index.ts(one-line re-export)src/components/TempError/index.ts(one-line re-export)src/theme/components/index.ts(aggregator of 4 MUI overrides)src/components/Index/index.tsx→indexView.tsx(and.styles.ts)types/defaultwildcards with a.js-suffix wildcard for runtimes that require explicit extensions (Node ESM, Playwright)next-mdx-remote@6blockJSdefaultv6 flipped
blockJSfromfalsetotrue, which strips JSX attribute expressions (<Breadcrumbs breadcrumbs={[...]} />) during MDX compilation.findable-ui/src/utils/mdx/staticGeneration/staticProps.tsnow defaults toblockJS: false; consumers callingserialize()directly should do the same.Consumer setup docs (
README.md)New section covering:
@mui/material-nextjs+@emotion/serverinstall,_app.tsx+_document.tsxwiring, thenext-mdx-remote@6blockJS: falsenote, and the Turbopack opt-out workaround for vercel/next.js#82607.Includes a terminology note: the MUI helpers are named with "SSR" / "document" terminology, but for static-export deployments everything runs at
next buildtime. No runtime server is involved.Breaking changes
Consumers must update:
ErrorBoundary— import from…/lib/components/ErrorBoundary/errorBoundaryTempError— import from…/lib/components/TempError/tempErrorIndex— import from…/lib/components/Index/indexView(andindexView.styles)theme/components— import each override individually (…/lib/theme/components/muiAlert, etc.); barrel removednext: ^16andnext-mdx-remote: ^6The repo-by-repo consumer migration is tracked separately (see #935).
Verified
npm test— 447/447npm run lint,check-format,test-compile— cleannpm audit— 15 → 7 transitive-onlytsc --noEmitclean; dev server runs under--webpack;/ga-announcementBreadcrumbs render; Footer hydration mismatch resolvedtsc --noEmitclean (no findable-ui-related errors); pre-existing unrelated TS errors remainOut of scope (follow-ups under #884)
uuidtransitive advisory)Closes #933