Skip to content

Commit d041414

Browse files
feat(devtools): devtools v2 as a browser extension (#155)
* feat(devtools): devtools v2 as a browser extension * docs: devtools v2 * test: accomodate for new devtools * chore: fix codesandbox * feat: sorting via plugin settings * fix: test * fix: basic codesandbox * fix: test * test: add test for prod env
1 parent 19070d6 commit d041414

File tree

25 files changed

+383
-33
lines changed

25 files changed

+383
-33
lines changed

docs/getting-started/devtools.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ Wave your hands in the air and shout hooray because Vue Query comes with dedicat
22

33
When you begin your Vue Query journey, you'll want these DevTools by your side. They help visualize all of the inner workings of Vue Query and will likely save you hours of debugging if you find yourself in a pinch!
44

5+
**The only thing you need to do is to install official [Vue Devtools](https://devtools.vuejs.org/guide/installation.html)**
6+
7+
Vue Query will seemingly integrate with official devtools, adding custom inspector and timeline events.
8+
Devtools would be treeshaken from production bundles by default.
9+
10+
# **Deprecated**: standalone devtools
11+
512
## Import the Devtools
613

714
The DevTools are bundle split into the vue-query/devtools package. No need to install anything extra, just:
@@ -68,7 +75,7 @@ export default defineComponent({
6875
</script>
6976
7077
<template>
71-
<VueQueryDevToolsPanel :style={styles} :className={className} />
78+
<VueQueryDevToolsPanel :style="{ styles }" :className="{ className }" />
7279
</template>
7380
```
7481

examples/2.x-basic/src/App.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<script lang="ts">
22
import { defineComponent, ref } from "@vue/composition-api";
3-
import { VueQueryDevTools } from "vue-query/devtools";
43
54
import Posts from "./Posts.vue";
65
import Post from "./Post.vue";
76
87
export default defineComponent({
98
name: "App",
10-
components: { Posts, Post, VueQueryDevTools },
9+
components: { Posts, Post },
1110
setup() {
1211
const visitedPosts = ref(new Set());
1312
const isVisited = (id: number) => visitedPosts.value.has(id);
@@ -47,6 +46,5 @@ export default defineComponent({
4746
@setPostId="setPostId"
4847
/>
4948
<Posts v-else :isVisited="isVisited" @setPostId="setPostId" />
50-
<VueQueryDevTools :initialIsOpen="true" />
5149
</div>
5250
</template>

examples/2.x-basic/vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ import { createVuePlugin } from "vite-plugin-vue2";
44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [createVuePlugin()],
7+
// For dev purpose, when using `npm link`. This breaks codesandbox somehow.
8+
// optimizeDeps: { exclude: ["vue-query", "vue-demi"] },
79
});

examples/basic/src/App.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<script lang="ts">
22
import { defineComponent, ref } from "vue";
3-
import { VueQueryDevTools } from "vue-query/devtools";
43
54
import Posts from "./Posts.vue";
65
import Post from "./Post.vue";
76
87
export default defineComponent({
98
name: "App",
10-
components: { Posts, Post, VueQueryDevTools },
9+
components: { Posts, Post },
1110
setup() {
1211
const visitedPosts = ref(new Set());
1312
const isVisited = (id: number) => visitedPosts.value.has(id);
@@ -39,12 +38,6 @@ export default defineComponent({
3938
sequences)
4039
</strong>
4140
</p>
42-
<Post
43-
v-if="postId > -1"
44-
:postId="postId"
45-
:style="{}"
46-
@setPostId="setPostId"
47-
/>
41+
<Post v-if="postId > -1" :postId="postId" @setPostId="setPostId" />
4842
<Posts v-else :isVisited="isVisited" @setPostId="setPostId" />
49-
<VueQueryDevTools :initialIsOpen="true" />
5043
</template>

examples/basic/vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ import vue from "@vitejs/plugin-vue";
44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [vue()],
7+
// For dev purpose, when using `npm link`. This breaks codesandbox somehow.
8+
// optimizeDeps: { exclude: ["vue-query", "vue-demi"] },
79
});

examples/multi-client/src/App.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<script lang="ts">
22
import { defineComponent } from "vue";
3-
import { VueQueryDevTools } from "vue-query/devtools";
43
54
import Todos from "./Todos.vue";
65
76
export default defineComponent({
87
name: "App",
9-
components: { Todos, VueQueryDevTools },
8+
components: { Todos },
109
});
1110
</script>
1211

1312
<template>
1413
<h1>Vue Query - Multi Client</h1>
1514
<Todos />
16-
<VueQueryDevTools :initialIsOpen="true" :queryClientKeys="['Foo', 'Bar']" />
1715
</template>

examples/multi-client/vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ import vue from "@vitejs/plugin-vue";
44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [vue()],
7+
// For dev purpose, when using `npm link`. This breaks codesandbox somehow.
8+
// optimizeDeps: { exclude: ["vue-query", "vue-demi"] },
79
});

examples/multi-page/src/App.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<script lang="ts">
22
import { defineComponent, ref } from "vue";
3-
import { VueQueryDevTools } from "vue-query/devtools";
43
import Page from "./Page.vue";
54
65
export default defineComponent({
76
name: "App",
8-
components: { VueQueryDevTools, Page },
7+
components: { Page },
98
setup() {
109
const firstPage = ref(1);
1110
@@ -28,7 +27,6 @@ export default defineComponent({
2827
<button @click="remove">Remove page</button>
2928
<Page v-if="firstPage === 1" title="Page1" />
3029
<Page v-else-if="firstPage === 2" title="Page2" />
31-
<VueQueryDevTools :initialIsOpen="true" />
3230
</template>
3331

3432
<style>

examples/multi-page/vite.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ import vue from "@vitejs/plugin-vue";
44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [vue()],
7+
// For dev purpose, when using `npm link`. This breaks codesandbox somehow.
8+
// optimizeDeps: { exclude: ["vue-query", "vue-demi"] },
79
});

examples/simple/src/App.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<script lang="ts">
22
import { defineComponent } from "vue";
3-
import { VueQueryDevTools } from "vue-query/devtools";
43
54
import Todos from "./Todos.vue";
65
76
export default defineComponent({
87
name: "App",
9-
components: { Todos, VueQueryDevTools },
8+
components: { Todos },
109
});
1110
</script>
1211

1312
<template>
1413
<h1>Vue Query - Simple</h1>
1514
<Todos />
16-
<VueQueryDevTools :initialIsOpen="true" />
1715
</template>

0 commit comments

Comments
 (0)