Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@baiwusanyu-c
Copy link
Member

@baiwusanyu-c baiwusanyu-c commented Mar 7, 2024

close: #10466

@baiwusanyu-c baiwusanyu-c changed the title fix(repl): Avoid duplicate formatter mounts fix(repl): avoid duplicate formatter mounts Mar 7, 2024
@github-actions
Copy link

github-actions bot commented Mar 7, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 89.3 kB 34.1 kB 30.8 kB
vue.global.prod.js 146 kB 53.6 kB 47.8 kB

Usages

Name Size Gzip Brotli
createApp 51.3 kB 20.1 kB 18.3 kB
createSSRApp 54.7 kB 21.4 kB 19.5 kB
defineCustomElement 53.6 kB 20.9 kB 19 kB
overall 65 kB 25.1 kB 22.7 kB

const formatter = {
__formater_key: 'vue-custom-formatter',
header(obj: unknown) {
// TODO also format ComponentPublicInstance & ctx.slots/attrs in setup
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

@haoqunjiang haoqunjiang added ready for review This PR requires more reviews 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. labels Mar 13, 2024
@yyx990803 yyx990803 merged commit 23cd614 into vuejs:main Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. ready for review This PR requires more reviews scope: playground

Projects

None yet

Development

Successfully merging this pull request may close these issues.

window.devtoolsFormatters increase on update

3 participants