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(module-federation): ensure incorrect tsconfig path mappings are not used #21391 #21416

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Jan 30, 2024

Current Behavior

We cache the TS Path Mappings when building MF apps. However, if multiple builds occur in a single process, an incorrect set of mappings can be used as they are cached.

Expected Behavior

Make the cache more robust and based on the actual tsconfig path used.

Related Issue(s)

Fixes #21391

@Coly010 Coly010 requested a review from jaysoo as a code owner January 30, 2024 12:16
@Coly010 Coly010 self-assigned this Jan 30, 2024
Copy link

vercel bot commented Jan 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2024 10:15am

@Coly010 Coly010 force-pushed the mf/prevent-using-incorrect-tspaths branch from 4dfa770 to 6a4f598 Compare January 30, 2024 17:10
if (tsPathMappings) {
return tsPathMappings;
if (tsPathMappings.has(tsConfigPath)) {
return tsPathMappings.get(tsConfigPath);
}

tsConfig ??= readTsConfiguration(tsConfigPath);
Copy link

@statop statop Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to either not cache tsConfig or cache it by path.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is caching by path now? Unless you see some issue with it?

it’ll take the path to the tsconfig from the build process and use that to build and entry in the cache

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait I see it. Yes good catch

@Coly010 Coly010 force-pushed the mf/prevent-using-incorrect-tspaths branch from 6a4f598 to 4dec066 Compare January 31, 2024 10:02
@Coly010 Coly010 force-pushed the mf/prevent-using-incorrect-tspaths branch from 4dec066 to 8704c2a Compare January 31, 2024 10:15
@Coly010 Coly010 merged commit fbca31a into nrwl:master Jan 31, 2024
6 checks passed
@Coly010 Coly010 deleted the mf/prevent-using-incorrect-tspaths branch January 31, 2024 17:07
FrozenPandaz pushed a commit that referenced this pull request Feb 2, 2024
Copy link

github-actions bot commented Feb 6, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants