@tanstack/devtools 0.10.1 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,10 +36,12 @@ var PiPProvider = (props) => {
36
36
  if (!pip) {
37
37
  throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");
38
38
  }
39
- import.meta.hot?.on("vite:beforeUpdate", () => {
40
- localStorage.setItem("pip_open", "false");
41
- closePipWindow();
42
- });
39
+ if (import.meta.hot && typeof import.meta.hot.on === "function") {
40
+ import.meta.hot.on("vite:beforeUpdate", () => {
41
+ localStorage.setItem("pip_open", "false");
42
+ closePipWindow();
43
+ });
44
+ }
43
45
  window.addEventListener("beforeunload", () => {
44
46
  localStorage.setItem("pip_open", "false");
45
47
  closePipWindow();
package/dist/dev.js CHANGED
@@ -1,5 +1,5 @@
1
- import { initialState, DevtoolsProvider, PiPProvider } from './chunk/YPBMQIC3.js';
2
- export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/YPBMQIC3.js';
1
+ import { initialState, DevtoolsProvider, PiPProvider } from './chunk/KKMMZ2TR.js';
2
+ export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/KKMMZ2TR.js';
3
3
  import { render, createComponent, Portal } from 'solid-js/web';
4
4
  import { lazy } from 'solid-js';
5
5
  import { ClientEventBus } from '@tanstack/devtools-event-bus/client';
@@ -30,7 +30,7 @@ var TanStackDevtoolsCore = class {
30
30
  const mountTo = el;
31
31
  const dispose = render(() => {
32
32
  const _self$ = this;
33
- this.#Component = lazy(() => import('./devtools/2YO4AD7X.js'));
33
+ this.#Component = lazy(() => import('./devtools/RZMDLR3T.js'));
34
34
  const Devtools = this.#Component;
35
35
  this.#eventBus = new ClientEventBus(this.#eventBusConfig);
36
36
  this.#eventBus.start();
@@ -1,4 +1,4 @@
1
- import { usePiPWindow, TANSTACK_DEVTOOLS, keyboardModifiers, getAllPermutations, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, MAX_ACTIVE_PLUGINS, uppercaseFirstLetter } from '../chunk/YPBMQIC3.js';
1
+ import { usePiPWindow, TANSTACK_DEVTOOLS, keyboardModifiers, getAllPermutations, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, MAX_ACTIVE_PLUGINS, uppercaseFirstLetter } from '../chunk/KKMMZ2TR.js';
2
2
  import { createComponent, Portal, ssr, ssrAttribute, escape, ssrStyle } from 'solid-js/web';
3
3
  import { createContext, createSignal, createEffect, onCleanup, Show, createMemo, For, useContext, onMount } from 'solid-js';
4
4
  import { createShortcut, useKeyDownList } from '@solid-primitives/keyboard';
@@ -3555,7 +3555,7 @@ var SourceInspector = () => {
3555
3555
  window.getSelection()?.removeAllRanges();
3556
3556
  e.preventDefault();
3557
3557
  e.stopPropagation();
3558
- const baseUrl = new URL(import.meta.env?.BASE_URL ?? "/", location.origin);
3558
+ const baseUrl = new URL(import.meta?.env?.BASE_URL ?? "/", location.origin);
3559
3559
  const url = new URL(`__tsd/open-source?source=${encodeURIComponent(highlightState.dataSource)}`, baseUrl);
3560
3560
  fetch(url).catch(() => {
3561
3561
  });
@@ -1,4 +1,4 @@
1
- import { usePiPWindow, TANSTACK_DEVTOOLS, keyboardModifiers, getAllPermutations, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, MAX_ACTIVE_PLUGINS, uppercaseFirstLetter } from '../chunk/YPBMQIC3.js';
1
+ import { usePiPWindow, TANSTACK_DEVTOOLS, keyboardModifiers, getAllPermutations, DevtoolsContext, PLUGIN_TITLE_CONTAINER_ID, PLUGIN_CONTAINER_ID, MAX_ACTIVE_PLUGINS, uppercaseFirstLetter } from '../chunk/KKMMZ2TR.js';
2
2
  import { delegateEvents, createComponent, Portal, template, use, setAttribute, insert, memo, effect, className, addEventListener, style, classList } from 'solid-js/web';
3
3
  import { createContext, createSignal, createEffect, onCleanup, Show, createMemo, For, useContext, onMount } from 'solid-js';
4
4
  import { createShortcut, useKeyDownList } from '@solid-primitives/keyboard';
@@ -4102,7 +4102,7 @@ var SourceInspector = () => {
4102
4102
  window.getSelection()?.removeAllRanges();
4103
4103
  e.preventDefault();
4104
4104
  e.stopPropagation();
4105
- const baseUrl = new URL(import.meta.env?.BASE_URL ?? "/", location.origin);
4105
+ const baseUrl = new URL(import.meta?.env?.BASE_URL ?? "/", location.origin);
4106
4106
  const url = new URL(`__tsd/open-source?source=${encodeURIComponent(highlightState.dataSource)}`, baseUrl);
4107
4107
  fetch(url).catch(() => {
4108
4108
  });
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { initialState, DevtoolsProvider, PiPProvider } from './chunk/YPBMQIC3.js';
2
- export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/YPBMQIC3.js';
1
+ import { initialState, DevtoolsProvider, PiPProvider } from './chunk/KKMMZ2TR.js';
2
+ export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/KKMMZ2TR.js';
3
3
  import { render, createComponent, Portal } from 'solid-js/web';
4
4
  import { lazy } from 'solid-js';
5
5
  import { ClientEventBus } from '@tanstack/devtools-event-bus/client';
@@ -30,7 +30,7 @@ var TanStackDevtoolsCore = class {
30
30
  const mountTo = el;
31
31
  const dispose = render(() => {
32
32
  const _self$ = this;
33
- this.#Component = lazy(() => import('./devtools/2YO4AD7X.js'));
33
+ this.#Component = lazy(() => import('./devtools/RZMDLR3T.js'));
34
34
  const Devtools = this.#Component;
35
35
  this.#eventBus = new ClientEventBus(this.#eventBusConfig);
36
36
  this.#eventBus.start();
package/dist/server.js CHANGED
@@ -1,5 +1,5 @@
1
- import { initialState } from './chunk/YPBMQIC3.js';
2
- export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/YPBMQIC3.js';
1
+ import { initialState } from './chunk/KKMMZ2TR.js';
2
+ export { PLUGIN_CONTAINER_ID, PLUGIN_TITLE_CONTAINER_ID } from './chunk/KKMMZ2TR.js';
3
3
  import 'solid-js/web';
4
4
  import 'solid-js';
5
5
  import '@tanstack/devtools-event-bus/client';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/devtools",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
4
4
  "description": "TanStack Devtools is a set of tools for building advanced devtools for your application.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -80,7 +80,7 @@ export const SourceInspector = () => {
80
80
  e.stopPropagation()
81
81
 
82
82
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
83
- const baseUrl = new URL(import.meta.env?.BASE_URL ?? '/', location.origin)
83
+ const baseUrl = new URL(import.meta?.env?.BASE_URL ?? '/', location.origin)
84
84
  const url = new URL(
85
85
  `__tsd/open-source?source=${encodeURIComponent(
86
86
  highlightState.dataSource,
@@ -55,10 +55,12 @@ export const PiPProvider = (props: PiPProviderProps) => {
55
55
  )
56
56
  }
57
57
 
58
- import.meta.hot?.on('vite:beforeUpdate', () => {
59
- localStorage.setItem('pip_open', 'false')
60
- closePipWindow()
61
- })
58
+ if (import.meta.hot && typeof import.meta.hot.on === 'function') {
59
+ import.meta.hot.on('vite:beforeUpdate', () => {
60
+ localStorage.setItem('pip_open', 'false')
61
+ closePipWindow()
62
+ })
63
+ }
62
64
  window.addEventListener('beforeunload', () => {
63
65
  localStorage.setItem('pip_open', 'false')
64
66
  closePipWindow()
package/src/core.tsx CHANGED
@@ -63,7 +63,9 @@ export class TanStackDevtoolsCore {
63
63
 
64
64
  mount<T extends HTMLElement>(el: T) {
65
65
  // tsup-preset-solid statically replaces this variable during build, which eliminates this code from server bundle
66
- if (import.meta.env.SSR) return
66
+ // can be run outside of vite so we ignore the rule
67
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
68
+ if (import.meta?.env?.SSR) return
67
69
 
68
70
  if (this.#isMounted) {
69
71
  throw new Error('Devtools is already mounted')