First of all a great framework for SSR based MFEs . I was trying out the Ara / Svelte (Micro App1) / Vue (Micro App 2) / Nuxt JS (Appshell) as described in https://ara-framework.github.io/website/blog/2019/08/27/nuxt-js as well as setup the cluster and proxy as described in the docs https://ara-framework.github.io/website/docs/nova-cluster
In the App shell in the Nuxt App I need to include the client side scripts like this
head: {
script: [
{ src: 'http://localhost:3000/public/client.js' },
{ src: 'http://localhost:3001/public/client.js' }
]
}
Is there a better way to discover and load this scripts , similar to the server side part is handled by the proxy and the cluster servers ? The problem with the current approach is I need to know where the nova server client scripts are deployed before hand.
As you describe in the comments, using the
NovaMountevent is the best approach so far. Unfortunately, there's nothing out of the box to do it without explicitly define the bundle URLs yet.However, we plan to add a new feature to Nova Proxy to make that easier.
In the
getComponenthelper, we can use thereturnMetaproperty from the second parameter to return the client script URL in the Hypernova response.We get something like this in the Hypernova response.
We plan to inject that client URL in Nova Proxy when including the Nova views as well.
I created this Github issue where you can follow-up on the feature progress. https://github.com/ara-framework/nova-proxy/issues/10