@tanstack/devtools
Advanced tools
+12
-19
@@ -10,5 +10,4 @@ export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/A767CXXU.js'; | ||
| #plugins = []; | ||
| #isMounted = false; | ||
| #isMounting = false; | ||
| #abortMount = false; | ||
| #state = "unmounted"; | ||
| #mountAbortController; | ||
| #dispose; | ||
@@ -28,10 +27,9 @@ #eventBus; | ||
| if (typeof document === "undefined") return; | ||
| if (this.#isMounted || this.#isMounting) { | ||
| if (this.#state === "mounted" || this.#state === "mounting") { | ||
| throw new Error("Devtools is already mounted"); | ||
| } | ||
| this.#isMounting = true; | ||
| this.#abortMount = false; | ||
| this.#state = "mounting"; | ||
| const { signal } = this.#mountAbortController = new AbortController(); | ||
| import('./mount-impl/3OW54XWT.js').then(({ mountDevtools }) => { | ||
| if (this.#abortMount) { | ||
| this.#isMounting = false; | ||
| if (signal.aborted) { | ||
| return; | ||
@@ -50,6 +48,5 @@ } | ||
| this.#eventBus = result.eventBus; | ||
| this.#isMounted = true; | ||
| this.#isMounting = false; | ||
| this.#state = "mounted"; | ||
| }).catch((err) => { | ||
| this.#isMounting = false; | ||
| this.#state = "unmounted"; | ||
| console.error("[TanStack Devtools] Failed to load:", err); | ||
@@ -59,13 +56,9 @@ }); | ||
| unmount() { | ||
| if (!this.#isMounted && !this.#isMounting) { | ||
| if (this.#state === "unmounted") { | ||
| throw new Error("Devtools is not mounted"); | ||
| } | ||
| if (this.#isMounting) { | ||
| this.#abortMount = true; | ||
| this.#isMounting = false; | ||
| return; | ||
| } | ||
| this.#mountAbortController?.abort(); | ||
| this.#eventBus?.stop(); | ||
| this.#dispose?.(); | ||
| this.#isMounted = false; | ||
| this.#state = "unmounted"; | ||
| } | ||
@@ -79,3 +72,3 @@ setConfig(config) { | ||
| this.#plugins = config.plugins; | ||
| if (this.#isMounted && this.#setPlugins) { | ||
| if (this.#state === "mounted" && this.#setPlugins) { | ||
| this.#setPlugins(config.plugins); | ||
@@ -82,0 +75,0 @@ } |
+12
-19
@@ -10,5 +10,4 @@ export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/A767CXXU.js'; | ||
| #plugins = []; | ||
| #isMounted = false; | ||
| #isMounting = false; | ||
| #abortMount = false; | ||
| #state = "unmounted"; | ||
| #mountAbortController; | ||
| #dispose; | ||
@@ -28,10 +27,9 @@ #eventBus; | ||
| if (typeof document === "undefined") return; | ||
| if (this.#isMounted || this.#isMounting) { | ||
| if (this.#state === "mounted" || this.#state === "mounting") { | ||
| throw new Error("Devtools is already mounted"); | ||
| } | ||
| this.#isMounting = true; | ||
| this.#abortMount = false; | ||
| this.#state = "mounting"; | ||
| const { signal } = this.#mountAbortController = new AbortController(); | ||
| import('./mount-impl/3OW54XWT.js').then(({ mountDevtools }) => { | ||
| if (this.#abortMount) { | ||
| this.#isMounting = false; | ||
| if (signal.aborted) { | ||
| return; | ||
@@ -50,20 +48,15 @@ } | ||
| this.#eventBus = result.eventBus; | ||
| this.#isMounted = true; | ||
| this.#isMounting = false; | ||
| this.#state = "mounted"; | ||
| }).catch((err) => { | ||
| this.#isMounting = false; | ||
| this.#state = "unmounted"; | ||
| }); | ||
| } | ||
| unmount() { | ||
| if (!this.#isMounted && !this.#isMounting) { | ||
| if (this.#state === "unmounted") { | ||
| throw new Error("Devtools is not mounted"); | ||
| } | ||
| if (this.#isMounting) { | ||
| this.#abortMount = true; | ||
| this.#isMounting = false; | ||
| return; | ||
| } | ||
| this.#mountAbortController?.abort(); | ||
| this.#eventBus?.stop(); | ||
| this.#dispose?.(); | ||
| this.#isMounted = false; | ||
| this.#state = "unmounted"; | ||
| } | ||
@@ -77,3 +70,3 @@ setConfig(config) { | ||
| this.#plugins = config.plugins; | ||
| if (this.#isMounted && this.#setPlugins) { | ||
| if (this.#state === "mounted" && this.#setPlugins) { | ||
| this.#setPlugins(config.plugins); | ||
@@ -80,0 +73,0 @@ } |
+12
-19
@@ -10,5 +10,4 @@ export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/A767CXXU.js'; | ||
| #plugins = []; | ||
| #isMounted = false; | ||
| #isMounting = false; | ||
| #abortMount = false; | ||
| #state = "unmounted"; | ||
| #mountAbortController; | ||
| #dispose; | ||
@@ -28,10 +27,9 @@ #eventBus; | ||
| if (typeof document === "undefined") return; | ||
| if (this.#isMounted || this.#isMounting) { | ||
| if (this.#state === "mounted" || this.#state === "mounting") { | ||
| throw new Error("Devtools is already mounted"); | ||
| } | ||
| this.#isMounting = true; | ||
| this.#abortMount = false; | ||
| this.#state = "mounting"; | ||
| const { signal } = this.#mountAbortController = new AbortController(); | ||
| import('./mount-impl/QJF6LBVF.js').then(({ mountDevtools }) => { | ||
| if (this.#abortMount) { | ||
| this.#isMounting = false; | ||
| if (signal.aborted) { | ||
| return; | ||
@@ -50,20 +48,15 @@ } | ||
| this.#eventBus = result.eventBus; | ||
| this.#isMounted = true; | ||
| this.#isMounting = false; | ||
| this.#state = "mounted"; | ||
| }).catch((err) => { | ||
| this.#isMounting = false; | ||
| this.#state = "unmounted"; | ||
| }); | ||
| } | ||
| unmount() { | ||
| if (!this.#isMounted && !this.#isMounting) { | ||
| if (this.#state === "unmounted") { | ||
| throw new Error("Devtools is not mounted"); | ||
| } | ||
| if (this.#isMounting) { | ||
| this.#abortMount = true; | ||
| this.#isMounting = false; | ||
| return; | ||
| } | ||
| this.#mountAbortController?.abort(); | ||
| this.#eventBus?.stop(); | ||
| this.#dispose?.(); | ||
| this.#isMounted = false; | ||
| this.#state = "unmounted"; | ||
| } | ||
@@ -77,3 +70,3 @@ setConfig(config) { | ||
| this.#plugins = config.plugins; | ||
| if (this.#isMounted && this.#setPlugins) { | ||
| if (this.#state === "mounted" && this.#setPlugins) { | ||
| this.#setPlugins(config.plugins); | ||
@@ -80,0 +73,0 @@ } |
+1
-1
| { | ||
| "name": "@tanstack/devtools", | ||
| "version": "0.11.1", | ||
| "version": "0.11.2", | ||
| "description": "TanStack Devtools is a set of tools for building advanced devtools for your application.", | ||
@@ -5,0 +5,0 @@ "author": "Tanner Linsley", |
+12
-19
@@ -43,5 +43,4 @@ import { initialState } from './context/devtools-store' | ||
| #plugins: Array<TanStackDevtoolsPlugin> = [] | ||
| #isMounted = false | ||
| #isMounting = false | ||
| #abortMount = false | ||
| #state: 'mounted' | 'mounting' | 'unmounted' = 'unmounted' | ||
| #mountAbortController?: AbortController | ||
| #dispose?: () => void | ||
@@ -64,12 +63,11 @@ #eventBus?: { stop: () => void } | ||
| if (this.#isMounted || this.#isMounting) { | ||
| if (this.#state === 'mounted' || this.#state === 'mounting') { | ||
| throw new Error('Devtools is already mounted') | ||
| } | ||
| this.#isMounting = true | ||
| this.#abortMount = false | ||
| this.#state = 'mounting' | ||
| const { signal } = (this.#mountAbortController = new AbortController()) | ||
| import('./mount-impl') | ||
| .then(({ mountDevtools }) => { | ||
| if (this.#abortMount) { | ||
| this.#isMounting = false | ||
| if (signal.aborted) { | ||
| return | ||
@@ -90,7 +88,6 @@ } | ||
| this.#eventBus = result.eventBus | ||
| this.#isMounted = true | ||
| this.#isMounting = false | ||
| this.#state = 'mounted' | ||
| }) | ||
| .catch((err) => { | ||
| this.#isMounting = false | ||
| this.#state = 'unmounted' | ||
| console.error('[TanStack Devtools] Failed to load:', err) | ||
@@ -101,13 +98,9 @@ }) | ||
| unmount() { | ||
| if (!this.#isMounted && !this.#isMounting) { | ||
| if (this.#state === 'unmounted') { | ||
| throw new Error('Devtools is not mounted') | ||
| } | ||
| if (this.#isMounting) { | ||
| this.#abortMount = true | ||
| this.#isMounting = false | ||
| return | ||
| } | ||
| this.#mountAbortController?.abort() | ||
| this.#eventBus?.stop() | ||
| this.#dispose?.() | ||
| this.#isMounted = false | ||
| this.#state = 'unmounted' | ||
| } | ||
@@ -123,3 +116,3 @@ | ||
| // Update the reactive store if mounted | ||
| if (this.#isMounted && this.#setPlugins) { | ||
| if (this.#state === 'mounted' && this.#setPlugins) { | ||
| this.#setPlugins(config.plugins) | ||
@@ -126,0 +119,0 @@ } |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
3
-25%655899
-0.04%16879
-0.17%