Skip to content

Conversation

@2heal1
Copy link
Member

@2heal1 2heal1 commented Nov 1, 2024

Description

unify error code and add related doc , help users locate questions easier

before
image

after

image
website doc

image

overview
image

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.

@changeset-bot
Copy link

changeset-bot bot commented Nov 1, 2024

⚠️ No Changeset found

Latest commit: ae090bb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@netlify
Copy link

netlify bot commented Nov 1, 2024

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit ae090bb
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/672871f87a7a610008bec272
😎 Deploy Preview https://deploy-preview-3156--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.

Copy link
Contributor

@squadronai squadronai bot left a 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, and runtimeDescMap, to provide more informative and consistent error messages.
  • Updating error handling and logging in various modules, including archiveHandler, typeScriptCompiler, core, module, SnapshotHandler, remote, shared, and load, 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:
  1. Importing new error-related utilities such as getShortErrorMsg, RUNTIME_004, and runtimeDescMap.
  2. Replacing a verbose error message with a more concise one using the new error-handling utilities.
  3. 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 the loadShareSync function. The changes also add an optional from parameter to the loadShareSync function 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. |

@2heal1 2heal1 force-pushed the chore/unified-error-code branch from 53eb4dd to 52eb36b Compare November 1, 2024 09:19
Copy link
Contributor

@squadronai squadronai bot left a 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

Copy link
Contributor

@squadronai squadronai bot left a 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

@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@module-federation module-federation deleted a comment from squadronai bot Nov 1, 2024
@zhoushaw zhoushaw merged commit 8d34aa8 into main Nov 4, 2024
17 checks passed
@zhoushaw zhoushaw deleted the chore/unified-error-code branch November 4, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants