You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Align on Vite's intended scope to allow for framework-agnostic provider plugins #3
Given a framework that follows the (Vite-endorsed AFAICT) "framework-as-Vite-plugin" approach, it should be tractable for a provider’s framework-agnostic Vite plugin to build apps for deployment—without requiring end users to write additional code or configuration.
Given a framework that follows the classic approach (providing its own CLI and/or config and/or adapter mechanism; I refer to this as the "framework-as-toolchain" approach), it should be tractable for a provider’s framework adapter to delegate the app’s preparation for deployment to its framework-agnostic Vite plugin.
In scope for Vite: Features and functionality involved in the framework fulfilling requests; for example, SSR pages, middleware, RSC, framework-defined API endpoints, Server Functions.
Out of scope for Vite: Everything else; for example, static redirects, static response headers, image optimization, version skew protection, etc. These belong in some combination of framework configuration, provider configuration, and provider plugin/adapter configuration.
Before proceeding, it would be great to align on these statements.
3. In scope for Vite: Features and functionality involved in the framework fulfilling requests; for example, SSR pages, middleware, RSC, framework-defined API endpoints, Server Functions.
I guess we can focus only on the SSR pages and have a custom field in the first iteration. That should make it possible for us to start with a simple API and validate the idea with that. We'll need to have a custom field anyways and I think keeping it simple would also help us ensure that the custom field is flexible.
Can I suggest we focus in on the "server entry point location" and "server entry point signature" parts of the discussion today and try to reach alignment on those?
I'm not convinced allowing a given framework and a host plugin together through Vite brings much to the user. The big risk IMO is introducing some unecessary abstractions and hiding some useful logic from them.
Instead what I'd like to suggest is a community convention, based around Fetchables. For example, Tanstack Start and Vite Deploy work very well together out of the box. It gives a lot of power to the user if they need custom things because they have full control over the actual request handler and platform specific APIs.
Is it interoperable if ...extra: unknown[] is not?
It's a good question. I think yes, because a Fetchable can always be safely called with a Request, and if a module extends the Fetchable interface by supporting additional arguments, this would be done in a way that is specific to that module (plugin/platform/whatever) and would only be read by code that is explicitly aware that it's using that plugin/platform/whatever.
I could just omit ...extra: unknown[] from the documented type to avoid encouraging it? The language will allow it either way 😄.
For the record (we discussed this on the call), it seems all platforms have alternative mechanisms for accessing "platform context" and things like waitUntil without going through entry point args:
Personally, I find the whole pattern quite awkward, both for end users and for us all as maintainers. Requiring TypeScript module augmentation is not ideal DX, IMO.
I also sense that there's a move away from it in frameworks:
On the Wed May 6 2026 Vite Ecosystem call, we decided that the statements in the body of this issue do reflect the vision of the Vite team and the Vite ecosystem. As such, this issue will be closed.
Further discussion on solution specifics will proceed in #4 and I will open further issues for the (hopefully not very contentious) subtopics of "how do I find the path to a server entry point" and "how do I know it's a Fetchable?".
I can't get logging into Tangled to work, so while I would have created an issue to discuss, I'll just do it here. What does it mean to say something is interoperable? Like you said, even without ...extra: unknown[] there are various other ways this information is read like with cloudflare:workers. I that's the case, you can't just run any Fetchable in any environment; they are dependent on a specific runtime.
If that's the case, it's not really interoperable. The shape is the close to the same, and this benefits learning and understandability, but beyond that, is there any advantage?
Hmm, I don't see how the optional, untyped, additional arguments affect interoperability.
A framework plugin generates:
exportdefault{asyncfetch(req: Request): Promise<Response>{returnnewResponse(`Hello, ${req.headers.get("User-Agent")}!`)}// ... maybe even other properties here, doesn't matter}
^ This conforms to the Fetchable interface.
A platform plugin doesn't need to know which framework it came from, if any, yet it can import and invoke it:
/* ... */constreq=newRequest(/* ... get request from somewhere ... */)constentrypointPath='...'constentrypoint=awaitimport(entrypointPath)constres=awaitentrypoint.fetch(req,{/* ... maybe platform context ... */})/* ... do something with the response ... */
^ This imports and invokes a module conforming to the Fetchable interface.
Making the call signature open to extension just affords flexibility to callers to pass additional arguments without type errors. It means that many existing signatures (like Cloudflare Workers) are conformant already today. It means that a (say) manually written entry point file for a specific platform can accept additional arguments specific to that platform.
All this said, we could just omit this from the spec and not much would change in practice 🤷🏼♂️.
Activity
sapphi-red commentedon Apr 3, 2026
I guess we can focus only on the SSR pages and have a custom field in the first iteration. That should make it possible for us to start with a simple API and validate the idea with that. We'll need to have a custom field anyways and I think keeping it simple would also help us ensure that the custom field is flexible.
magne4000 commentedon Apr 3, 2026
For reference, this POC based on the RFC might be useful in shaping the API: https://github.com/universal-deploy/universal-deploy?tab=readme-ov-file#universal-deploy
jamesopstad commentedon Apr 7, 2026
Can I suggest we focus in on the "server entry point location" and "server entry point signature" parts of the discussion today and try to reach alignment on those?
magne4000 commentedon Apr 7, 2026
To help our discussion, here are links with excerpts to specifics discussions we had on those subjects.
Server entry point location
Previous discussions
Summary
Several options have been discussed across the RFC:
environment.config.entryPointconfig.build.rollupOptions.inputapikeyuniversal-deployuses a globaladdEntryServer entry point signature
Summary
I think the only proposed solution is the following:
Since so many actors have already chosen this signature, it feels like the natural choice.
sapphi-red commentedon Apr 20, 2026
We had two parts to figure out about this:
I thought about the former a bit. I think there're roughly two places:
builderbecause the information is useful for dev as wellResolvedConfig.metabuilder.metathis.meta.deploymentsmatthewp commentedon Apr 29, 2026
Is this thread about more than one subject? "metadata" is not part of what @serhalp is talking about here.
florian-lefebvre commentedon May 1, 2026
I've been experimenting with Vite adapters lately (https://vite-deploy.web-runes.dev/) and I have another opinion on this now.
I'm not convinced allowing a given framework and a host plugin together through Vite brings much to the user. The big risk IMO is introducing some unecessary abstractions and hiding some useful logic from them.
Instead what I'd like to suggest is a community convention, based around
Fetchables. For example, Tanstack Start and Vite Deploy work very well together out of the box. It gives a lot of power to the user if they need custom things because they have full control over the actual request handler and platform specific APIs.serhalp commentedon May 6, 2026
I put up a little mini spec page for Fetchable: https://fetchable.org/
matthewp commentedon May 9, 2026
Is it interoperable if
...extra: unknown[]is not?serhalp commentedon May 11, 2026
It's a good question. I think yes, because a Fetchable can always be safely called with a Request, and if a module extends the Fetchable interface by supporting additional arguments, this would be done in a way that is specific to that module (plugin/platform/whatever) and would only be read by code that is explicitly aware that it's using that plugin/platform/whatever.
I could just omit
...extra: unknown[]from the documented type to avoid encouraging it? The language will allow it either way 😄.For the record (we discussed this on the call), it seems all platforms have alternative mechanisms for accessing "platform context" and things like
waitUntilwithout going through entry point args:cloudflare:workersmodule: https://developers.cloudflare.com/changelog/post/2025-08-08-add-waituntil-cloudflare-workers/Netlifyglobal: https://docs.netlify.com/build/functions/api/#netlify-global-object@vercel/functions: https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package#waituntilwaituntilPersonally, I find the whole pattern quite awkward, both for end users and for us all as maintainers. Requiring TypeScript module augmentation is not ideal DX, IMO.
I also sense that there's a move away from it in frameworks:
createContext()hook: https://remix.run/blog/middleware#middleware-in-v7serhalp commentedon May 11, 2026
Decisions
On the Wed May 6 2026 Vite Ecosystem call, we decided that the statements in the body of this issue do reflect the vision of the Vite team and the Vite ecosystem. As such, this issue will be closed.
Further discussion on solution specifics will proceed in #4 and I will open further issues for the (hopefully not very contentious) subtopics of "how do I find the path to a server entry point" and "how do I know it's a Fetchable?".
matthewp commentedon May 13, 2026
I can't get logging into Tangled to work, so while I would have created an issue to discuss, I'll just do it here. What does it mean to say something is interoperable? Like you said, even without
...extra: unknown[]there are various other ways this information is read like withcloudflare:workers. I that's the case, you can't just run any Fetchable in any environment; they are dependent on a specific runtime.If that's the case, it's not really interoperable. The shape is the close to the same, and this benefits learning and understandability, but beyond that, is there any advantage?
serhalp commentedon May 16, 2026
Hmm, I don't see how the optional, untyped, additional arguments affect interoperability.
A framework plugin generates:
^ This conforms to the Fetchable interface.
A platform plugin doesn't need to know which framework it came from, if any, yet it can import and invoke it:
^ This imports and invokes a module conforming to the Fetchable interface.
Making the call signature open to extension just affords flexibility to callers to pass additional arguments without type errors. It means that many existing signatures (like Cloudflare Workers) are conformant already today. It means that a (say) manually written entry point file for a specific platform can accept additional arguments specific to that platform.
All this said, we could just omit this from the spec and not much would change in practice 🤷🏼♂️.