You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you may know, this package has a Svelte v5 component named SspaParcel that can be used to mount single-spa parcels. It currently needs to be given the mountParcel() or mountRootParcel() function in order to work.
It would be nice to develop an automatic mechanism for the component to get a hold of this function.
My Proposal
Create a Svelte store for mountParcel(). Then, upon mounting a micro-frontend or parcel, the incoming mountParcel() function in the single-spa-given properties is captured and stored there. At this point, SspaParcel can obtain it from the store. If the store is empty, then an error is thrown.
To cover for the cases where parcels are being mounted in the root config project (as I don't believe in UI-less root config projects), the store can be pre-filled in the root config using mountRootParcel().
I'm open to suggestions, corrections, enhancements or alternatives.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, everyone.
As you may know, this package has a Svelte v5 component named
SspaParcel
that can be used to mountsingle-spa
parcels. It currently needs to be given themountParcel()
ormountRootParcel()
function in order to work.It would be nice to develop an automatic mechanism for the component to get a hold of this function.
My Proposal
Create a Svelte store for
mountParcel()
. Then, upon mounting a micro-frontend or parcel, the incomingmountParcel()
function in thesingle-spa
-given properties is captured and stored there. At this point,SspaParcel
can obtain it from the store. If the store is empty, then an error is thrown.To cover for the cases where parcels are being mounted in the root config project (as I don't believe in UI-less root config projects), the store can be pre-filled in the root config using
mountRootParcel()
.I'm open to suggestions, corrections, enhancements or alternatives.
Beta Was this translation helpful? Give feedback.
All reactions