chrisvfritz / hello-vue-components

An example component library built with Vue CLI 3.
MIT License
316 stars 42 forks source link

Add an example with vue-router #8

Closed EvanBurbidge closed 5 years ago

EvanBurbidge commented 5 years ago

First of all awesome work,

I'd like to pick your brains about whether or not it would be easy to setup an example that exports a full vuejs application and not just components. The reason I say this is that all lerna examples seem to just use components as their exports. None of them allow you to install app2 into app1 and have seemless routing between both packages.

Would be quite handy to have at enterprise level apps.

Any ideas on how one would go about that?

angeliski commented 5 years ago

I would like to see that too :)

EvanBurbidge commented 5 years ago

@angeliski have you done anything in regards to it? I'm still trying to crack it!

angeliski commented 5 years ago

Hi @EvanBurbidge I don't tried, but maybe you should not expose the full application. You can segregate your packages to export the routes config and use I main entry point like a orchestation .

Or you can use a SPA manager like: https://github.com/CanopyTax/single-spa

EvanBurbidge commented 5 years ago

I might give that a shot. Need to keep trying this a little bit first though. Our BE wouldn't be setup to handle that.

Thanks for the tip @angeliski

angeliski commented 5 years ago

@EvanBurbidge Would you be able to make an example repository available for me to take a look at? Maybe I can suggest some other approach.

EvanBurbidge commented 5 years ago

@angeliski https://github.com/EvanBurbidge/mono-repo-tester/ there ya go, its simply build app2 as a lib and install into app1, but with lazy loaded routes in app2

chrisvfritz commented 5 years ago

Sorry for the delayed reply. I apparently wasn't watching this repo, so never saw notifications about issues/PRs. 😅 I think exporting an application is a different enough use case that it's beyond the scope of this project. However, feel free to keep discussing the problem here. 🙂

EvanBurbidge commented 5 years ago

Hey @chrisvfritz no problem! @angeliski the approach i've ended up taking is to not compile the development applications, instead now I am writing projects and maintaining an internal vue cli plugin which will add all non duplicated peer deps into the "consuming applications". I'm also leveraging Lerna hoisting in order to ensure that my repo doesn't duplicate packages across the board.

angeliski commented 5 years ago

Nice @EvanBurbidge ! You can share some code example how do you manager that? I think will be really awesome see the orchestration working Cheers

EvanBurbidge commented 5 years ago

Yeah I'll write something up tonight as a basic example.