-
-
Notifications
You must be signed in to change notification settings - Fork 374
chore: unify error code #3156
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: unify error code #3156
Conversation
|
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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 unifies the error code handling across the codebase and adds related documentation to help users more easily locate and understand issues. The key changes include:
- Introducing new error code utilities, such as
getShortErrorMsg,TYPE_001,typeDescMap,RUNTIME_004, andruntimeDescMap, to provide more informative and consistent error messages. - Updating error handling and logging in various modules, including
archiveHandler,typeScriptCompiler,core,module,SnapshotHandler,remote,shared, andload, to use the new error code system. - Adding new error codes and related documentation to help users quickly identify and address the problems they encounter.
- Improving the overall user experience by making it easier for users to locate and understand issues, particularly those related to TypeScript compilation, remote module loading, and shared module management.
The changes aim to unify the error handling across the codebase, making the system more consistent and user-friendly.
File Summaries
| File | Summary |
|---|---|
| packages/dts-plugin/src/core/lib/archiveHandler.ts | The code changes unify the error codes and add related documentation to help users locate issues more easily. The key modifications include removing the unused typescript import and updating the error handling and documentation to provide a more consistent and user-friendly experience. |
| packages/dts-plugin/src/core/lib/typeScriptCompiler.ts | The code changes unify the error code handling and add related documentation to help users locate issues more easily. The key modifications include introducing new error code utilities, such as getShortErrorMsg, TYPE_001, and typeDescMap, and using them to provide more informative error messages when the TypeScript compilation fails. |
| packages/runtime/src/core.ts | The code changes unify the error code and add related documentation to help users locate questions more easily. The key modifications include adding a new from option to the FederationHost.shareModule method, which allows specifying whether the shared module is from the build or runtime. |
| packages/runtime/src/module/index.ts | The code changes unify the error handling by introducing a new error module and updating the existing error logging. The primary purpose is to provide more informative and consistent error messages to users, making it easier for them to locate and understand issues. |
| packages/runtime/src/plugins/snapshot/SnapshotHandler.ts | The code changes unify the error handling by introducing new error codes and related documentation. This helps users locate and understand issues more easily. The changes include adding new error codes, updating error messages, and improving the overall error handling in the SnapshotHandler class. |
| packages/runtime/src/remote/index.ts | The code changes unify the error code handling and add related documentation to help users locate issues more easily. The key modifications include: |
- Importing new error-related utilities such as
getShortErrorMsg,RUNTIME_004, andruntimeDescMap. - Replacing a verbose error message with a more concise one using the new error-handling utilities.
- The changes aim to provide users with clearer and more informative error messages when encountering issues related to remote module loading. |
| packages/runtime/src/shared/index.ts | The code changes unify the error handling by introducing new error codes and related documentation. This helps users better locate and understand the issues they encounter when using theloadShareSyncfunction. The changes also add an optionalfromparameter to theloadShareSyncfunction to differentiate between errors that occur during build-time and runtime. |
| packages/runtime/src/utils/load.ts | The code changes unify the error code and add related documentation to help users locate issues more easily. The key modifications include replacing verbose error messages with a more concise and standardized error message using a new error code system, which provides a better user experience. |
53eb4dd to
52eb36b
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: 14
Configuration
Squadron Mode: essential
Commits Reviewed
283574b55c8441b0336b712121d315fc41ebf1e8...52eb36b72e9b02f50f70b2b419d6bb141a01e7a3
Files Reviewed
- packages/runtime/src/core.ts
- packages/runtime/src/module/index.ts
- packages/runtime/src/plugins/snapshot/SnapshotHandler.ts
- packages/runtime/src/remote/index.ts
- packages/runtime/src/shared/index.ts
- packages/runtime/src/utils/load.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- apps/website-new/docs/en/guide/_meta.json
- apps/website-new/docs/en/guide/basic/_meta.json
- apps/website-new/docs/en/guide/troubleshooting/_meta.json
- apps/website-new/docs/en/guide/troubleshooting/faq.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-001.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-002.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-004.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-005.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-006.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-015.mdx
- apps/website-new/docs/en/practice/_meta.json
- apps/website-new/docs/public/words-map.json
- apps/website-new/docs/zh/guide/_meta.json
- apps/website-new/docs/zh/guide/troubleshooting/_meta.json
- apps/website-new/docs/zh/guide/troubleshooting/faq.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-001.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-002.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-003.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-004.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-005.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-006.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-007.mdx
- apps/website-new/docs/zh/practice/_meta.json
- apps/website-new/package.json
- apps/website-new/rspress.config.ts
- apps/website-new/src/components/ErrorCodeTitle.tsx
- apps/website-new/src/components/Table.tsx
- apps/website-new/src/components/en/EnableAsyncEntry.mdx
- apps/website-new/src/components/zh/EnableAsyncEntry.mdx
- packages/error-codes/.swcrc
- packages/error-codes/CHANGELOG.md
- packages/error-codes/README.md
- packages/error-codes/jest.config.js
- packages/error-codes/package.json
- packages/error-codes/project.json
- packages/error-codes/src/desc.ts
- packages/error-codes/src/error-codes.ts
- packages/error-codes/src/getShortErrorMsg.ts
- packages/error-codes/src/index.ts
- packages/error-codes/tsconfig.json
- packages/error-codes/tsconfig.lib.json
- packages/error-codes/tsconfig.spec.json
- packages/runtime/package.json
- packages/runtime/rollup.config.js
- packages/runtime/tsconfig.json
- packages/sdk/package.json
- pnpm-lock.yaml
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
8fddfc21608f199e095956daa78b62963850b3d3...0c31633cedcaeb1d2445b0cf012e2665dc759ccd
Files Reviewed
- packages/dts-plugin/src/core/lib/typeScriptCompiler.ts
Files Ignored
These files were ignored due to the filter in the squadron.yaml file.
- apps/website-new/docs/en/guide/_meta.json
- apps/website-new/docs/en/guide/basic/_meta.json
- apps/website-new/docs/en/guide/troubleshooting/_meta.json
- apps/website-new/docs/en/guide/troubleshooting/other.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-001.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-002.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-003.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-004.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-005.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-006.mdx
- apps/website-new/docs/en/guide/troubleshooting/runtime/RUNTIME-007.mdx
- apps/website-new/docs/en/guide/troubleshooting/type/TYPE-001.mdx
- apps/website-new/docs/en/practice/_meta.json
- apps/website-new/docs/public/words-map.json
- apps/website-new/docs/zh/guide/_meta.json
- apps/website-new/docs/zh/guide/troubleshooting/_meta.json
- apps/website-new/docs/zh/guide/troubleshooting/other.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-001.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-002.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-003.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-004.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-005.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-006.mdx
- apps/website-new/docs/zh/guide/troubleshooting/runtime/RUNTIME-007.mdx
- apps/website-new/docs/zh/guide/troubleshooting/type/TYPE-001.mdx
- apps/website-new/docs/zh/practice/_meta.json
- apps/website-new/package.json
- apps/website-new/rspress.config.ts
- apps/website-new/src/components/ErrorCodeTitle.tsx
- apps/website-new/src/components/Table.tsx
- apps/website-new/src/components/en/EnableAsyncEntry.mdx
- apps/website-new/src/components/zh/EnableAsyncEntry.mdx
- packages/dts-plugin/package.json
- packages/enhanced/test/configCases/sharing/consume-multiple-versions-ignore-warnings/index.js
- packages/enhanced/test/configCases/sharing/consume-multiple-versions/index.js
- packages/error-codes/.swcrc
- packages/error-codes/CHANGELOG.md
- packages/error-codes/README.md
- packages/error-codes/jest.config.js
- packages/error-codes/package.json
- packages/error-codes/project.json
- packages/error-codes/src/desc.ts
- packages/error-codes/src/error-codes.ts
- packages/error-codes/src/getShortErrorMsg.ts
- packages/error-codes/src/index.ts
- packages/error-codes/tsconfig.json
- packages/error-codes/tsconfig.lib.json
- packages/error-codes/tsconfig.spec.json
- packages/runtime/tests/shares.spec.ts
- packages/runtime/package.json
- packages/runtime/rollup.config.js
- packages/runtime/tsconfig.json
- packages/sdk/package.json
- pnpm-lock.yaml
Description
unify error code and add related doc , help users locate questions easier
before

after
website doc
overview

Related Issue
Types of changes
Checklist