Last 12 weeks · 16 commits
2 of 6 standards met
Vue DevTools 6 had settings and , both defaulting to . Currently, these settings appear in the types for Vue DevTools 8 but they don't actually do anything. I don't know whether anyone actually uses these settings, but Vue DevTools 8 currently behaves as though they are set to , which is different from version 6. The code that implemented these settings in v6 is: They are also documented at: This difference from v6 has led to some problems in Vue Router and Pinia when working with multiple applications on the same page. A couple of notes on my implementation: I couldn't figure out how to get the types to behave, so I've resorted to in a couple of places. If anyone has a better suggestion please let me know. I've checked , which is slightly different from how v6 did it (using ). I'm not sure if this makes a difference, it seemed to work fine in my testing. I checked various libraries to see how they use . Some aren't using v8 yet, but Vue Router, Pinia and VitePress are notable examples that are. I've outlined the problems with those libraries below. This PR should fix these problems. Vue Router It's possible to have multiple apps with multiple routers on a page using . Vue Router's integration with the DevTools is here: This makes 4 calls to hooks. Two of them are checking , two aren't. The two that aren't lead to problems. The tags are duplicated and there are multiple entries. If we don't fix this in Vue DevTools then it'll need to be fixed in Vue Router instead. Pinia DevTools integration is here: There are 5 calls and two are missing the . I'm unclear what the call to actually does. I haven't been able to find where this gets triggered in the DevTools. But from looking at how Pinia uses it, it looks like adding would be harmless and might even be necessary to ensure it updates the correct instance. The other is , which leads to duplication in the DevTools: Again, if we don't fix this in Vue DevTools then it'll need to be fixed in Pinia instead. VitePress VitePress is using v8. The code for its integration is at: That isn't checking , which can lead to properties being injected in the wrong app.
Very unexpectedly, this morning the Vue app I was developing started failing after I've renamed a component, and then even reverting all changes it continued failing. After debugging deeper, I've found the inject keys for the component (which come from a mixin, the component references the mixin and the mixin contains "inject") weren't containing the expected value. I've used a Proxy() to catch who was writing to the "inject" arrays, and it seemed to be this plugin 🤯 This stacktrace shows the plugin source code calling Object.assign on my app data Due to restrictions I can't share codebase or an usable demo of the app, but hope those screenshots help bring context and maybe reproduce, component uses two mixins and each one of them brings an inject array which Vue combines together.
Repository: vuejs/devtools. Description: ⚙️ Browser devtools extension for debugging Vue.js applications. Stars: 2771, Forks: 242. Primary language: TypeScript. Languages: TypeScript (75.7%), Vue (22.4%), HTML (1%), CSS (0.6%), JavaScript (0.2%). License: MIT. Homepage: https://devtools.vuejs.org/ Latest release: v8.0.6 (3w ago). Open PRs: 32, open issues: 178. Last activity: 7h ago. Community health: 37%. Top contributors: webfansplz, alexzhang1030, renovate[bot], Azurewarth0920, skirtles-code, LoTwT, JianJroh, yyx990803, btea, xuzuodong and others.
TypeScript
Fixes #1049. An example to reproduce the problem: In this example, inspecting shows a property called , even though doesn't have a property called . That property has leaked from , via the mixin. In , we currently have this line: That's using the original object from the mixin, not a copy. This is the underlying problem. Later we hit this line: That modifies , adding properties from . In my earlier example, is the object from the mixin, and this copies in the property from . The same problem applies to .
Please consider removing the "Welcome to the new version..." screen soon. When using incognito mode, the screen gets shown everytime on new browser contexts, which adds up to a lot of unnecessary extra clicks needed to actually use the tool. _Originally posted by @fmgrafikdesign in https://github.com/vuejs/devtools/discussions/111#discussioncomment-11291261_