Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/react/start-basic-react-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
"start": "vite start"
},
"dependencies": {
"@tanstack/devtools-vite": "^0.3.3",
"@tanstack/react-devtools": "^0.7.0",
"@tanstack/react-query": "^5.66.0",
"@tanstack/react-query-devtools": "^5.66.0",
"@tanstack/react-router": "^1.132.7",
"@tanstack/react-router-ssr-query": "^1.132.7",
"@tanstack/react-router-devtools": "^1.132.7",
"@tanstack/react-start": "^1.132.9",
"@tanstack/react-start-devtools": "0.0.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
Expand All @@ -25,11 +28,11 @@
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"vite": "^7.1.1",
"vite-tsconfig-paths": "^5.1.4"
}
}
}
18 changes: 17 additions & 1 deletion examples/react/start-basic-react-query/src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
createRootRouteWithContext,
} from '@tanstack/react-router'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
import { TanStackRouterDevtools, TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
import * as React from 'react'
import { TanStackDevtools } from '@tanstack/react-devtools'
import { StartDevtoolsPanel } from '@tanstack/react-start-devtools'
import type { QueryClient } from '@tanstack/react-query'
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
import { NotFound } from '~/components/NotFound'
Expand Down Expand Up @@ -136,6 +138,20 @@ function RootDocument({ children }: { children: React.ReactNode }) {
</div>
<hr />
{children}
<TanStackDevtools plugins={[
{
name: 'React Query',
render: () => <TanStackRouterDevtoolsPanel />
},
{
name: 'React Router',
render: () => <TanStackRouterDevtoolsPanel />
},
{
name: "Start",
render: () => <StartDevtoolsPanel />
}
]} />
<TanStackRouterDevtools position="bottom-right" />
<ReactQueryDevtools buttonPosition="bottom-left" />
<Scripts />
Expand Down
2 changes: 2 additions & 0 deletions examples/react/start-basic-react-query/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import { defineConfig } from 'vite'
import tsConfigPaths from 'vite-tsconfig-paths'
import viteReact from '@vitejs/plugin-react'
import { devtools } from '@tanstack/devtools-vite'

export default defineConfig({
server: {
port: 3000,
},
plugins: [
devtools(),
tsConfigPaths({
projects: ['./tsconfig.json'],
}),
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"@eslint-react/eslint-plugin": "^1.26.2",
"@playwright/test": "^1.52.0",
"@tanstack/config": "^0.16.1",
"@tanstack/react-query": "5.66.0",
"@tanstack/query-core": "5.66.0",
"@tanstack/react-query": "5.66.0",
"@types/node": "^22.10.2",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
Expand Down Expand Up @@ -104,6 +104,9 @@
"@tanstack/solid-start-client": "workspace:*",
"@tanstack/solid-start-server": "workspace:*",
"@tanstack/start-plugin-core": "workspace:*",
"@tanstack/start-devtools": "workspace:*",
"@tanstack/react-start-devtools": "workspace:*",
"@tanstack/solid-start-devtools": "workspace:*",
"@tanstack/start-client-core": "workspace:*",
"@tanstack/start-server-core": "workspace:*",
"@tanstack/start-storage-context": "workspace:*",
Expand All @@ -115,4 +118,4 @@
"@tanstack/nitro-v2-vite-plugin": "workspace:*"
}
}
}
}
32 changes: 32 additions & 0 deletions packages/react-start-devtools/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// @ts-check

import pluginReact from '@eslint-react/eslint-plugin'
import pluginReactCompiler from 'eslint-plugin-react-compiler'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import rootConfig from '../../eslint.config.js'

export default [
...rootConfig,
{
files: ['**/*.{ts,tsx}'],
...pluginReact.configs.recommended,
},
{
plugins: {
'react-hooks': pluginReactHooks,
'react-compiler': pluginReactCompiler,
},
rules: {
'@eslint-react/dom/no-missing-button-type': 'off',
'react-compiler/react-compiler': 'error',
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
},
},
{
files: ['**/__tests__/**'],
rules: {
// 'react-compiler/react-compiler': 'off',
},
},
]
70 changes: 70 additions & 0 deletions packages/react-start-devtools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "@tanstack/react-start-devtools",
"version": "0.0.1",
"description": "React adapter for devtools for Start.",
"author": "Tanner Linsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/TanStack/router.git",
"directory": "packages/react-start-devtools"
},
"homepage": "https://tanstack.com/start",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [],
"type": "module",
"types": "dist/esm/index.d.ts",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./production": {
"import": {
"types": "./dist/esm/production.d.ts",
"default": "./dist/esm/production.js"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"engines": {
"node": ">=18"
},
"files": [
"dist/",
"src"
],
"scripts": {
"clean": "rimraf ./build ./dist",
"lint:fix": "eslint ./src --fix",
"test:eslint": "eslint ./src",
"test:lib": "vitest",
"test:lib:dev": "pnpm test:lib --watch",
"test:types": "tsc",
"test:build": "publint --strict",
"build": "vite build"
},
"peerDependencies": {
"@types/react": ">=16.8",
"@types/react-dom": ">=16.8",
"react": ">=16.8",
"react-dom": ">=16.8"
},
"dependencies": {
"@tanstack/devtools-utils": "^0.0.3",
"@tanstack/start-devtools": "workspace:*"
},
"devDependencies": {
"@eslint-react/eslint-plugin": "^1.53.1",
"@vitejs/plugin-react": "^5.0.2",
"eslint-plugin-react-compiler": "19.1.0-rc.2",
"eslint-plugin-react-hooks": "^5.2.0"
}
}
10 changes: 10 additions & 0 deletions packages/react-start-devtools/src/ReactStartDevtools.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

import { createReactPanel } from '@tanstack/devtools-utils/react'
import { StartDevtoolsCore } from "@tanstack/start-devtools"
import type { DevtoolsPanelProps } from '@tanstack/devtools-utils/react';

export interface StartDevtoolsReactInit extends DevtoolsPanelProps { }

const [StartDevtoolsPanel, StartDevtoolsPanelNoOp] = createReactPanel(StartDevtoolsCore)

export { StartDevtoolsPanel, StartDevtoolsPanelNoOp }
16 changes: 16 additions & 0 deletions packages/react-start-devtools/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use client'

import * as Devtools from './ReactStartDevtools'
import * as plugin from './plugin'

export const StartDevtoolsPanel =
process.env.NODE_ENV !== 'development'
? Devtools.StartDevtoolsPanelNoOp
: Devtools.StartDevtoolsPanel

export const startDevtoolsPlugin =
process.env.NODE_ENV !== 'development'
? plugin.startDevtoolsNoOpPlugin
: plugin.startDevtoolsPlugin

export type { StartDevtoolsReactInit } from './ReactStartDevtools'
6 changes: 6 additions & 0 deletions packages/react-start-devtools/src/plugin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createReactPlugin } from '@tanstack/devtools-utils/react'
import { StartDevtoolsPanel } from './ReactStartDevtools'

const [startDevtoolsPlugin, startDevtoolsNoOpPlugin] = createReactPlugin("TanStack Start", StartDevtoolsPanel)

export { startDevtoolsPlugin, startDevtoolsNoOpPlugin }
7 changes: 7 additions & 0 deletions packages/react-start-devtools/src/production.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use client'

export { StartDevtoolsPanel } from './ReactStartDevtools'

export type { StartDevtoolsReactInit } from './ReactStartDevtools'

export { startDevtoolsPlugin } from './plugin'
7 changes: 7 additions & 0 deletions packages/react-start-devtools/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expect, it } from 'vitest'

