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

feat: add errors reference page #2515

Closed
wants to merge 4 commits into from
Closed

feat: add errors reference page #2515

wants to merge 4 commits into from

Conversation

sxzz
Copy link
Member

@sxzz sxzz commented Sep 25, 2023

@netlify
Copy link

netlify bot commented Sep 25, 2023

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 2708227
🔍 Latest deploy log https://app.netlify.com/sites/vuejs/deploys/65198cb47412c60008acfe26
😎 Deploy Preview https://deploy-preview-2515--vuejs.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.

src/errors/index.md Outdated Show resolved Hide resolved
.vitepress/errors.data.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,8 @@
import { defineLoader } from 'vitepress'
import { errorMessages } from '@vue/compiler-core'
Copy link
Member

Choose a reason for hiding this comment

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

We should be including runtime errors here as well. In fact, runtime errors are more important than compiler errors because most of the time compilers run in dev mode.

Copy link
Member Author

Choose a reason for hiding this comment

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

Runtime errors didn't be exported. We should do it first.

Copy link
Member Author

Choose a reason for hiding this comment

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

ErrorTypeStrings is not exported in runtime-core, but exporting will increase the bundle size of vue itself at the same time. Because vue re-exported all of runtime-core.

Can we have a better way of exporting? How about exporting errors in another package entry, like @vue/runtime-core/errors

Copy link
Member Author

Choose a reason for hiding this comment

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

Added runtime errors.

Copy link
Member

@haoqunjiang haoqunjiang left a comment

Choose a reason for hiding this comment

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

Here's how React's Error Decoder is implemented:
https://github.com/facebook/react/tree/17.0.2/scripts/error-codes

Note this sentence:

This file is append-only, which means an existing code in the file will never be changed/removed.

Unless we do something similar to ensure the existing error codes would never change, we may need a version number in the page URL.

@yyx990803 yyx990803 mentioned this pull request Dec 26, 2023
@yyx990803
Copy link
Member

resolved conflicts and included in #2625

@yyx990803 yyx990803 closed this Dec 26, 2023
@sxzz sxzz deleted the feat/errors branch December 28, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants