devongovett / unplugin-parcel-macros

MIT License
204 stars 3 forks source link

Support Turbopack #3

Open oliviertassinari opened 2 months ago

oliviertassinari commented 2 months ago

Describe the feature

Support https://github.com/vercel/turbo.

Motivation

Next.js might be migrating away from webpack. I'm creating this issue as a placeholder to have one place to talk about this. Turbopack is in beta, so it might be best to wait to see how this evolves to start looking at a solution.

devongovett commented 2 months ago

Do you know if Turbopack supports plugins? I thought I read something about running webpack plugins in it, but I couldn't find any docs. (Edit: found these docs - but looks like this plugin would need more features than they expose currently.) Otherwise, for this implementation to work we'd need to add Turbopack support upstream to unplugin.

Ideally since Turbopack is written in Rust it could integrate support for macros directly rather than needing this plugin. Parcel's macro implementation is extracted as a separate Rust crate that is built on top of SWC, and has no dependencies on any other Parcel stuff, so it should be pretty easy to integrate. In fact, this unplugin uses that crate as well. This would require convincing the Turbopack team to add support though.

cc. @padmaia @wbinnssmith from the Turbopack team who may know more.

oliviertassinari commented 2 months ago

Ok, so cross linking to https://github.com/unjs/unplugin/issues/302