-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
fix(repl): avoid duplicate formatter mounts #10472
Conversation
Size ReportBundles
Usages
|
@@ -24,6 +24,7 @@ export function initCustomFormatter() { | |||
// custom formatter for Chrome | |||
// https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html | |||
const formatter = { | |||
__formater_key: 'vue-custom-formatter', | |||
header(obj: unknown) { | |||
// TODO also format ComponentPublicInstance & ctx.slots/attrs in setup |
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.
While this PR works, I prefer fixing the issue in the playground codebase.
Otherwise, we need some kind of versioning in the custom formatter.
Consider the scenario where we implemented the feature mentioned in this TODO comment in the future, and the page has loaded several versions of Vue; we would still need to add the latest custom formatter despite the presence of another version of Vue custom formatter.
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.
Do you mean that I should modify @vue/sfc-playground and find a way to ensure that the custom formatter is always up to date when using multiple versions of vue?
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.
I think just modifying the sfc-playground package is enough.
There are very few cases that we need to worry about too many devtoolFormatters so the deduplication might be overkill.
close: #10466