Replies: 1 comment 4 replies
-
@bmoellers Sorry for the late reply to this question. I'm not sure I understand what you mean. If your question is about accessing different environments at runtime, you can build all environments into a JSON file, and then use this file to retrieve information about the target environment. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Our company adopted ModernJS because we are going with a new MFE experience for our new applications as it fits how we want our integrators to use pieces of what we offer.
The issue is that we are a big company, which for fun is listed on the list of the companies using Module Federation, but our client team doesn't control our own deployment using UKS/AWS/pods. The deployment team implemented a
build once - deploy many
pipeline that is not how react applications work. Note, they are used to services not applications that are able to do this. Normally react isbuild many - deploy many
or in other words if you change your ENV or deployment line, you have to rebuild react to update.Since ModernJS has a node server, it has the ability to use react router and
page.data.ts
withuseDataLoader
to read the new ENV when deploying/serving node to pass the environment down to the pages.Of course this doesn't work for module federation, even if you share the route page. It just never hits the loader.
I am just looking for a way to fix this so that the node env can be added to the single build of react/modernjs. Something easier than basically doing a string replace before running the node server on the already built code or at least a way to do that programmatically.
Feel free to laugh now and ask me if I am serious but unfortunately I am but I still don't mind being laughed at.
After laughing, is there anyway I am missing to do this runtime ENV from node to the shared components in the provider?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions