refactor: adopt Turbopack as default bundler#17906
Conversation
ed78066 to
d61e4e6
Compare
4ea54fc to
a5c552f
Compare
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Run npx storybook@9 upgrade with automigrations: - upgrade-storybook-related-dependencies - initial-globals (globals → initialGlobals) - consolidated-imports (@storybook/* → storybook/*) - remove-addon-interactions (moved to core) - renderer-to-framework (@storybook/react → @storybook/nextjs) - remove-essential-addons (replaced with @storybook/addon-docs) - remove-docs-autodocs (deprecated config removed)
Run npx storybook@latest upgrade with automigrations: - addon-globals-api (viewport/backgrounds configuration) - nextjs-to-nextjs-vite (reverted - staying on webpack per plan) Reverted the automatic nextjs-vite migration: replaced @storybook/nextjs-vite with @storybook/nextjs across all files to keep the webpack-based framework as intended.
- Remove @next/bundle-analyzer and withBundleAnalyzer wrapper - Swap scripts: dev/build now use Turbopack (default in Next.js 16), dev:webpack/build:webpack available as fallbacks - Replace .all-contributorsrc symlink with JSON copy for Turbopack module resolution compatibility - Add turbopackIgnore comment for dynamic path.join in rehypeImg.ts - Both `pnpm build` (Turbopack) and `pnpm build:webpack` pass
turbopackIgnore is a magic comment that only works inside dynamic import() or require() expressions. Placing it inside path.join(), readFile(), or existsSync() calls has no effect on Turbopack's module tracing.
Dynamic import() with variable paths caused Turbopack to trace 143k+ markdown files across all locales. fs.readFile() is invisible to Turbopack's module graph analysis, matching the pattern already used in import.ts.
a5c552f to
5f1aae5
Compare
…ption # Conflicts: # pnpm-lock.yaml
- Narrow second turbopack.ignoreIssue rule to **/src/lib/** (was **) so it doesn't mute legitimate NFT warnings elsewhere. - Sentry debug: opt-in via SENTRY_DEBUG=true instead of hardcoded false (still off by default because OTel instrumentation is too noisy in dev). - Extract ContributorsView (pure render) + restore Contributors stories for Chromatic coverage. index.tsx stays server-only. - Document the plain <img> trade-off and the target="_blank" parity with the original InlineLink wrapper.
Auto-merge from prior dev merge had prettier-plugin-tailwindcss re-sort utility classes in files the branch didn't intend to modify.
…ption # Conflicts: # src/components/Contributors/index.tsx
myelinated-wackerow
left a comment
There was a problem hiding this comment.
LGTM. Few nice-to-haves:
TRANSLATIONS_DIRinsrc/lib/constants.tslooks orphaned now thattranslationRegistry.tsinlines the literal — please double-check and remove if confirmed unused- Nit on
ContributorsView:className="h-[132px] w-[132px]"could just besize-[132px], and thewidth={132} height={132}attrs were only required fornext/image— the plain<img>doesn't need them unless I'm missing a CLS reason
# Conflicts: # pnpm-lock.yaml
- Remove orphaned TRANSLATIONS_DIR export from src/lib/constants.ts (translationRegistry now inlines the literal; no remaining importers) - ContributorCard <img>: use size-[132px] shorthand and drop width/height attrs that were holdovers from next/image
|
@myelinated-wackerow thanks for the review!
Confirmed orphaned (no imports anywhere in
You weren't missing anything — it's a plain Both addressed in 00ed4ad. |

Summary
Adopts Turbopack as the default bundler.
--webpackbecomes the opt-out (dev:webpack/build:webpackkept as fallback). Along the way, fixes several patterns that didn't survive Turbopack's stricter module graph and file tracer.What's in this PR
Default bundler flip
dev/buildscripts drop--webpack.@next/bundle-analyzerremoved (webpack-only).Contributorsdrops!!raw-loader!inline syntax.treeshake.removeDebugLogging; silenced dev-time debug logging.Turbopack-specific fixes
await import('.../${locale}/${slug}/index.md')withfs.readFile(). Turbopack statically registers every template match (~143k candidate modules), which frozepnpm dev.join(CONTENT_DIR, ...slug)traces ~4× wider thanjoin("public/content", ...slug). Inlined at hot sites; residual warnings silenced viaturbopack.ignoreIssue. Seedocs/solutions/build-errors/turbopack-file-tracer-doesnt-fold-cross-module-string-constants.mdso this isn't reverted later.Contributors + Staking refactor
Contributorsis now a server-only component that reads.all-contributorsrcdirectly, strips unused fields, and shuffles once per SSG build. Deletes theall-contributors.jsonduplicate (it was already drifting from the bot-maintained source)./stakingconverted from a client component to a server component (getTranslationsinstead ofuseTranslation).StakingHierarchyexplicitly marked"use client".Behavior changes
.all-contributorsrc(bot-maintained) is the single source of truth. No possibility of drift.Test plan
pnpm devstarts with Turbopackpnpm buildsucceeds with Turbopackpnpm build:webpackstill works as fallbackpnpm build-storybooksucceedsKnown gaps / follow-ups (not in this PR)
public/content/**mixes static assets and source markdown, which forces the file tracer to consider ~200k files in scope. Movingcontent/out ofpublic/(or migrating to a proper content layer like Contentlayer/Velite) would eliminate most of the Turbopack band-aids in this PR. Bigger effort; worth scoping separately.turbopack.ignoreIssueconfig. Cosmetic suppression of "Overly broad patterns" warnings thatoutputFileTracingExcludesalready prevents from over-bundling. Would go away with the content-pipeline migration above.