-
Notifications
You must be signed in to change notification settings - Fork 15
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
Next 15 compatibility and temporary option to force page router #112
base: canary
Are you sure you want to change the base?
Conversation
Any updates on this? |
It seems like a breaking change from upstream. If that change is intended, we may need to drop router detection feature and should provide an option for the users to select the router type in own hands. |
I use both routers in production in several apps, and just want to add that I'd be perfectly happy with manually choosing which router I want this plugin to apply to 👍🏼 |
I forked and published this plugin with compatibility for Next.js@15, since this plugins to no longer be maintained. https://github.com/serg-and/superjson-next |
We were digging into this topic a bit deeper and noticed that for react server components (i.e. app router only) there is a much simpler solution without the need for a SWC plugin. We've published our results as a new open source project called rsc-superjson. The library provides a simple react hoc that achieves the same result as this SWC plugin but in a more explicit way—without requiring an SWC plugin. As a bonus, switching from the SWC plugin to rsc-superjson reduced our build times by approximately 3.5%. Additionally rsc-superjson also brings support for the return values of server actions |
Ah, we're still on the pages router so won't be useful for us. But seems like a nice solution. |
@orionmiz @siddhsuresh it would be better for the Next / Blitz community if this wasn't necessary, but I understand why it happened RE: how much time has passed 😓 |
Enough time for an upstream fix has passed, but the issue still exists. And creating a bundler plugin(webpack, turbopack) also can be considered for the future due to the lack of context provided to compiler plugins. (related issue #90) |
Bump
swc_core
to0.106.*
to be in line withnext@15.0.1
.next changed the filename metadate making this plugin unable to detect app or page router vercel/next.js#72019.
Added a temporary option to force page router, this will make the plugin incompatible with projects using both routers.