Skip to content

Turbopack supportΒ #336

@Mad-Kat

Description

@Mad-Kat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestprioritytopics that should be addressed in a timely manner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions