-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Expose as middleware #23
Comments
FYI vite-plugin-ssr's V1 design has been released last week. Depending on what the goal of Wakuwork is, implementing Wakuwork as a Vike extension could make sense. |
It might make sense with simple Wakuwork usage, but with router, it may conflict with Vike's router. I'll keep this in mind and will see how it fits. |
I don't completely give up that road. Especially because I'm having a hard time around supporting styles, it may make sense to off load the task. I wonder if Vike supports customizing/replacing the router. |
What's your rationale for replacing Vike's router? I understand that routing is often something people want to customize but I'm thinking that, once Vike provides a really good router, then people won't want to customize it anymore. Thus my question: what's your motivation for replacing the router? To be clear, I'm not against making the router replaceable and there is actuallly already a hook for that: https://vite-plugin-ssr.com/onBeforeRoute. I'd just like us to go down that path only after we talk this through. |
Waku's core doesn't comes with a router. It can be used without routers. On top of it, we could implement a router or different routers.
That's interesting. There seems to be a hope. |
I don't know where you come from, so it's difficult for me to understand what you want. Why did you create Waku in the first place? From the perspective of the user, what makes Waku different than Next.js? I was assuming that Waku's goal is to have a deep integration of sate mangement into the framework, which is something that Vike (tentatively) enables. |
Well, my motivation of developing this is to build a minimal setup for React Server Components. |
IMO the following separation of concerns is best:
Honestly, anything else seems like building a frankenstein to me (the exception being to vertically integrate everything like Next.js does but that's not particularly collaborative). I'm happy to be shown wrong though 😉. Also, if possible, a Vite RSC plugin that can work with Waku/Vike/Rakkas would be quite neat, which nksaraf was(/is?) working on. |
I'd admit the SoC of Waku isn't very sophisticated at the moment. But, RSC is still young anyway and it may not fit with existing concepts. I will try my road in the meantime, but I feel like eventually the scope of Waku might need to be narrowed down and it would look for integrating with other frameworks or something else.
Yes, that would be neat, because I'm not yet very familiar with Vite and it's not at the center of my interest. |
Thanks for your insights! They are helpful. |
Sounds good.
Yes some adaption will most likely be needed on Vike's side (maybe on Vite's side as well). I'll have more time to dig into this once I release Vike V1.
👍 If we can collaborate that'd be great. Let's not recreate another Next.js that is equally monopolistic. |
Would like to throw my hat in the ring here with a new abstraction layer I created on top of vite and nitro. It's kind of parallel to vike intending to solve similar problems but using nitro as the server and adapter layer, vite's dev server and a router abstraction to bring things together It's kind of a build your own framework layer no routing opinions but you tell it your routes and it know what to do with the css . In many ways it's all runtime configured. https://github.com/nksaraf/vinxi . I built two RSC examples. One uses SSR one doesn't. It uses react-server-dom-vite plugin. Examples: Also have a bunch of SSR examples with wouter, tanstack router, react-router, etc: https://github.com/nksaraf/vinxi/tree/main/examples/react/ssr Its bring your own router and routing config.. we just give you a way to hook into the bundler to get the CSS and manifest for your route files. I have to document things better but have really enjoyed developing against it. It allows me to build a SolidStart clone and NextJS clone all in user land. |
Super nice. Hmm, I feel like I might eventually need to reconsider my router abstraction. I'm sure it's not the best, and building on top of something might be better. |
This may work indeed.
Although, while that's great, I'm asking myself whether supporting all these will restrict Vinxi too much. I guess we'll see. Anyways, neat project. Very much looking forward to seeing how Vinxi will unfold. |
Vinxi is essentially a bundler and server runtime integration . Routers and client side apps are part of the puzzle. The idea is not have any inbuilt conventions for routing.. just a runtime to support the appropriate techniques. We already have version of nextjs app router and solid starts router in the same examples dir |
I think the router runtime is a beast of its own and staying out of that zone has been very nice for the abstraction. It gives the router bundler powers and lets it do its job |
Not sure if you are aware of, but Waku is taking the same approach. And, that would be a major blocker if I were to build it on Vike. |
Currently, it has its own server based on nodejs.
It would be more flexible to expose the functionality as connect/express middleware, so that it can be used in an existing express server.
Learn from https://github.com/brillout/vite-plugin-ssr by @brillout.
The text was updated successfully, but these errors were encountered: