Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 14 additions & 5 deletions .github/workflows/check-skills.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ on:
- '**/skills/**'
- '_artifacts/**'
- '**/_artifacts/**'
- 'scripts/sync-skill-versions.mjs'
- 'scripts/typecheck-skill-snippets.mjs'
- 'scripts/validate-skill-content.mjs'
- 'package.json'
- 'pnpm-lock.yaml'
- '.github/workflows/check-skills.yml'
workflow_dispatch: {}

permissions:
Expand All @@ -34,10 +40,13 @@ jobs:
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
node-version: 22.13.0

- name: Install intent
run: npm install -g @tanstack/intent
- name: Install pnpm
run: npm install --global "$(node -p 'require("./package.json").packageManager')"

- name: Validate skills
run: intent validate --github-summary
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate skills and examples
run: pnpm test:skills
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,18 @@ jobs:
git switch -c "$branch"
git push --set-upstream origin "$branch"
echo "branch=$branch" >> "$GITHUB_OUTPUT"
- name: Publish
- name: Prepare package versions
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
env -u CI pnpm run cipublish
pnpm run skills:versions:fix
pnpm run skills:versions:check
env:
BRANCH: ${{ github.ref_name }}
TAG: ${{ inputs.tag }}
- name: Publish
run: |
pnpm run cipublish
env:
BRANCH: ${{ github.ref_name }}
Expand Down
8,433 changes: 1,447 additions & 6,986 deletions _artifacts/domain_map.yaml

Large diffs are not rendered by default.

672 changes: 0 additions & 672 deletions _artifacts/scratch/cluster-a-foundational.yaml

This file was deleted.

1,188 changes: 0 additions & 1,188 deletions _artifacts/scratch/cluster-b-row-model-features.yaml

This file was deleted.

1,110 changes: 0 additions & 1,110 deletions _artifacts/scratch/cluster-c-ui-state-features.yaml

This file was deleted.

990 changes: 0 additions & 990 deletions _artifacts/scratch/cluster-d-framework-adapters.yaml

This file was deleted.

1,396 changes: 0 additions & 1,396 deletions _artifacts/scratch/cluster-e-lifecycle-composition.yaml

This file was deleted.

1,173 changes: 0 additions & 1,173 deletions _artifacts/scratch/cluster-f-issues-failure-modes.yaml

This file was deleted.

555 changes: 361 additions & 194 deletions _artifacts/skill_spec.md

Large diffs are not rendered by default.

