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: add optional check while accessing webpack internals #2968 #3120

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

MadaraUchiha-314
Copy link
Contributor

@MadaraUchiha-314 MadaraUchiha-314 commented Oct 26, 2024

Description

Related Issue

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Copy link

changeset-bot bot commented Oct 26, 2024

🦋 Changeset detected

Latest commit: 5c6ec74

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 39 packages
Name Type
@module-federation/node Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
modernjs-ssr-dynamic-nested-remote Patch
modernjs-ssr-dynamic-remote-new-version Patch
modernjs-ssr-dynamic-remote Patch
modernjs-ssr-host Patch
modernjs-ssr-nested-remote Patch
modernjs-ssr-remote-new-version Patch
modernjs-ssr-remote Patch
@module-federation/runtime Patch
@module-federation/enhanced Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/rsbuild-plugin Patch
3008-runtime-remote Patch
host Patch
host-v5 Patch
host-vue3 Patch
@module-federation/modernjs Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch
remote1 Patch
remote2 Patch
remote4 Patch
remote3 Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

netlify bot commented Oct 26, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 5c6ec74
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/671fe95cb9d8af0008f57882
😎 Deploy Preview https://deploy-preview-3120--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.

@@ -168,7 +168,7 @@ export const performReload = async (
}
});
//@ts-ignore
__webpack_require__.federation.instance.moduleCache.clear();
__webpack_require__?.federation?.instance?.moduleCache?.clear();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE to reviewers: The code above this already clears the module cache of all the registered remotes. This line assumes that the current execution context is within a federated remote built using federation + webpack, which might not be the case

@MadaraUchiha-314 MadaraUchiha-314 changed the title fix: add optional check while accessing webpack internals fix: add optional check while accessing webpack internals #2968 Oct 26, 2024
@MadaraUchiha-314
Copy link
Contributor Author

@ScriptedAlchemy @2heal1 Is there a way to get a canary version from this PR for testing ?

@ScriptedAlchemy ScriptedAlchemy merged commit 87a2862 into module-federation:main Oct 29, 2024
14 checks passed
@MadaraUchiha-314 MadaraUchiha-314 deleted the fix-2968 branch October 29, 2024 20:39
@2heal1 2heal1 mentioned this pull request Oct 30, 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.

2 participants