feat(runtime): add webpack require and bundler-ignore accessors#4457
feat(runtime): add webpack require and bundler-ignore accessors#4457ScriptedAlchemy wants to merge 43 commits intomainfrom
Conversation
Co-authored-by: zackary.l.jackson <zackary.l.jackson@gmail.com>
|
Cursor Agent can help with this pull request. Just |
|
❌ Deploy Preview for module-federation-docs failed. Why did it fail? →
|
@module-federation/devtools
@module-federation/cli
create-module-federation
@module-federation/data-prefetch
@module-federation/dts-plugin
@module-federation/enhanced
@module-federation/error-codes
@module-federation/esbuild
@module-federation/managers
@module-federation/manifest
@module-federation/metro
@module-federation/metro-plugin-rnc-cli
@module-federation/metro-plugin-rnef
@module-federation/modern-js
@module-federation/modern-js-v3
@module-federation/native-federation-tests
@module-federation/native-federation-typescript
@module-federation/nextjs-mf
@module-federation/node
@module-federation/retry-plugin
@module-federation/rsbuild-plugin
@module-federation/rspack
@module-federation/rspress-plugin
@module-federation/runtime
@module-federation/runtime-core
@module-federation/runtime-tools
@module-federation/sdk
@module-federation/storybook-addon
@module-federation/third-party-dts-extractor
@module-federation/treeshake-frontend
@module-federation/treeshake-server
@module-federation/typescript
@module-federation/utilities
@module-federation/webpack-bundler-runtime
@module-federation/bridge-react
@module-federation/bridge-react-webpack-plugin
@module-federation/bridge-shared
@module-federation/bridge-vue3
@module-federation/inject-external-runtime-core-plugin
commit: |
Bundle Size Report7 package(s) changed, 34 unchanged.
Total dist: 6.90 MB (+19.7 kB (+0.3%)) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3de5a394f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ScriptedAlchemy
left a comment
There was a problem hiding this comment.
I found one regression in packages/utilities/src/utils/pure.ts: loadScript now resolves getWebpackRequireOrThrow() before checking whether the remote container is already present on globalScope. In non-webpack hosts with preloaded globals, this throws early (__webpack_require__ missing) instead of returning the existing container. Consider resolving webpack require only in the branch that actually calls webpackRequire.l(...).
|
Re-reviewed latest head
|
|
@codex review the pr |
|
Re-review on head |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…e-require-access-725d
Resolve the dts-plugin TYPE-001 failure by correcting package entry paths for workspace dependencies and updating RawSource usage for webpack typings. Co-authored-by: Cursor <cursoragent@cursor.com>
Restore sdk and error-codes export paths to the filenames emitted by the current build so CI package resolution no longer fails on these branches. Co-authored-by: Cursor <cursoragent@cursor.com>
…e-require-access-725d # Conflicts: # .changeset/twelve-forks-whisper.md
…e-require-access-725d # Conflicts: # packages/sdk/project.json
Description
Centralizes access to
__webpack_require__and dynamicwebpackIgnore/vite-ignoreimports into dedicated helpers. This prevents direct global references from being inlined or patched during bundling, allowing downstream packages to import these functionalities externally.Specifically:
getWebpackRequire()andgetWebpackRequireOrThrow()in@module-federation/webpack-bundler-runtime/accessorfor safe__webpack_require__access.importWithBundlerIgnore()in@module-federation/sdkto encapsulate/* webpackIgnore: true */ /* @vite-ignore */dynamic imports, avoiding dependency cycles.__webpack_require__and magic-comment dynamic import usages inruntime-coreandutilitiesto use these new helpers.__webpack_require__reference withinwebpack-bundler-runtimeitself.Related Issue
Addresses the need to provide stable, importable accessors for webpack runtime globals and magic-comment-driven dynamic imports, as discussed in the conversation.
Types of changes
Checklist