Migrate development environment to Turbopack#2385
Conversation
🦋 Changeset detectedLatest commit: 6b3c34a The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@vinzee is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
Deep Review✅ No critical issues found. The diff is a tight, well-documented bundler swap: dev moves to Turbopack, prod stays on Webpack, one SCSS file gets a Turbopack-compatible rewrite, and 🟡 P2 -- recommended
🔵 P3 nitpicks (4)
Reviewers (4): correctness, testing, maintainability, project-standards. Testing gaps:
|
771f393 to
c753a26
Compare
| // This must stay external under both Webpack and Turbopack; otherwise the | ||
| // Turbopack dev server would attempt to bundle the entire `@hyperdx/api` | ||
| // dependency tree (slow startup / module-resolution errors). | ||
| ...(process.env.HDX_PREVIEW_INLINE_API !== 'true' ? ['@hyperdx/api'] : []), |
c753a26 to
17762e4
Compare
Greptile SummaryThis PR migrates the local development server from Webpack to Turbopack (
Confidence Score: 5/5Safe to merge — the bundler split is clearly documented, CSS module changes are functionally equivalent, and the @hyperdx/api externalization is covered by multiple overlapping mechanisms. All changes are well-scoped: dev scripts switch to Turbopack while production builds remain on Webpack, the CSS refactor preserves compiled specificity, and the dynamic import magic comments ensure neither bundler ever bundles the inline API module at analysis time. No runtime behaviour changes in production code paths. packages/app/next.config.mjs — the webpack externals callback lacks a comment explaining its role alongside serverExternalPackages, which could confuse future readers. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Dev as Developer
participant Next as Next.js Dev Server
participant TB as Turbopack (dev)
participant WP as Webpack (build)
participant API as API Handler [...all].ts
Dev->>Next: next dev --turbopack
Next->>TB: Bundle app (CSS Modules, TS, SCSS)
TB-->>Next: Fast HMR, :global(.selector) CSS supported
Dev->>Next: next build --webpack
Next->>WP: Production bundle
WP-->>Next: "serverExternalPackages + externals cb exclude @hyperdx/api"
Note over API: At runtime (HDX_PREVIEW_INLINE_API=true)
API->>API: await import(turbopackIgnore + webpackIgnore)
API-->>API: inlineApi.default ?? inlineApi → handler(req, res)
Note over API: At runtime (HDX_PREVIEW_INLINE_API=false)
API->>API: createProxyMiddleware → proxy to external API service
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Dev as Developer
participant Next as Next.js Dev Server
participant TB as Turbopack (dev)
participant WP as Webpack (build)
participant API as API Handler [...all].ts
Dev->>Next: next dev --turbopack
Next->>TB: Bundle app (CSS Modules, TS, SCSS)
TB-->>Next: Fast HMR, :global(.selector) CSS supported
Dev->>Next: next build --webpack
Next->>WP: Production bundle
WP-->>Next: "serverExternalPackages + externals cb exclude @hyperdx/api"
Note over API: At runtime (HDX_PREVIEW_INLINE_API=true)
API->>API: await import(turbopackIgnore + webpackIgnore)
API-->>API: inlineApi.default ?? inlineApi → handler(req, res)
Note over API: At runtime (HDX_PREVIEW_INLINE_API=false)
API->>API: createProxyMiddleware → proxy to external API service
Reviews (2): Last reviewed commit: "Migrate development environment to Turbo..." | Re-trigger Greptile |
Transition the local development server from Webpack to Turbopack to significantly improve build performance and hot-reloading speed. Also update global style declarations to ensure compatibility with the new bundler's CSS compilation requirements.
17762e4 to
6b3c34a
Compare

Summary
Transition the local development server from Webpack to Turbopack to significantly improve build performance and hot-reloading speed.
Also update global style declarations to ensure compatibility with the new bundler's CSS compilation requirements.
Screenshots or video
N/A — non-UI change
How to test on Vercel preview
N/A — non-UI change
References