owl icon indicating copy to clipboard operation
owl copied to clipboard

Meta framework like Next.js, Nuxt, SvelteKit, ...

Open brillout opened this issue 1 year ago • 11 comments

Is a meta framework like Next.js or SvelteKit on the roadmap?

I'm the author of vite-plugin-ssr which enables UI frameworks, such as Owl, to provide a full-fledged meta framework.

(Super thrilled to see the rise of a vibrant and diverse ecosystem of UI frameworks.)

brillout avatar Apr 12 '23 14:04 brillout

I'm honestly not sure I understand the question fully, but the answer is most likely no. To us, Owl is mostly meant to be used in the Odoo ecosystem, that is, with Odoo as the server-side framework. We try to be careful to allow Owl to be usable even without it, but any substantial development effort from our part is generally motivated by making Owl better within the Odoo ecosystem. Developping a server-side framework on top of Owl doesn't really align with that goal.

sdegueldre avatar Apr 13 '23 08:04 sdegueldre

Makes sense.

That's actually precisely what vite-plugin-ssr enables you to do: you can build a full-fledged server-side framwork with only a bit of integration code.

(FYI the community is starting to call "meta frameworks" what you call "server-side framwork", while calling React/Vue/Owl/... "UI frameworks".)

But I understand that even that may be out-of-scope for Odoo's company.

brillout avatar Apr 13 '23 12:04 brillout

Yes, as Sam said, our first priority is odoo itself. Clearly, developing owl as a standalone framework is a good thing for odoo, so we are not against that, but we just don't have any resource nor plan for that right now.

So, maybe in the future, or maybe if someone want to work on this, then this could be done. In that case, I'll check out vite-pluging-ssr :).

I personally would love to see it.

ged-odoo avatar Apr 14 '23 06:04 ged-odoo

actually, i think i may play with this on my free time. looks exciting

ged-odoo avatar Apr 14 '23 07:04 ged-odoo

👍 Feel free to PM me on Discord if you have questions. (The upcoming V1 design is particularly exciting regarding building frameworks on top of vite-plugin-ssr. I can show you examples.)

brillout avatar Apr 14 '23 07:04 brillout

I already built something similar like this, but it's not open sourced yet. I wouldn't call it meta framework, it's more like a structure to build standalone owl apps for like Onepager or other small websites like marketing websites. I (re-) implemented a simple router, not that good as V1, but it gets the job done. And a Static Site Generator (SSG) with a headless Chrome, which fetches the fully rendered markup to get good SEO results. Everything is archived with vite tooling, so it's fast and ready for the future (at least for js ecosystem conditions).

Maybe I will open source it in the next days or weeks, but I want to make it more stable at least.

For me, owl is too good to just stay in the Odoo ecosystem. But I understand, that that's the main focus. That's the reason, it was developed for.

dennisschott avatar May 07 '23 18:05 dennisschott

great to hear that @dennisschott

Even though Owl was obviously developed first for Odoo, it has been designed in a way that it makes sense even outside of odoo. I want to let you know that we are open to changing Owl to help external tooling and projects (well, if it is reasonable obviously!). For example, we made some changes for the owl browser extension to expose some internals.

I really want to push the owl ecosystem further, and I have some actual plans to do it. Hopefully, I will have the opportunity to work on it more this year. Experimenting with vite plugins like suggested by this issue seems very interesting.

ged-odoo avatar May 07 '23 19:05 ged-odoo

I came here to add a feature request to add SSR to Owl as well. The main reason it interests me is a lot of projects around allowing JavaScript to run in other environments than the web (eg. on mobile with NativeScript) require server side rendering to bring your own framework. I develop mainly on the Odoo platform, but it would be great to be able to take my skills I learn from it to other domains as well.

This is really interesting because I really like the vite project and saw it had support to build SSR on top of, but I don't know much about the underlying details to be able to implement something like that.

denris avatar Sep 22 '23 17:09 denris

Hey guys, it's been a while. I built some internal projects with my "meta" framework/structure and it got more mature while building real life apps. I think it's pretty solid now, but I have to prepare a npm package and docs. So, I guess this will be the hardest and most time consuming part, especially the docs.

I hope that I can work on it in november/december to get it open sourced.

There is also a name missing for that project. If someone has an idea, let me know.

dennisschott avatar Sep 22 '23 17:09 dennisschott

a lot of projects around allowing JavaScript to run in other environments than the web (eg. on mobile with NativeScript) require server side rendering to bring your own framework.

It's not very hard to do SSR with Owl, our tests run on node so it's perfectly feasible to render in a non-browser environment using jsdom or some other DOM implementation like DOMiNATIVE. What we don't have currently is a hydration mechanism which is what would make SSR viable, but that has nothing to do with the ability to run in a NativeScript environment.

If you'd like to try to make Owl work with NativeScript and end up getting stuck because Owl is missing an extension point or makes assumptions that are web-specific, I'd be open to accepting some patches that make owl more compatible with that environment as long as it doesn't make Owl worse for the web and doesn't introduce an undue maintenance burden, but again, we don't have a good incentive to do that kind of work ourselves.

sdegueldre avatar Sep 24 '23 07:09 sdegueldre

Thanks for the time and explanation! (I think I follow) I also appreciate your willingness to tweak things to help in such scenarios. However, I might not need NativScript because some projects give webviews with native access such as dotnet Maui and Tauri for mobile that would probably suffice for my use case.

It still would be really neat to see the ability to have hydration for integration with various other projects, but I do understand not putting first party effort into it.

denris avatar Sep 25 '23 21:09 denris