-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
chore: update NX libraries to v19 #2764
Conversation
|
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
# Conflicts: # pnpm-lock.yaml
892f169
to
92a6c38
Compare
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.
Summary
The pull request updates the NX libraries to version 19, focusing on improving compatibility, robustness, and reliability across several key components:
- The
runtimePlugin.ts
file in thepackages/node
package has been updated to handle a new propertyUSE_MAIN_CONTEXT_DEFAULT_LOADER
from thevm.constants
object, ensuring better compatibility with the latest NX libraries. - The
load.ts
file in thepackages/runtime
package has been updated to replace theassert
utility function with thelogger
utility module, centralizing and standardizing the logging and assertion functionality used throughout the codebase. - The
logger.ts
file in thepackages/sdk
package introduces a newsafeToString
function to safely convert any input to a JSON string, and thesafeGetLocalStorageItem
function has been moved within the file, improving the robustness and reliability of the logging functionality. - The
node.ts
file in thepackages/sdk
package has been updated to use thevm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER
value when available, falling back to theimportNodeModule
function, to improve the handling of dynamic module imports in the context of the script node creation process. - The
utils.ts
file in thepackages/sdk
package has been updated to remove the/* @__PURE__ */
annotation from the function declarations, likely indicating a change in the build or bundling process.
These changes aim to ensure seamless integration with the latest version of the NX libraries, enhance the overall reliability and robustness of the codebase, and improve the handling of dynamic module imports and logging functionality.
File Summaries
File | Summary |
---|---|
packages/node/src/runtimePlugin.ts | The code changes update the importModuleDynamically function in the runtimePlugin.ts file to handle a new property USE_MAIN_CONTEXT_DEFAULT_LOADER from the vm.constants object. This change ensures compatibility with the latest version of the NX libraries and provides a more robust module loading mechanism. |
packages/runtime/src/utils/load.ts | The code changes update the import statement for the assert utility function, replacing it with the logger utility module. This change likely aims to centralize and standardize the logging and assertion functionality used throughout the codebase. |
packages/sdk/src/logger.ts | The code changes introduce a new function safeToString that safely converts any input to a JSON string, handling potential errors. Additionally, the existing safeGetLocalStorageItem function has been moved within the file. These changes aim to improve the robustness and reliability of the logging functionality in the SDK. |
packages/sdk/src/node.ts | The code changes update the importModuleDynamically function in the createScriptNode method to use the vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER value if available, falling back to the importNodeModule function if not. This modification likely aims to improve the handling of dynamic module imports in the context of the script node creation process. |
packages/sdk/src/utils.ts | The code changes in this file focus on updating the utility functions used for composing, encoding, and decoding names, as well as generating filenames for federation expose and share operations. The primary purpose of these changes is to remove the /* @__PURE__ */ annotation from the function declarations, which likely indicates a change in the build or bundling process. |
ca2baac
to
de96194
Compare
de96194
to
533bcd6
Compare
# Conflicts: # .gitignore # package.json # pnpm-lock.yaml
# Conflicts: # packages/storybook-addon/package.json # pnpm-lock.yaml
- Update eslint rules to disable no-unused-vars and no-unused-expressions - Refactor various container plugins to remove unused code and simplify logic
c9344bf
to
4b719e2
Compare
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.
Incremental Review
Comments posted: 2
Configuration
Squadron Mode: essential
Commits Reviewed
44ac346ef4212a17e4b2d611ba0e7948ba804947...4b719e2b09ace64c17e6ed5c473ebfbc41bcffcb
Files Reviewed
- packages/enhanced/src/index.ts
- packages/node/src/runtimePlugin.ts
- packages/sdk/src/logger.ts
- packages/sdk/src/node.ts
- packages/sdk/src/utils.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- .eslintrc.json
- .github/workflows/e2e-next-dev.yml
- .github/workflows/e2e-next-prod.yml
- .prettierignore
- apps/3000-home/components/SharedNav.tsx
- apps/3000-home/package.json
- apps/3001-shop/package.json
- apps/3002-checkout/package.json
- apps/docs/src/en/modules/ROOT/pages/angular-way/mf-ssr-angular.adoc
- apps/docs/src/en/modules/ROOT/pages/recipes/tailwind-mf.adoc
- apps/manifest-demo/3009-webpack-provider/project.json
- apps/manifest-demo/3009-webpack-provider/webpack.config.js
- apps/manifest-demo/3010-rspack-provider/package.json
- apps/manifest-demo/3010-rspack-provider/rspack.config.js
- apps/manifest-demo/3010-rspack-provider/src/components/ButtonOldAnt.tsx
- apps/manifest-demo/3011-rspack-manifest-provider/package.json
- apps/manifest-demo/3011-rspack-manifest-provider/project.json
- apps/manifest-demo/3011-rspack-manifest-provider/rspack.config.js
- apps/manifest-demo/3011-rspack-manifest-provider/src/bootsrtap.jsx
- apps/manifest-demo/3011-rspack-manifest-provider/src/index.js
- apps/manifest-demo/3012-rspack-js-entry-provider/package.json
- apps/manifest-demo/3012-rspack-js-entry-provider/project.json
- apps/manifest-demo/3012-rspack-js-entry-provider/rspack.config.js
- apps/manifest-demo/3012-rspack-js-entry-provider/src/bootstrap.jsx
- apps/manifest-demo/3012-rspack-js-entry-provider/src/index.js
- apps/manifest-demo/webpack-host/cypress/e2e/basic-usage.cy.ts
- apps/manifest-demo/webpack-host/project.json
- apps/manifest-demo/webpack-host/src/App.tsx
- apps/manifest-demo/webpack-host/webpack.config.js
- apps/node-dynamic-remote-new-version/project.json
- apps/node-dynamic-remote-new-version/webpack.config.js
- apps/node-dynamic-remote/project.json
- apps/node-dynamic-remote/webpack.config.js
- apps/node-local-remote/project.json
- apps/node-local-remote/webpack.config.js
- apps/node-remote/project.json
- apps/node-remote/webpack.config.js
- apps/react-ts-host/project.json
- apps/react-ts-host/webpack.config.js
- apps/react-ts-nested-remote/project.json
- apps/react-ts-nested-remote/webpack.config.js
- apps/react-ts-remote/project.json
- apps/react-ts-remote/rspack.config.js
- apps/react-ts-remote/webpack.config.js
- apps/reactRemoteUI/project.json
- apps/reactRemoteUI/webpack.config.js
- apps/reactRemoteUI/webpack.config.prod.js
- apps/reactStorybook/.storybook/main.js
- apps/reactStorybook/.storybook/preview.js
- apps/reactStorybook/project.json
- apps/reactStorybook/webpack.config.js
- apps/reactStorybook/webpack.config.prod.js
- apps/router-demo/router-host-vue3-2100/package.json
- apps/router-demo/router-remote3-2003/package.json
- apps/runtime-demo/3005-runtime-host/project.json
- apps/runtime-demo/3005-runtime-host/src/Remote2.tsx
- apps/runtime-demo/3005-runtime-host/webpack.config.js
- apps/runtime-demo/3006-runtime-remote/project.json
- apps/runtime-demo/3006-runtime-remote/webpack.config.js
- apps/runtime-demo/3007-runtime-remote/project.json
- apps/runtime-demo/3007-runtime-remote/webpack.config.js
- apps/website/project.json
- nx.json
- package.json
- packages/chrome-devtools/.storybook/main.ts
- packages/esbuild/rollup.config.js
- packages/rspack/package.json
- packages/rspack/rollup.config.js
- packages/runtime/rollup.config.js
- packages/sdk/rollup.config.js
- packages/storybook-addon/package.json
- packages/webpack-bundler-runtime/.swcrc
- packages/webpack-bundler-runtime/rollup.config.js
- pnpm-lock.yaml
//@ts-ignore | ||
vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER ?? | ||
importNodeModule, |
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.
The use of @ts-ignore
and optional chaining with a fallback suggests a potential type mismatch or uncertainty about the vm.constants
property. Consider refactoring this to use a more type-safe approach:
//@ts-ignore | |
vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER ?? | |
importNodeModule, | |
importModuleDynamically: vm.constants && 'USE_MAIN_CONTEXT_DEFAULT_LOADER' in vm.constants | |
? vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER | |
: importNodeModule, |
This change eliminates the need for @ts-ignore
and provides a more explicit check for the existence of the USE_MAIN_CONTEXT_DEFAULT_LOADER
property.
//@ts-ignore | ||
vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER ?? importNodeModule, |
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.
The use of @ts-ignore
and optional chaining with a fallback suggests a potential type mismatch or uncertainty about the vm.constants
property. Consider refactoring this to use a more type-safe approach:
//@ts-ignore | |
vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER ?? importNodeModule, | |
importModuleDynamically: | |
typeof vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER !== 'undefined' | |
? vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER | |
: importNodeModule, |
This change eliminates the need for @ts-ignore
and provides a more explicit check for the existence of USE_MAIN_CONTEXT_DEFAULT_LOADER
.
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.
Incremental Review
Comments posted: 1
Configuration
Squadron Mode: essential
Commits Reviewed
3e2fd6fd3d6eb33f5d493d297b910b3ad2737b9f...6e4f9f7db36a0675ce26f88a2d131d38657b2d5a
Files Reviewed
- packages/runtime/src/utils/load.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- .eslintrc.json
- .github/workflows/e2e-next-dev.yml
- .github/workflows/e2e-next-prod.yml
- .prettierignore
- apps/3000-home/components/SharedNav.tsx
- apps/3000-home/package.json
- apps/3001-shop/package.json
- apps/3002-checkout/package.json
- apps/docs/src/en/modules/ROOT/pages/angular-way/mf-ssr-angular.adoc
- apps/docs/src/en/modules/ROOT/pages/recipes/tailwind-mf.adoc
- apps/manifest-demo/3009-webpack-provider/project.json
- apps/manifest-demo/3009-webpack-provider/webpack.config.js
- apps/manifest-demo/3010-rspack-provider/package.json
- apps/manifest-demo/3010-rspack-provider/rspack.config.js
- apps/manifest-demo/3010-rspack-provider/src/components/ButtonOldAnt.tsx
- apps/manifest-demo/3011-rspack-manifest-provider/package.json
- apps/manifest-demo/3011-rspack-manifest-provider/project.json
- apps/manifest-demo/3011-rspack-manifest-provider/rspack.config.js
- apps/manifest-demo/3011-rspack-manifest-provider/src/bootsrtap.jsx
- apps/manifest-demo/3011-rspack-manifest-provider/src/index.js
- apps/manifest-demo/3012-rspack-js-entry-provider/package.json
- apps/manifest-demo/3012-rspack-js-entry-provider/project.json
- apps/manifest-demo/3012-rspack-js-entry-provider/rspack.config.js
- apps/manifest-demo/3012-rspack-js-entry-provider/src/bootstrap.jsx
- apps/manifest-demo/3012-rspack-js-entry-provider/src/index.js
- apps/manifest-demo/webpack-host/cypress/e2e/basic-usage.cy.ts
- apps/manifest-demo/webpack-host/project.json
- apps/manifest-demo/webpack-host/src/App.tsx
- apps/manifest-demo/webpack-host/webpack.config.js
- apps/node-dynamic-remote-new-version/project.json
- apps/node-dynamic-remote-new-version/webpack.config.js
- apps/node-dynamic-remote/project.json
- apps/node-dynamic-remote/webpack.config.js
- apps/node-local-remote/project.json
- apps/node-local-remote/webpack.config.js
- apps/node-remote/project.json
- apps/node-remote/webpack.config.js
- apps/react-ts-host/project.json
- apps/react-ts-host/webpack.config.js
- apps/react-ts-nested-remote/project.json
- apps/react-ts-nested-remote/webpack.config.js
- apps/react-ts-remote/project.json
- apps/react-ts-remote/rspack.config.js
- apps/react-ts-remote/webpack.config.js
- apps/reactRemoteUI/project.json
- apps/reactRemoteUI/webpack.config.js
- apps/reactRemoteUI/webpack.config.prod.js
- apps/reactStorybook/.storybook/main.js
- apps/reactStorybook/.storybook/preview.js
- apps/reactStorybook/project.json
- apps/reactStorybook/webpack.config.js
- apps/reactStorybook/webpack.config.prod.js
- apps/router-demo/router-host-vue3-2100/package.json
- apps/router-demo/router-remote3-2003/package.json
- apps/runtime-demo/3005-runtime-host/project.json
- apps/runtime-demo/3005-runtime-host/src/Remote2.tsx
- apps/runtime-demo/3005-runtime-host/webpack.config.js
- apps/runtime-demo/3006-runtime-remote/project.json
- apps/runtime-demo/3006-runtime-remote/webpack.config.js
- apps/runtime-demo/3007-runtime-remote/project.json
- apps/runtime-demo/3007-runtime-remote/webpack.config.js
- apps/website/project.json
- nx.json
- package.json
- packages/chrome-devtools/.storybook/main.ts
- packages/esbuild/rollup.config.js
- packages/rspack/package.json
- packages/rspack/rollup.config.js
- packages/runtime/rollup.config.js
- packages/sdk/rollup.config.js
- packages/storybook-addon/package.json
- packages/webpack-bundler-runtime/.swcrc
- packages/webpack-bundler-runtime/rollup.config.js
- pnpm-lock.yaml
async function loadEsmEntry({ | ||
entry, |
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.
The loadEsmEntry
function is defined here, but only its signature is visible. It appears to be handling the loading of ESM (ECMAScript Module) entries. This function likely plays a crucial role in the module federation system. Ensure that the implementation of this function (which is not visible in the provided snippet) properly handles asynchronous loading, error cases, and integrates well with the rest of the system.
# Conflicts: # packages/data-prefetch/rollup.config.js
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.
Incremental Review
Comments posted: 1
Configuration
Squadron Mode: essential
Commits Reviewed
affab373de6b4c547ac753c87ff96145b66ad0cb...3f3beb5c47b0b60771341c2ca748f01b4587dbaf
Files Reviewed
- packages/node/src/runtimePlugin.ts
- packages/runtime/src/utils/load.ts
- packages/sdk/src/logger.ts
- packages/sdk/src/node.ts
- packages/sdk/src/utils.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- .eslintrc.json
- .github/workflows/e2e-modern.yml
- .github/workflows/e2e-next-dev.yml
- .github/workflows/e2e-next-prod.yml
- .prettierignore
- apps/3000-home/components/SharedNav.tsx
- apps/3000-home/package.json
- apps/3001-shop/package.json
- apps/3002-checkout/package.json
- apps/docs/src/en/modules/ROOT/pages/angular-way/mf-ssr-angular.adoc
- apps/docs/src/en/modules/ROOT/pages/recipes/tailwind-mf.adoc
- apps/esbuild/package.json
- apps/manifest-demo/3009-webpack-provider/project.json
- apps/manifest-demo/3009-webpack-provider/webpack.config.js
- apps/manifest-demo/3010-rspack-provider/package.json
- apps/manifest-demo/3010-rspack-provider/rspack.config.js
- apps/manifest-demo/3010-rspack-provider/src/components/ButtonOldAnt.tsx
- apps/manifest-demo/3010-rspack-provider/tsconfig.app.json
- apps/manifest-demo/3010-rspack-provider/tsconfig.json
- apps/manifest-demo/3011-rspack-manifest-provider/package.json
- apps/manifest-demo/3011-rspack-manifest-provider/project.json
- apps/manifest-demo/3011-rspack-manifest-provider/rspack.config.js
- apps/manifest-demo/3011-rspack-manifest-provider/src/bootsrtap.jsx
- apps/manifest-demo/3011-rspack-manifest-provider/src/index.js
- apps/manifest-demo/3012-rspack-js-entry-provider/package.json
- apps/manifest-demo/3012-rspack-js-entry-provider/project.json
- apps/manifest-demo/3012-rspack-js-entry-provider/rspack.config.js
- apps/manifest-demo/3012-rspack-js-entry-provider/src/bootstrap.jsx
- apps/manifest-demo/3012-rspack-js-entry-provider/src/index.js
- apps/manifest-demo/webpack-host/cypress/e2e/basic-usage.cy.ts
- apps/manifest-demo/webpack-host/package.json
- apps/manifest-demo/webpack-host/project.json
- apps/manifest-demo/webpack-host/src/App.tsx
- apps/manifest-demo/webpack-host/webpack.config.js
- apps/modernjs-ssr/dynamic-nested-remote/package.json
- apps/modernjs-ssr/dynamic-remote-new-version/package.json
- apps/modernjs-ssr/dynamic-remote/package.json
- apps/modernjs-ssr/host/package.json
- apps/modernjs-ssr/nested-remote/package.json
- apps/modernjs-ssr/remote-new-version/package.json
- apps/modernjs-ssr/remote/package.json
- apps/modernjs/modern.config.ts
- apps/modernjs/package.json
- apps/node-dynamic-remote-new-version/project.json
- apps/node-dynamic-remote-new-version/webpack.config.js
- apps/node-dynamic-remote/project.json
- apps/node-dynamic-remote/webpack.config.js
- apps/node-local-remote/project.json
- apps/node-local-remote/webpack.config.js
- apps/node-remote/project.json
- apps/node-remote/webpack.config.js
- apps/react-ts-host/project.json
- apps/react-ts-host/webpack.config.js
- apps/react-ts-nested-remote/project.json
- apps/react-ts-nested-remote/webpack.config.js
- apps/react-ts-remote/project.json
- apps/react-ts-remote/rspack.config.js
- apps/react-ts-remote/webpack.config.js
- apps/reactRemoteUI/project.json
- apps/reactRemoteUI/webpack.config.js
- apps/reactRemoteUI/webpack.config.prod.js
- apps/reactStorybook/.storybook/main.js
- apps/reactStorybook/.storybook/preview.js
- apps/reactStorybook/project.json
- apps/reactStorybook/webpack.config.js
- apps/reactStorybook/webpack.config.prod.js
- apps/router-demo/router-host-v5-2200/package.json
- apps/router-demo/router-host-vue3-2100/package.json
- apps/router-demo/router-remote1-2001/package.json
- apps/router-demo/router-remote3-2003/package.json
- apps/runtime-demo/3005-runtime-host/project.json
- apps/runtime-demo/3005-runtime-host/src/Remote2.tsx
- apps/runtime-demo/3005-runtime-host/webpack.config.js
- apps/runtime-demo/3006-runtime-remote/project.json
- apps/runtime-demo/3006-runtime-remote/webpack.config.js
- apps/runtime-demo/3007-runtime-remote/project.json
- apps/runtime-demo/3007-runtime-remote/webpack.config.js
- apps/runtime-demo/3008-runtime-remote/package.json
- apps/website/project.json
- nx.json
- package.json
- packages/bridge/bridge-react-webpack-plugin/tests/mockRouterDir/router-v6/react-router-dom/package.json
- packages/bridge/bridge-react/package.json
- packages/chrome-devtools/.storybook/main.ts
- packages/chrome-devtools/package.json
- packages/chrome-devtools/src/utils/chrome/fast-refresh.ts
- packages/data-prefetch/.swcrc
- packages/data-prefetch/package.json
- packages/data-prefetch/rollup.config.js
- packages/enhanced/test/configCases/container/3-container-full/index.js
- packages/esbuild/rollup.config.js
- packages/modernjs/src/cli/index.ts
- packages/rspack/package.json
- packages/rspack/rollup.config.js
- packages/runtime/rollup.config.js
- packages/sdk/rollup.config.js
- packages/storybook-addon/package.json
- packages/utilities/package.json
- packages/webpack-bundler-runtime/.swcrc
- packages/webpack-bundler-runtime/rollup.config.js
- pnpm-lock.yaml
- webpack/package.json
importModuleDynamically: | ||
//@ts-ignore | ||
vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER ?? | ||
importNodeModule, |
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.
The use of @ts-ignore
and optional chaining with a fallback suggests a potential type mismatch or uncertainty about the vm.constants
property. Consider refactoring this to use a more type-safe approach:
importModuleDynamically: | |
//@ts-ignore | |
vm.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER ?? | |
importNodeModule, | |
importModuleDynamically: vm.constants && 'USE_MAIN_CONTEXT_DEFAULT_LOADER' in vm.constants | |
? vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER | |
: importNodeModule, |
This change eliminates the need for @ts-ignore
and provides a more explicit check for the existence of the USE_MAIN_CONTEXT_DEFAULT_LOADER
property.
# Conflicts: # packages/chrome-devtools/package.json # pnpm-lock.yaml
Description
Related Issue
Types of changes
Checklist