2,572 changes: 1,014 additions & 1,558 deletions _artifacts/skill_tree.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/framework/alpine/guide/column-resizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ column.getCanResize()
column.getIsResizing()
```

The table instance exposes APIs for the transient resize state. Note that the current v9 API spelling is `table.setcolumnResizing` with a lowercase `c` in `column`; use that exact name.
The table instance exposes APIs for the transient resize state through `table.setColumnResizing`.

```ts
table.setcolumnResizing((old) => ({
table.setColumnResizing((old) => ({
...old,
deltaOffset: 12,
}))
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/angular/guide/column-resizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ column.getCanResize()
column.getIsResizing()
```

The table instance exposes APIs for the transient resize state. The current generated v9 API spelling is `table.setcolumnResizing` with a lowercase `c` in `column`; use that exact name.
The table instance exposes APIs for the transient resize state through `table.setColumnResizing`.

```ts
table.setcolumnResizing((old) => ({
table.setColumnResizing((old) => ({
...old,
deltaOffset: 12,
}))
Expand Down
12 changes: 6 additions & 6 deletions docs/framework/angular/guide/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -719,12 +719,12 @@ All internal APIs prefixed with `_` have been removed. If you were using any of

In v8, column sizing and resizing were combined in a single feature. In v9, they've been split into separate features for better tree-shaking.

| v8 | v9 |
| --------------------------------- | ----------------------------------------------------------------------- |
| `ColumnSizing` (combined feature) | `columnSizingFeature` + `columnResizingFeature` |
| `columnSizingInfo` state | `columnResizing` state |
| `setColumnSizingInfo()` | `setcolumnResizing()` (note the lowercase `c`, the current v9 spelling) |
| `onColumnSizingInfoChange` option | `onColumnResizingChange` option |
| v8 | v9 |
| --------------------------------- | ----------------------------------------------- |
| `ColumnSizing` (combined feature) | `columnSizingFeature` + `columnResizingFeature` |
| `columnSizingInfo` state | `columnResizing` state |
| `setColumnSizingInfo()` | `setColumnResizing()` |
| `onColumnSizingInfoChange` option | `onColumnResizingChange` option |

If you only need column sizing (fixed widths) without interactive resizing, you can import just `columnSizingFeature`. If you need drag-to-resize functionality, import both.

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/lit/guide/column-resizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ column.getCanResize()
column.getIsResizing()
```

The table instance exposes APIs for the transient resize state. Note that the current v9 API spelling is `table.setcolumnResizing` with a lowercase `c` in `column`; use that exact name.
The table instance exposes APIs for the transient resize state through `table.setColumnResizing`.

```ts
table.setcolumnResizing((old) => ({
table.setColumnResizing((old) => ({
...old,
deltaOffset: 12,
}))
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/preact/guide/column-resizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ column.getCanResize()
column.getIsResizing()
```

The table instance exposes APIs for the transient resize state. Note that the current v9 API spelling is `table.setcolumnResizing` with a lowercase `c` in `column`; use that exact name.
The table instance exposes APIs for the transient resize state through `table.setColumnResizing`.

```tsx
table.setcolumnResizing((old) => ({
table.setColumnResizing((old) => ({
...old,
deltaOffset: 12,
}))
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/react/guide/column-resizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ column.getCanResize()
column.getIsResizing()
```

The table instance exposes APIs for the transient resize state. Note that the current v9 API spelling is `table.setcolumnResizing` with a lowercase `c` in `column`; use that exact name.
The table instance exposes APIs for the transient resize state through `table.setColumnResizing`.

```tsx
table.setcolumnResizing((old) => ({
table.setColumnResizing((old) => ({
...old,
deltaOffset: 12,
}))
Expand Down
12 changes: 6 additions & 6 deletions docs/framework/react/guide/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -874,12 +874,12 @@ All internal APIs prefixed with `_` have been removed. If you were using any of

In Table V8, column sizing and resizing were combined in a single feature. In Table V9, they've been split into separate features for better tree-shaking.

| Table V8 | Table V9 |
| --------------------------------- | ----------------------------------------------------------------------------- |
| `ColumnSizing` (combined feature) | `columnSizingFeature` + `columnResizingFeature` |
| `columnSizingInfo` state | `columnResizing` state |
| `setColumnSizingInfo()` | `setcolumnResizing()` (note the lowercase `c`, the current Table V9 spelling) |
| `onColumnSizingInfoChange` option | `onColumnResizingChange` option |
| Table V8 | Table V9 |
| --------------------------------- | ----------------------------------------------- |
| `ColumnSizing` (combined feature) | `columnSizingFeature` + `columnResizingFeature` |
| `columnSizingInfo` state | `columnResizing` state |
| `setColumnSizingInfo()` | `setColumnResizing()` |
| `onColumnSizingInfoChange` option | `onColumnResizingChange` option |

If you only need column sizing (fixed widths) without interactive resizing, you can import just `columnSizingFeature`. If you need drag-to-resize functionality, import both:

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/solid/guide/column-resizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ column.getCanResize()
column.getIsResizing()
```

The table instance exposes APIs for the transient resize state. Note that the current v9 API spelling is `table.setcolumnResizing` with a lowercase `c` in `column`; use that exact name.
The table instance exposes APIs for the transient resize state through `table.setColumnResizing`.

```tsx
table.setcolumnResizing((old) => ({
table.setColumnResizing((old) => ({
...old,
deltaOffset: 12,
}))
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/solid/guide/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ const features = tableFeatures({
})
```

`columnSizingInfo` became `columnResizing`, and `onColumnSizingInfoChange` became `onColumnResizingChange`. The `setColumnSizingInfo()` API became `setcolumnResizing()` (note the lowercase `c`, the current v9 spelling).
`columnSizingInfo` became `columnResizing`, and `onColumnSizingInfoChange` became `onColumnResizingChange`. The `setColumnSizingInfo()` API became `setColumnResizing()`.

### Sorting API Renames

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/svelte/guide/column-resizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ column.getCanResize()
column.getIsResizing()
```

The table instance exposes APIs for the transient resize state. Note that the current v9 API spelling is `table.setcolumnResizing` with a lowercase `c` in `column`; use that exact name.
The table instance exposes APIs for the transient resize state through `table.setColumnResizing`.

```ts
table.setcolumnResizing((old) => ({
table.setColumnResizing((old) => ({
...old,
deltaOffset: 12,
}))
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/vue/guide/column-resizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ column.getCanResize()
column.getIsResizing()
```

The table instance exposes APIs for the transient resize state. Note that the current v9 API spelling is `table.setcolumnResizing` with a lowercase `c` in `column`; use that exact name.
The table instance exposes APIs for the transient resize state through `table.setColumnResizing`.

```ts
table.setcolumnResizing((old) => ({
table.setColumnResizing((old) => ({
...old,
deltaOffset: 12,
}))
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/vue/guide/migrating.md
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ const features = tableFeatures({
})
```

`columnSizingInfo` became `columnResizing`, `setColumnSizingInfo()` became `setcolumnResizing()` (note the lowercase `c`, the current v9 spelling), and `onColumnSizingInfoChange` became `onColumnResizingChange`.
`columnSizingInfo` became `columnResizing`, `setColumnSizingInfo()` became `setColumnResizing()`, and `onColumnSizingInfoChange` became `onColumnResizingChange`.

### Sorting API Renames

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@
"test:e2e:install": "playwright install chromium",
"test:eslint": "nx affected --target=test:eslint",
"test:intent": "intent validate && intent stale",
"test:skill-content": "node scripts/validate-skill-content.mjs",
"test:skill-snippets": "node scripts/typecheck-skill-snippets.mjs",
"test:skills": "intent validate && pnpm skills:versions:check && pnpm test:skill-content && pnpm test:skill-snippets",
"test:knip": "NODE_OPTIONS='--max-old-space-size=4096' knip",
"test:lib": "nx affected --targets=test:lib",
"test:lib:dev": "pnpm test:lib && nx watch --all -- pnpm test:lib",
"test:pr": "nx affected --targets=test:eslint,test:sherif,test:knip,test:lib,test:types,test:build,build",
"test:sherif": "sherif",
"test:types": "nx affected --targets=test:types",
"skills:versions:check": "node scripts/sync-skill-versions.mjs",
"skills:versions:fix": "node scripts/sync-skill-versions.mjs --write",
"watch": "pnpm run build:all && nx watch --all -- pnpm run build:all"
},
"nx": {
Expand Down
6 changes: 4 additions & 2 deletions packages/alpine-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"alpine",
"table",
"alpine-table",
"datagrid"
"datagrid",
"tanstack-intent"
],
"type": "module",
"types": "./dist/index.d.cts",
Expand Down Expand Up @@ -49,7 +50,8 @@
},
"files": [
"dist",
"src"
"src",
"skills"
],
"scripts": {
"clean": "rimraf ./build && rimraf ./dist",
Expand Down
98 changes: 98 additions & 0 deletions packages/alpine-table/skills/create-table-hook/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
name: create-table-hook
description: >
Share Alpine tableFeatures, defaults, createAppTable, and createAppColumnHelper with createTableHook. Load when multiple Alpine tables repeat infrastructure; unlike JSX adapters, Alpine has no registered table/cell/header component or context registry.
metadata:
type: framework
library: '@tanstack/alpine-table'
framework: alpine
library_version: '9.0.0-beta.38'
requires:
- '@tanstack/table-core#core'
- getting-started
- table-state
sources:
- 'TanStack/table:docs/framework/alpine/guide/composable-tables.md'
- 'TanStack/table:examples/alpine/basic-app-table'
- 'TanStack/table:packages/alpine-table/src/createTableHook.ts'
---

This skill builds on @tanstack/table-core#core plus this package's getting-started and table-state skills.

## Setup

```ts
import Alpine from 'alpinejs'
import { createTableHook, tableFeatures } from '@tanstack/alpine-table'

type Person = { id: string; name: string }
const { createAppTable, createAppColumnHelper } = createTableHook({
features: tableFeatures({}),
getRowId: (row: Person) => row.id,
})
const helper = createAppColumnHelper<Person>()
const columns = helper.columns([helper.accessor('name', { header: 'Name' })])

Alpine.data('peopleTable', () => {
const local = Alpine.reactive({
data: [{ id: '1', name: 'Ada' }] as Array<Person>,
})
const table = createAppTable({
columns,
get data() {
return local.data
},
})
return { table }
})
```

## Core Patterns

### Share infrastructure, keep data local

Bind features, row models, row IDs, and defaults in the factory. Each Alpine component passes its own columns, reactive data getter, and controlled state.

### Reuse markup with Alpine primitives

Use real templates and `Alpine.bind` bundles for interactive reuse. `createTableHook` intentionally returns no component registry or context hooks.

### Use the helper to retain feature inference

Columns from `createAppColumnHelper<TData>()` know the factory's registered features without userland feature generics.

## Common Mistakes

### HIGH Assuming a JSX component registry

Wrong: pass `cellComponents` or `tableComponents` to Alpine `createTableHook`.

Correct: share features/defaults with the hook and build reusable interactive markup with Alpine templates or bind bundles.

The Alpine hook returns only app features, a column helper, and createAppTable.

Source: TanStack/table:packages/alpine-table/src/createTableHook.ts

### MEDIUM Abstracting a one-off table

Wrong: introduce an app factory for one table with no shared conventions.

Correct: use standalone `createTable` until infrastructure repeats.

The hook is an application reuse boundary, not required setup.

Source: TanStack/table:docs/framework/alpine/guide/composable-tables.md

### HIGH Reactive data captured as a snapshot

Wrong: `createAppTable({ columns, data: local.data })` when the array will be replaced.

Correct: provide a `get data()` option.

The app factory delegates to Alpine createTable, whose option effect tracks getters.

Source: TanStack/table:packages/alpine-table/src/createTable.ts

## API Discovery

Inspect `node_modules/@tanstack/alpine-table/src/createTableHook.ts`; do not infer component/context APIs from React, Vue, Solid, Svelte, Angular, or Lit adapters.
Loading
Loading