Skip to content

build: activate Turbopack for dev and build#424

Merged
ignmandagaran merged 3 commits into
ignmandagaran/adopt-cache-componentsfrom
ignmandagaran/activate-turbopack
Jul 20, 2026
Merged

build: activate Turbopack for dev and build#424
ignmandagaran merged 3 commits into
ignmandagaran/adopt-cache-componentsfrom
ignmandagaran/activate-turbopack

Conversation

@ignmandagaran

Copy link
Copy Markdown
Member

Summary

Switches dev/build from webpack to Turbopack (the Next.js 16 default), stacked on top of #422. Removes the two blockers noted in AGENTS.md, and fixes an unrelated styling regression discovered along the way.

Changes

  • refactor(shaders): flatten glslify pragmas so raw-loader alone loads GLSL — 5 of 24 .glsl files used #pragma glslify: require/export (not supported by Turbopack's loader). Flattened with the glslify CLI (correctly dedups the shared ashima noise helpers) and deleted the now-inlined utils/value-remap.glsl + utils/basic-light.glsl.
  • build: switch dev and build to Turbopack — drop --webpack, simplify turbopack.rules to raw-loader only, remove the dead webpack() config function, drop glslify-loader/glsl-noise/glsl-constants, add postcss-import as an explicit dependency.
  • fix(deps): bump postcss off ancient 8.0.0 to restore Tailwind under Turbopack — the lockfile had postcss pinned at 8.0.0 (2020). Turbopack's PostCSS transform silently no-oped plugins driven by that version, so @tailwind/@apply/theme() shipped raw and unstyled in both dev and prod. Bumped to 8.5.10. This — not a Tailwind v3/Turbopack incompatibility — is almost certainly what caused the original webpack revert.

Verification

All three commits verified in a throwaway git worktree before being applied to the real tree:

  • next build green under Turbopack, Cache Components enabled, route-table parity (no dynamic regressions).
  • Runtime check in a real browser (dev + production server): WebGL scenes render with zero shader-compile errors (home, /lab arcade), and every CSS chunk fully expands (zero raw @tailwind/@apply, full preflight/utilities/theme colors) with no visual regressions.

Checklist

  • pnpm lint passes
  • Tested locally in dev mode
  • No breaking changes

…GLSL

Turbopack officially supports raw-loader but not glslify-loader. The 5
shaders using #pragma glslify: require/export are flattened with the
glslify CLI (which resolves + dedups the ashima noise helpers), so plain
raw-loader can load every .glsl file. The now-inlined utils/value-remap
and utils/basic-light are deleted.
Drop the --webpack flag from dev/build (Turbopack is the Next 16
default), simplify turbopack.rules to raw-loader only, and remove the
now-dead webpack() loader function. Remove glslify-loader/glsl-noise/
glsl-constants; add postcss-import as an explicit dep so Turbopack's
resolver doesn't rely on a transitive hoist. Tailwind v3 PostCSS chain
verified working under Turbopack. AGENTS.md updated to match.
…urbopack

The lockfile had postcss pinned at 8.0.0 (the first 8.x release, 2020).
Turbopack's PostCSS transform silently no-ops plugins driven by that
version — Tailwind's @tailwind/@apply/theme() directives passed through
raw in both dev and production, with no error. Bumping to postcss@8.5.10
fixes it: verified in a worktree and the real tree, dev and build, that
every CSS chunk now has zero raw directives and full expanded output
(preflight, utilities, theme colors), confirmed visually in the browser.
No Tailwind v3->v4 migration was needed — this was never a Turbopack/
Tailwind-v3 incompatibility.
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
website-2k25 Ready Ready Preview, Comment Jul 20, 2026 5:09pm

@ignmandagaran
ignmandagaran marked this pull request as draft July 20, 2026 17:09
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR activates Turbopack as the bundler for both dev and build by removing the --webpack flags and cleaning up the now-redundant webpack config. It resolves two blockers: GLSL shaders are flattened from glslify #pragma imports into self-contained files (so raw-loader alone suffices), and postcss is bumped from 8.0.0 to 8.5.10 to fix a silent failure that caused Tailwind's @tailwind/@apply/theme() directives to ship raw under Turbopack.

  • GLSL flattening — 3 shaders (material-flow/fragment.glsl, material-global-shader/fragment.glsl, material-solid-reveal/fragment.glsl) have their #pragma glslify requires replaced with inlined Ashima noise helpers and utility functions; the now-empty utils/basic-light.glsl and utils/value-remap.glsl are deleted.
  • Dependency cleanupglsl-noise, glslify-loader, and glsl-constants are removed; postcss-import@^16.1.1 is added as an explicit devDep so postcss.config.mjs's postcss-import → tailwindcss/nesting → tailwindcss pipeline resolves reliably under Turbopack.
  • Build scriptspackage.json scripts drop --webpack; next.config.ts removes the webpack() override and keeps only raw-loader in turbopack.rules.

Confidence Score: 5/5

Safe to merge — the change is a well-scoped bundler switch with verified shader flattening and a genuine CSS pipeline fix.

All three commits address concrete, verifiable issues: the glslify pragmas are correctly inlined (the helper functions match the original Ashima sources), the Turbopack GLSL rule simplification is consistent with the shader changes, and the postcss 8.0.0 → 8.5.10 bump unblocks the Tailwind pipeline. No logic regressions, no removed functionality, and AGENTS.md is updated to reflect the new constraint that shaders must remain pragma-free.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(deps): bump postcss off ancient 8.0...." | Re-trigger Greptile

@ignmandagaran
ignmandagaran merged commit 6113dbb into ignmandagaran/adopt-cache-components Jul 20, 2026
3 checks passed
@ignmandagaran
ignmandagaran deleted the ignmandagaran/activate-turbopack branch July 20, 2026 17:43
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