Skip to content
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

fix: resolve dts-related files relative to remote manifest file #2477

Closed
wants to merge 1 commit into from

Conversation

semekh
Copy link

@semekh semekh commented May 11, 2024

I'm sending this PR as a draft to see if you see this approach fit. I will add/fix tests if you are ok with the general idea.

Copy link

changeset-bot bot commented May 11, 2024

⚠️ No Changeset found

Latest commit: 2659ef4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented May 11, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 2659ef4
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/663f19bf0ca1780008f81982
😎 Deploy Preview https://deploy-preview-2477--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ScriptedAlchemy
Copy link
Member

Can you describe the use case or issue?

@semekh
Copy link
Author

semekh commented May 14, 2024

@ScriptedAlchemy We have a MFE architecture. And we have the following requirements for our builds:

  1. We'd like to build each MFE in an isolated environment so it can not access other modules in the deployment environment during build.
  2. We'd like to use the same build for multiple environments using different domains, so we build without setting the hostname in any URLs.
  3. We'd like to mix modules on dev machine: I'd like to run yarn dev, consume types from multiple remotes on a deployed build, and my own dev machine. We'd like dts to just work.

Up until dts, everything was automatically handled using relative URLs, so we could just deploy on any domain/path and everything would work. But with dts, this was not the case, since the dev machine has no idea which host to look for mf-types on, since we don't set a hostname during build phase.

We're currently handling the situation through using getPublicPath function and it's working. But I assume this usecase is a common one, and also it's in line with module federation working with relative URLs everywhere else.

@ScriptedAlchemy
Copy link
Member

Try public path auto. I just introduced its support back to MF manifests. Will auto mode work?

@ScriptedAlchemy
Copy link
Member

@semekh does auto meet your needs?

@semekh
Copy link
Author

semekh commented May 16, 2024

It looks like it does. Didn't have the chance to test it out yet though.

@ScriptedAlchemy
Copy link
Member

Okay @semekh do you want to close/reopen if it doesnt do whats needed?

@semekh
Copy link
Author

semekh commented May 21, 2024

Sure. Thanks.

@semekh semekh closed this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants