-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(react): refactor util getModuleFederationConfig
to avoid to pass function to determinate the remote url
#16488
feat(react): refactor util getModuleFederationConfig
to avoid to pass function to determinate the remote url
#16488
Conversation
…ss function to determinate the remote url
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@Coly010 You know more about :) If you have time to take a look will be nice. Thx 👍 |
Hey @fyodorovandrei Thanks for the PR. I'll discuss with @Coly010 about this PR, it looks reasonable to me. We do have the Nx 16 release this week, so we will be delayed in reviewing feature PRs. One behavior change is that |
…d of removing it
} | ||
|
||
const host = serveTarget.options?.host ?? 'http://localhost'; | ||
const port = serveTarget.options?.port ?? 4201; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using/creating a similar function to the findNextAvailablePort to prevent local port collisions?
…actor-util-get-module-federation-config # Conflicts: # packages/react/src/module-federation/utils.ts # packages/react/src/module-federation/with-module-federation-ssr.ts # packages/react/src/module-federation/with-module-federation.ts
@Coly010 Why is a lot of duplicated code? Will be a good idea to refactor? |
There's no good common place that can be used here and there minor differences between react and angular that need to be accounted for. This is fine as is now |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
For the utils
getModuleFederationConfig
you need to pass the parameterdetermineRemoteUrl
.Expected Behavior
For the util
getModuleFederationConfig
now no more needs to passdetermineRemoteUrl
. The util by itself understands which function to callI open a PR in the Module Federation repository to add supports Module Federation remote containers in Storybook. To consume remote MF apps/components in Storybook I created a new util
withModuleFederation
to replace the existing NX util. In the new util I'm usinggetModuleFederationConfig
. With this PR we can use utilgetModuleFederationConfig
without passing the parameterdetermineRemoteUrl