-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Conversation
✅ Deploy Preview for vuejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
.vitepress/errors.data.ts
Outdated
@@ -0,0 +1,8 @@ | |||
import { defineLoader } from 'vitepress' | |||
import { errorMessages } from '@vue/compiler-core' |
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.
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.
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.
Runtime errors didn't be exported. We should do it first.
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.
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
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.
Added runtime errors.
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.
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.
resolved conflicts and included in #2625 |
Preview: https://deploy-preview-2515--vuejs.netlify.app/errors/#10
relate vuejs/core#9165