Composing multiple apps as a single SPA

Never done it via SSR. You can try that. i thin it would be a much better solution than mine.
The server renders only one index file, this file choose the app to use.

You can try emitting events. Just remember to remove them beforeDestroy on each vue component

2 Likes

@matan188, that’s also what I thought when I first read the OP’s post. I think it’s the obvious and most elegant way one - just add dynamic loading and there you go. :star_struck::heart_eyes_cat:

But as no one responded to your solution, I wonder if we missed something that would make this solution impractical?

This is the solution that we’re using as well. We have a “root” app, a shared component library, and a number of “sub” apps that all live in a monorepo. We’re using lerna to manage dependencies in the monorepo.

Each sub-app can be developed/built/tested independently. The root app registers all of the sub-apps as plugins. Each sub-app is responsible for adding it’s own routes when it’s registered.

It’s not a perfect solution, but it works better than anything else I’ve seen.

This sounds interesting @jbrunken . Do you have multiple standalone vue-apps(own App.vue/package.json/router/vue.config.js/etc) inside a global “wrapper” app(App.vue/router/vue.config/etc), which initializes all of them when needed?

Would be amazing if you could give us a simplyfied project-structure of your application.

@jbrunken is it too much asking to provide us with a repo with the basic structure and config?

How can we register sub apps as plugins to root app ? can you please provide any example code ?.. and how do you give routing on global level ?

1 Like

@jbrunken
Any samples or guides for the solution ?