diff --git a/.changeset/raise-dependency-floors.md b/.changeset/raise-dependency-floors.md new file mode 100644 index 0000000000..2d4bfb0003 --- /dev/null +++ b/.changeset/raise-dependency-floors.md @@ -0,0 +1,13 @@ +--- +'@tanstack/angular-table': patch +'@tanstack/angular-table-devtools': patch +'@tanstack/ember-table': patch +'@tanstack/preact-table-devtools': patch +'@tanstack/react-table-devtools': patch +'@tanstack/solid-table-devtools': patch +'@tanstack/svelte-table': patch +'@tanstack/table-devtools': patch +'@tanstack/vue-table-devtools': patch +--- + +Raise minimum versions of runtime dependencies: `@tanstack/devtools-utils` ^0.7.2, `@tanstack/devtools-ui` ^0.7.2, `@tanstack/svelte-store` ^0.12.3, `@embroider/addon-shim` ^1.11.0, `solid-js` ^1.9.19, and `tslib` ^2.9.1 diff --git a/AGENTS.md b/AGENTS.md index 796797e14b..abd59989c1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,36 +11,32 @@ that follows the repository template. ## Packages that cannot be upgraded yet -Leave these pins alone during routine dependency bumps. They currently break -Ember, the Svelte kitchen-sink types, or are intentionally deferred. +Leave these pins alone during routine dependency bumps. They are either +intentionally deferred or need a manual version choice that `ncu` gets wrong. - **TypeScript** — keep `6.0.3`. Do not bump it as part of a general upgrade. -- **Babel 7** — Ember is not compatible with Babel 8. In `packages/ember-table` - and every `examples/ember/*` app, keep `@babel/core`, - `@babel/plugin-transform-runtime`, `@babel/plugin-transform-typescript`, and - `@babel/runtime` at `7.29.7`. `@rollup/plugin-babel` `7.1.0` is the Rollup - plugin version, not Babel itself. -- **`@dnd-kit/abstract` and `@dnd-kit/helpers`** — keep `^0.2.3` in - `examples/svelte/kitchen-sink-shadcn`. `@dnd-kit-svelte/svelte@0.1.6` still - depends on the 0.2.x line. Bumping to 0.5.x installs a second copy, and - TypeScript treats those private-field types as incompatible. -- **Vitest and `@vitest/coverage-v8`** — keep the 4.x line (currently - `^4.1.11` and `4.1.11`). `@analogjs/vitest-angular@2.7.2` and Angular build - tooling do not support Vitest 5, which also removes the `vitest` `bench` export - used by the repository benchmarks. Upgrade these together in a separate migration. -- **Octane** — keep `0.1.36`. The 0.2.x line fails the adapter conformance - test for synchronous owner and isolated controlled updates during a discrete event. -- **Pacer devtools** — keep `@tanstack/react-pacer-devtools` at `0.8.0` and - `@tanstack/solid-pacer-devtools` at `0.7.0`. The 0.14.x packages do not export - `pacerDevtoolsPlugin`, which the Form and Router examples use. -- **`@tanstack/preact-form`** — keep `1.30.5` in the Preact Form example. - The 1.33.x line removes `createFormHookContexts` and `withForm`, requiring - a separate example migration. -- **Preact** — keep `^10.29.8`. Preact 11 fails the adapter's hook and SSR - tests and the devtools type check. The Store and Query adapters still require - Preact 10. Upgrade these together in a separate migration. +- **Highest semver is not the real latest.** `ncu` can pick a version that + outranks the package's `latest` dist-tag. Check `npm view dist-tags` + and take the newest release on the `latest` line that meets + `minimumReleaseAge`: + - `octane`: `1.0.3` is an unrelated 2015 release. Use the 0.x line. Octane + peers on an exact `@tsrx/oxc` version, so set `@tsrx/oxc` to that exact + version even when `ncu` offers a newer one. + - `@tanstack/react-pacer-devtools` and `@tanstack/solid-pacer-devtools`: + `0.14.0` is an old release that lacks the `pacerDevtoolsPlugin` export the + Form and Router examples use. + - `@tanstack/preact-form`: `1.33.x` sits above `latest` and removes + `createFormHookContexts` and `withForm`, which the Preact Form example uses. +- **Babel 8 peer warnings** — `@rollup/plugin-babel` and some transitive Babel 7 + plugins still declare `@babel/core@^7` peers. The Ember toolchain + (`@nullvoxpopuli/ember-vite`) supports Babel 8, and Ember builds and tests + pass on it, so these `pnpm peers check` warnings are expected. Do not pin + Babel back to 7 because of them. - **`@tanstack/intent`** — keep `0.4.0`. The 0.5 checker compiles TS and JS fences without framework TypeScript configuration or surrounding context. It rejects valid Preact and Lit examples, class-member excerpts, and deliberately - wrong examples. Keep the repository's content and annotated-snippet checks - enabled while this migration is deferred. + wrong examples. 0.5.6 still reports 64 such errors. 0.5 can skip a fence + with a `no-check` fence property or expect one with `expect-error`, but the + repository's snippet checker only accepts bare `ts`/`tsx` fences after a + `skill-snippet:check` marker. Keep the repository's content and + annotated-snippet checks enabled while this migration is deferred. diff --git a/docs/framework/alpine/guide/cell-selection.md b/docs/framework/alpine/guide/cell-selection.md index 2ada44ca5d..1a65e09c16 100644 --- a/docs/framework/alpine/guide/cell-selection.md +++ b/docs/framework/alpine/guide/cell-selection.md @@ -274,19 +274,43 @@ Cell selection ships no keyboard handling of its own. Instead it exposes imperat `direction` is `'up'`, `'down'`, `'left'`, or `'right'`. ```ts -import { createMultiHotkeyHandler } from '@tanstack/hotkeys' +import Alpine from 'alpinejs' +import { createHotkeysScope, hotkeysPlugin } from '@tanstack/alpine-hotkeys' + +Alpine.plugin(hotkeysPlugin) -// Alpine has no hotkeys adapter, so the framework-agnostic core handler is used -onGridKeyDown: createMultiHotkeyHandler({ - ArrowUp: () => table.moveCellSelection('up'), - ArrowDown: () => table.moveCellSelection('down'), - 'Shift+ArrowDown': () => table.extendCellSelection('down'), - 'Mod+A': () => table.selectAllCells(), - Escape: () => table.resetCellSelection(true), -}), +Alpine.data('table', () => { + // ...create the table + const hotkeys = createHotkeysScope() + + return { + init() { + hotkeys.createHotkeys( + [ + { hotkey: 'ArrowUp', callback: () => table.moveCellSelection('up') }, + { + hotkey: 'ArrowDown', + callback: () => table.moveCellSelection('down'), + }, + { + hotkey: 'Shift+ArrowDown', + callback: () => table.extendCellSelection('down'), + }, + { hotkey: 'Mod+A', callback: () => table.selectAllCells() }, + { hotkey: 'Escape', callback: () => table.resetCellSelection(true) }, + ], + // scope every binding to the grid element + () => ({ target: this.$refs.grid }), + ) + }, + destroy() { + hotkeys.destroy() + }, + } +}) // then, in the markup: -//
...
+//
...
``` Scope the hotkeys to the grid element rather than the document, or arrow keys and Escape will hijack inputs elsewhere on the page. diff --git a/docs/framework/ember/guide/cell-selection.md b/docs/framework/ember/guide/cell-selection.md index 1115a7992f..c0567988ee 100644 --- a/docs/framework/ember/guide/cell-selection.md +++ b/docs/framework/ember/guide/cell-selection.md @@ -254,19 +254,23 @@ Cell selection ships no keyboard handling of its own. Instead it exposes imperat `direction` is `'up'`, `'down'`, `'left'`, or `'right'`. ```ts -import { createMultiHotkeyHandler } from '@tanstack/hotkeys' - -// Ember has no hotkeys adapter, so the framework-agnostic core handler is used -onGridKeyDown = createMultiHotkeyHandler({ - ArrowUp: () => this.table.moveCellSelection('up'), - ArrowDown: () => this.table.moveCellSelection('down'), - 'Shift+ArrowDown': () => this.table.extendCellSelection('down'), - 'Mod+A': () => this.table.selectAllCells(), - Escape: () => this.table.resetCellSelection(true), -}) +import { onHotkeys } from '@tanstack/ember-hotkeys' +import type { EmberHotkeyDefinition } from '@tanstack/ember-hotkeys' + +// the onHotkeys modifier scopes every binding to the element it is on +gridHotkeys: Array = [ + { hotkey: 'ArrowUp', callback: () => this.table.moveCellSelection('up') }, + { hotkey: 'ArrowDown', callback: () => this.table.moveCellSelection('down') }, + { + hotkey: 'Shift+ArrowDown', + callback: () => this.table.extendCellSelection('down'), + }, + { hotkey: 'Mod+A', callback: () => this.table.selectAllCells() }, + { hotkey: 'Escape', callback: () => this.table.resetCellSelection(true) }, +] // then, in the template: -//
...
+//
...
``` Scope the hotkeys to the grid element rather than the document, or arrow keys and Escape will hijack inputs elsewhere on the page. diff --git a/docs/framework/lit/guide/cell-selection.md b/docs/framework/lit/guide/cell-selection.md index ca69647422..9443f231eb 100644 --- a/docs/framework/lit/guide/cell-selection.md +++ b/docs/framework/lit/guide/cell-selection.md @@ -254,19 +254,31 @@ Cell selection ships no keyboard handling of its own. Instead it exposes imperat `direction` is `'up'`, `'down'`, `'left'`, or `'right'`. ```ts -import { createMultiHotkeyHandler } from '@tanstack/lit-hotkeys' - -// one stateless handler is simpler here than a HotkeyController per binding -const onGridKeyDown = createMultiHotkeyHandler({ - ArrowUp: () => table.moveCellSelection('up'), - ArrowDown: () => table.moveCellSelection('down'), - 'Shift+ArrowDown': () => table.extendCellSelection('down'), - 'Mod+A': () => table.selectAllCells(), - Escape: () => table.resetCellSelection(true), -}) - -// then, in the template: -// html`
...
` +import { createRef, ref } from 'lit/directives/ref.js' +import { HotkeyController } from '@tanstack/lit-hotkeys' +import type { HotkeyChord } from '@tanstack/lit-hotkeys' + +// inside the element class: one HotkeyController per binding, each scoped to +// the grid element +private _grid = createRef() + +private _gridHotkeys = ( + [ + ['ArrowUp', () => this._table?.moveCellSelection('up')], + ['ArrowDown', () => this._table?.moveCellSelection('down')], + ['Shift+ArrowDown', () => this._table?.extendCellSelection('down')], + ['Mod+A', () => this._table?.selectAllCells()], + ['Escape', () => this._table?.resetCellSelection(true)], + ] satisfies Array<[HotkeyChord, () => void]> +).map( + ([hotkey, callback]) => + new HotkeyController(this, hotkey, callback, () => ({ + target: this._grid.value, + })), +) + +// then, in render(): +// html`
...
` ``` Scope the hotkeys to the grid element rather than the document, or arrow keys and Escape will hijack inputs elsewhere on the page. diff --git a/examples/alpine/aggregation/package.json b/examples/alpine/aggregation/package.json index 4ca22597ff..a97b78de39 100644 --- a/examples/alpine/aggregation/package.json +++ b/examples/alpine/aggregation/package.json @@ -14,13 +14,13 @@ "dependencies": { "@faker-js/faker": "^10.6.0", "@tanstack/alpine-table": "^9.3.1", - "alpinejs": "^3.17.4" + "alpinejs": "^3.17.5" }, "devDependencies": { - "@rolldown/binding-wasm32-wasi": "~1.2.12", + "@rolldown/binding-wasm32-wasi": "~1.3.2", "@rollup/plugin-replace": "^6.0.3", "@types/alpinejs": "^3.17.0", "typescript": "6.0.3", - "vite": "^8.3.2" + "vite": "^8.3.8" } } diff --git a/examples/alpine/basic-app-table/package.json b/examples/alpine/basic-app-table/package.json index 9304ce09e9..85db6056e5 100644 --- a/examples/alpine/basic-app-table/package.json +++ b/examples/alpine/basic-app-table/package.json @@ -13,13 +13,13 @@ }, "dependencies": { "@tanstack/alpine-table": "^9.3.1", - "alpinejs": "^3.17.4" + "alpinejs": "^3.17.5" }, "devDependencies": { - "@rolldown/binding-wasm32-wasi": "~1.2.12", + "@rolldown/binding-wasm32-wasi": "~1.3.2", "@rollup/plugin-replace": "^6.0.3", "@types/alpinejs": "^3.17.0", "typescript": "6.0.3", - "vite": "^8.3.2" + "vite": "^8.3.8" } } diff --git a/examples/alpine/basic-create-table/package.json b/examples/alpine/basic-create-table/package.json index bafba150fe..dfaf3b989a 100644 --- a/examples/alpine/basic-create-table/package.json +++ b/examples/alpine/basic-create-table/package.json @@ -14,13 +14,13 @@ "dependencies": { "@faker-js/faker": "^10.6.0", "@tanstack/alpine-table": "^9.3.1", - "alpinejs": "^3.17.4" + "alpinejs": "^3.17.5" }, "devDependencies": { - "@rolldown/binding-wasm32-wasi": "~1.2.12", + "@rolldown/binding-wasm32-wasi": "~1.3.2", "@rollup/plugin-replace": "^6.0.3", "@types/alpinejs": "^3.17.0", "typescript": "6.0.3", - "vite": "^8.3.2" + "vite": "^8.3.8" } } diff --git a/examples/alpine/basic-dynamic-columns/package.json b/examples/alpine/basic-dynamic-columns/package.json index 42e4651770..768ec21e7d 100644 --- a/examples/alpine/basic-dynamic-columns/package.json +++ b/examples/alpine/basic-dynamic-columns/package.json @@ -14,13 +14,13 @@ "dependencies": { "@faker-js/faker": "^10.6.0", "@tanstack/alpine-table": "^9.3.1", - "alpinejs": "^3.17.4" + "alpinejs": "^3.17.5" }, "devDependencies": { - "@rolldown/binding-wasm32-wasi": "~1.2.12", + "@rolldown/binding-wasm32-wasi": "~1.3.2", "@rollup/plugin-replace": "^6.0.3", "@types/alpinejs": "^3.17.0", "typescript": "6.0.3", - "vite": "^8.3.2" + "vite": "^8.3.8" } } diff --git a/examples/alpine/basic-external-atoms/package.json b/examples/alpine/basic-external-atoms/package.json index 232c52f696..a0c7f073ce 100644 --- a/examples/alpine/basic-external-atoms/package.json +++ b/examples/alpine/basic-external-atoms/package.json @@ -15,13 +15,13 @@ "@faker-js/faker": "^10.6.0", "@tanstack/alpine-table": "^9.3.1", "@tanstack/store": "^0.11.2", - "alpinejs": "^3.17.4" + "alpinejs": "^3.17.5" }, "devDependencies": { - "@rolldown/binding-wasm32-wasi": "~1.2.12", + "@rolldown/binding-wasm32-wasi": "~1.3.2", "@rollup/plugin-replace": "^6.0.3", "@types/alpinejs": "^3.17.0", "typescript": "6.0.3", - "vite": "^8.3.2" + "vite": "^8.3.8" } } diff --git a/examples/alpine/basic-external-state/package.json b/examples/alpine/basic-external-state/package.json index a647e7f4ca..0135e1e7ad 100644 --- a/examples/alpine/basic-external-state/package.json +++ b/examples/alpine/basic-external-state/package.json @@ -14,13 +14,13 @@ "dependencies": { "@faker-js/faker": "^10.6.0", "@tanstack/alpine-table": "^9.3.1", - "alpinejs": "^3.17.4" + "alpinejs": "^3.17.5" }, "devDependencies": { - "@rolldown/binding-wasm32-wasi": "~1.2.12", + "@rolldown/binding-wasm32-wasi": "~1.3.2", "@rollup/plugin-replace": "^6.0.3", "@types/alpinejs": "^3.17.0", "typescript": "6.0.3", - "vite": "^8.3.2" + "vite": "^8.3.8" } } diff --git a/examples/alpine/cell-selection/index.html b/examples/alpine/cell-selection/index.html index 2cd4ad0e2d..5941bb01d5 100644 --- a/examples/alpine/cell-selection/index.html +++ b/examples/alpine/cell-selection/index.html @@ -93,7 +93,7 @@ -->
-
+