mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #675] getInitialProps support #143
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#143
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gevgeny on GitHub (Mar 24, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/675
I know
getInitialPropsis a legacy API but many project still use it. Do you have plans to add support of it?@james-elicx commented on GitHub (Mar 24, 2026):
In short, yes. At the moment, though, there's quite a bit of Pages router functionality that doesn't work properly, which I know a lot of older apps will depend on, so it's a goal, but it might take a while to fully get there.
@southpolesteve commented on GitHub (Mar 25, 2026):
Genuinely curious about your use case here. getInitialProps is a pretty old API (effectively deprecated since 2020) and I'm pretty hesitant to take on the maintenance burden of supporting it. Before we commit to anything, would love to understand more:
If you have an app deeply built around the getInitialProps model and you don't want to migrate, it might be worth asking whether Next.js (or vinext) is actually the right tool. The getInitialProps style (one function, runs on both server and client) is closer in spirit to Remix than to where Next.js has gone with the App Router and RSCs. And if none of the modern React stuff (RSCs, server actions, etc.) is relevant to your app, you could probably vibe-code a narrow framework around that API in a day: Preact, a simple SSR handler, skip all the new complexity. You'd end up with something smaller and faster than Next.js ever was.
Happy to reconsider if there's a compelling case we're not seeing.
@gevgeny commented on GitHub (Mar 25, 2026):
My use case is SSRing styled-component generated styles. Basically this common trick used:
And get
getServerSidePropsis not available in theDocumentcomponent. I understand that this code is quite old, but getting rid ifgetInitialPropswould require migrating to the App router, if I understand it right.