Skip to content

Turbopack support #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks
Mad-Kat opened this issue May 2, 2025 · 0 comments
Open
3 tasks

Turbopack support #336

Mad-Kat opened this issue May 2, 2025 · 0 comments
Labels
enhancement New feature or request priority topics that should be addressed in a timely manner

Comments

@Mad-Kat
Copy link
Contributor

Mad-Kat commented May 2, 2025

This issue tracks the ongoing work to add Turbopack support to next-yak.

Current Status

🚧 In Progress - Not yet supported in Turbopack

Implementation Requirements

SWC plugin transforms working properly with Turbopack*

Status: ✅ works, ✅ integrated

Unlike in webpack, SWC plugins in Turbopack didn't receive the full paths, which made our hashing of class names unstable. @kdy1 fixed it and it was integrated in next-yak here: #334

Tracked issues:
vercel/next.js#78156
vercel/next.js#78181

CSS (Modules) import support

Status: ✅ works, 🚧 not yet integrated

In order to be able to import the generated CSS as a virtual CSS-Module, we use an inline matchResource of webpack. This API doesn't exist in turbopack and Tobias pointed to a possible solution with data: URLs. This was recently implemented in turbopack and we've created a proof of concept where we transform it to data urls, which seems to work.

Still open is the full integration into next-yak and to find a good way to tell if we're transpiling for webpack or turbopack.

Tracked issues:
vercel/next.js#74825
vercel/next.js#78040
#315
vercel/next.js#78096

Cross-file CSS resolution through the dependency graph

Status: 🚧 figuring out a solution

To resolve cross-file CSS selectors & mixins, we currently use this.loadModule, which doesn't exist in turbopack (yet?)

Tracked issues:
vercel/next.js#78693

Build-time evaluation of yak files with constant replacement

Status: 🚧 figuring out a solution

In order to use build time values, we use this.importModule, which is currently not available on turbopack (yet?)

Testing & Validation

  • Create test suite for Turbopack integration
  • Verify hot reloading works correctly
  • Performance comparison between webpack and Turbopack implementations

Contributing

If you have experience with Turbopack or want to help with this implementation, please comment below with your ideas or proposed solutions.

Stay Updated

If you want to stay informed about our progress and Vercel's ongoing work to support Turbopack for next-yak, please subscribe to this issue. We'll post updates as development progresses.

@Mad-Kat Mad-Kat added enhancement New feature or request priority topics that should be addressed in a timely manner labels May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority topics that should be addressed in a timely manner
Development

No branches or pull requests

1 participant