describe('test suite', () => {
it('should work', () => {
expect(true).toBe(true)
})
})
1 change: 1 addition & 0 deletions packages/react-start-devtools/tests/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom/vitest'
4 changes: 4 additions & 0 deletions packages/react-start-devtools/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["tests", "src"]
}
7 changes: 7 additions & 0 deletions packages/react-start-devtools/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "eslint.config.js", "vite.config.ts", "tests"],
"compilerOptions": {
"jsx": "react"
}
}
25 changes: 25 additions & 0 deletions packages/react-start-devtools/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { defineConfig, mergeConfig } from 'vitest/config'
import { tanstackViteConfig } from '@tanstack/config/vite'
import react from '@vitejs/plugin-react'
import packageJson from './package.json'

const config = defineConfig({
plugins: [react()],
test: {
name: packageJson.name,
dir: './',
watch: false,
environment: 'jsdom',
setupFiles: ['./tests/test-setup.ts'],
globals: true,
},
})

export default mergeConfig(
config,
tanstackViteConfig({
entry: ['./src/index.ts', './src/production.ts'],
srcDir: './src',
cjs: false,
}),
)
10 changes: 10 additions & 0 deletions packages/solid-start-devtools/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// @ts-check

import rootConfig from '../../eslint.config.js'

export default [
...rootConfig,
{
rules: {},
},
]
64 changes: 64 additions & 0 deletions packages/solid-start-devtools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "@tanstack/solid-start-devtools",
"version": "0.0.1",
"description": "Solid adapter for devtools for Start.",
"author": "Tanner Linsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/TanStack/router.git",
"directory": "packages/solid-start-devtools"
},
"homepage": "https://tanstack.com/start",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"keywords": [],
"type": "module",
"types": "dist/esm/index.d.ts",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./production": {
"import": {
"types": "./dist/esm/production.d.ts",
"default": "./dist/esm/production.js"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"engines": {
"node": ">=18"
},
"files": [
"dist/",
"src"
],
"scripts": {
"clean": "rimraf ./build ./dist",
"lint:fix": "eslint ./src --fix",
"test:eslint": "eslint ./src",
"test:lib": "vitest",
"test:lib:dev": "pnpm test:lib --watch",
"test:types": "tsc",
"test:build": "publint --strict",
"build": "vite build"
},
"peerDependencies": {
"solid-js": ">=1.9.7"
},
"dependencies": {
"@tanstack/devtools-utils": "^0.0.3",
"@tanstack/start-devtools": "workspace:*"
},
Comment on lines +58 to +60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Use workspace protocol for internal utils dependency.

@tanstack/devtools-utils is an in-repo package, so it needs the workspace:* specifier to keep local builds in sync and honor the monorepo policy.

-    "@tanstack/devtools-utils": "^0.0.3",
+    "@tanstack/devtools-utils": "workspace:*",

As per coding guidelines

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@tanstack/devtools-utils": "^0.0.3",
"@tanstack/start-devtools": "workspace:*"
},
"@tanstack/devtools-utils": "workspace:*",
"@tanstack/start-devtools": "workspace:*"
},
🤖 Prompt for AI Agents
In packages/solid-start-devtools/package.json around lines 58 to 60, the
dependency "@tanstack/devtools-utils" is pinned to a version string instead of
using the workspace protocol; change its specifier to "workspace:*" (same as
"@tanstack/start-devtools") so the local in-repo package is referenced via
workspace and local builds remain in sync with monorepo policy.

"devDependencies": {
"vite-plugin-solid": "^2.11.8"
}
}
10 changes: 10 additions & 0 deletions packages/solid-start-devtools/src/SolidStartDevtools.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

import { createSolidPanel } from "@tanstack/devtools-utils/solid"
import { StartDevtoolsCore } from "@tanstack/start-devtools"
import type { DevtoolsPanelProps } from "@tanstack/devtools-utils/solid";

const [StartDevtoolsPanel, StartDevtoolsPanelNoOp] = createSolidPanel(StartDevtoolsCore)
export interface StartDevtoolsSolidInit extends DevtoolsPanelProps {
}

export { StartDevtoolsPanel, StartDevtoolsPanelNoOp }
Loading