Skip to content

improvement(next): bundle and CI cache config#4478

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/turbopack-prod-build
May 6, 2026
Merged

improvement(next): bundle and CI cache config#4478
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/turbopack-prod-build

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • drop redundant turbopack config (Next 16 makes them defaults)
  • remove lucide-react/date-fns from optimizePackageImports (Next 16 built-in defaults)
  • enable experimental.turbopackFileSystemCacheForBuild for warm CI builds
  • disable poweredByHeader
  • swap actions/cache for Blacksmith sticky disk on .next/cache (~3s mount, survives lockfile changes)

Type of Change

  • Improvement

Testing

Tested manually — built locally with Turbopack, ran experimental bundle analyzer to confirm lucide-react/date-fns are tree-shaken by default in Next 16.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

- drop redundant turbopack config (Next 16 defaults)
- remove lucide-react/date-fns from optimizePackageImports (built-in defaults)
- enable turbopackFileSystemCacheForBuild for warm CI builds
- disable poweredByHeader
- swap actions/cache for Blacksmith sticky disk on .next/cache
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 6, 2026 7:17pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 6, 2026

PR Summary

Medium Risk
Moderate risk because it changes Next.js build configuration and enables an experimental Turbopack build cache, which could impact build correctness/perf across environments.

Overview
Improves build performance and hardens headers by disabling Next’s X-Powered-By header and enabling experimental.turbopackFileSystemCacheForBuild.

Simplifies apps/sim/next.config.ts by removing now-default Turbopack/optimizePackageImports entries (e.g., drops explicit turbopack.resolveExtensions and removes lucide-react/date-fns).

Updates CI (test-build.yml) to use Blacksmith Sticky Disk for the Next.js .next/cache directory instead of actions/cache, keeping cache warm across lockfile changes.

Reviewed by Cursor Bugbot for commit ddb87ae. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR cleans up now-redundant Next.js 16 Turbopack defaults (resolveExtensions, turbopackSourceMaps, turbopackFileSystemCacheForDev), adds poweredByHeader: false, and enables turbopackFileSystemCacheForBuild for warm CI builds. The GitHub Actions workflow drops the lockfile-keyed actions/cache step for .next/cache in favour of a Blacksmith sticky-disk mount, consistent with the three other stickydisk mounts already in the workflow.

  • next.config.ts: Removes stale Turbopack overrides, enables filesystem cache for builds (experimental), strips lucide-react and date-fns from optimizePackageImports since Next 16 tree-shakes these by default, and adds the minor security header poweredByHeader: false.
  • test-build.yml: Replaces the lockfile-hash-keyed actions/cache entry for .next/cache with a fixed-key stickydisk mount, matching the pattern used for bun, node_modules, and turbo caches in the same job.

Confidence Score: 5/5

Safe to merge — changes are additive config cleanups with no logic changes, and the new stickydisk cache follows the same pattern already used by three other mounts in this job.

Both files make targeted, well-justified changes: removing Turbopack config options that are now defaults in Next 16, enabling an experimental build cache flag that pairs correctly with the new CI stickydisk mount, and adding a minor security header. The stickydisk key pattern for .next/cache is consistent with the bun, node_modules, and turbo caches already in the workflow. The turbopackFileSystemCacheForBuild flag is experimental but its worst-case failure mode is a stale incremental cache, which Next.js handles gracefully by falling back to a full rebuild.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/test-build.yml Swaps actions/cache@v5 for useblacksmith/stickydisk@v1 on the Next.js build cache path, using a fixed repository-scoped key consistent with the other three stickydisk mounts already in this workflow.
apps/sim/next.config.ts Removes Turbopack config that became defaults in Next 16, adds poweredByHeader: false, enables turbopackFileSystemCacheForBuild, and drops lucide-react/date-fns from optimizePackageImports.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CI Job Starts] --> B[Mount Bun Cache\nSticky Disk]
    B --> C[Mount node_modules\nSticky Disk]
    C --> D[Mount Turbo Cache\nSticky Disk]
    D --> E[Mount .next/cache\nSticky Disk NEW]
    E --> F[bun install]
    F --> G[Lint / Type-check / Tests]
    G --> H[turbo run build --filter=sim]
    H --> I{turbopackFileSystemCacheForBuild?}
    I -- true NEW --> J[Write incremental build artifacts\nto .next/cache on Sticky Disk]
    I -- false OLD --> K[Discard .next/cache]
    J --> L[Subsequent CI run reuses warm cache]
    K --> M[Cold build every run]
Loading

Reviews (1): Last reviewed commit: "improvement(next): bundle and CI cache c..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit bfd0f46 into staging May 6, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/turbopack-prod-build branch May 6, 2026 19:31
waleedlatif1 added a commit that referenced this pull request May 7, 2026
- drop redundant turbopack config (Next 16 defaults)
- remove lucide-react/date-fns from optimizePackageImports (built-in defaults)
- enable turbopackFileSystemCacheForBuild for warm CI builds
- disable poweredByHeader
- swap actions/cache for Blacksmith sticky disk on .next/cache
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.

1 participant