fab-spec / fab

💎 FAB project specification & monorepo

Home Page:https://fab.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nuxt-Support

benboit opened this issue · comments

Hello @geelen,

first of all thanks for this awesome project, it definitly makes life easy!

We are currently planning a project based on Nuxt with SSR support. I saw just now, that you already did an experiment regarding current nuxt version. This last commit (74fd653) feels like you found something deal-breaking? Do you see any potential, this might work at all in the future? Whats the biggest obstacle, which is most likely preventing this to work with FAB?

Thanks!

So Nuxt itself is supported, but https://content.nuxtjs.org/ is not, due to the way the plugin hooks system works. And it was Nuxt Content that I wanted, since that's what I use for https://fab.dev.

Let me see if I can dig out my message I wrote in the discord when I decided not to keep going for the moment...

From Discord (join):

Rohan Babu A M09/04/2020
Hi all, I was wondering if using FAB is a solution to the problem of deploying nuxt.js with SSR to cloudflare workers. If anyone has any ideas about how to approach this, I'll be very obliged. Thanks folks.

geelen09/04/2020
Hey @rohan Babu A M that's.... tough at the moment. I actually managed to get a version working recently with some extremely dark magic but the way Nuxt's plugin systems work make it virtually impossible to support inside FABs
I've actually had a conversation with Atinux who's working on Nuxt 3 right now, which is changing a lot of the internals to make it more portable and less filesystem & NodeJS-driven, and decided to pause any attempt to make it work with FABs until that comes out
a bit like NextJS, there's so many assumptions in the core that tie it to Node. But when next added their serverless target it all became a lot easier. We're basically waiting for Nuxt to do the same
if you like (and are feeling brave) I'd be happy to show you through how Nuxt works internally and why it's not compatible, and where I got up to, but it doesn't sound like Nuxt 3 is far off now so things will hopefully get a lot easier soon

To add to this, the big problem is that Nuxt plugins (like Content) have both build & runtime components, a bit like FAB plugins, but since they fully expect to be running inside NodeJS they can include dependencies that'll never work on FABs or CF Workers. In Nuxt Content's case I believe it was... https://github.com/LokiJS-Forge/LokiDB for full text search.

I believe Vue 3 has been released but I haven't looked again at Nuxt 3. Perhaps in the future the plugin system might be more compatible, but that would come at the expense of power... Hard to say where it's going, but I really enjoy working with Nuxt so I hope we have an SSR story soon.