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
Just an odd question. We are creating a MFE that shares out components that various teams can use in their applications. Currently using Modern JS as the MFE host (well because Next JS which most of the teams are using just was not reliable using Web Pack 5 Module federation). However many teams are on older versions of Next JS and cannot use module federation exactly so we are also offering a script version.
We solved this by writing a react base wrapper around the MFE that they could import via a standard <script> implementation. The end user will download the script and then provide it a place to overwrite in their home page by passing in the class of the element to overwrite. This does work semi well. However that means we have to deploy two different applications even possibly using the same sub domain with a different path. Not sure this will work well with Modern JS or if we have to get the Akamai team involved.
Just wondering if there would be a more simple way? Is it possible to make a route in the Modern JS that just returns the wrapped component to use as a script? Something that allow the deployment of a single application instead of trying to stitch them together.
I tried just copying the dist of the script to the static folder of the Modern JS app and gave up when it did not work the first time (too many other things to concentrate on right now). Any other ideas?
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
-
Hi all,
Just an odd question. We are creating a MFE that shares out components that various teams can use in their applications. Currently using Modern JS as the MFE host (well because Next JS which most of the teams are using just was not reliable using Web Pack 5 Module federation). However many teams are on older versions of Next JS and cannot use module federation exactly so we are also offering a script version.
We solved this by writing a react base wrapper around the MFE that they could import via a standard
<script>
implementation. The end user will download the script and then provide it a place to overwrite in their home page by passing in the class of the element to overwrite. This does work semi well. However that means we have to deploy two different applications even possibly using the same sub domain with a different path. Not sure this will work well with Modern JS or if we have to get the Akamai team involved.Just wondering if there would be a more simple way? Is it possible to make a route in the Modern JS that just returns the wrapped component to use as a script? Something that allow the deployment of a single application instead of trying to stitch them together.
I tried just copying the
dist
of the script to the static folder of the Modern JS app and gave up when it did not work the first time (too many other things to concentrate on right now). Any other ideas?Beta Was this translation helpful? Give feedback.
All reactions