Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TanStack Store Internals Refactor #1038

Merged
merged 43 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fd0218a
chore: WIP migration to derived state
crutchcorn Nov 25, 2024
efe7a00
chore!: temporarily remove broken tests
crutchcorn Nov 25, 2024
ad24e57
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
9dbd2c0
chore: refactor derived state in FormApi to use Derived class
crutchcorn Nov 25, 2024
310ece4
Merge branch 'derived-state-refactor' of https://github.com/TanStack/…
crutchcorn Nov 25, 2024
b3fc11c
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
4087d87
chore: fix build
crutchcorn Nov 25, 2024
9ca8a8b
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
052bf52
Revert "chore: fix build"
crutchcorn Nov 25, 2024
cd9a21a
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
677874d
chore: migrate to form mount on every test
crutchcorn Nov 25, 2024
bc64ef5
chore: simplify complex tests
crutchcorn Nov 25, 2024
0f6b6d6
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
31434d2
chore: refactor all derived state into `FormApi`, even field derived …
crutchcorn Nov 25, 2024
b53251d
Merge branch 'derived-state-refactor' of https://github.com/TanStack/…
crutchcorn Nov 25, 2024
4d72f93
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 25, 2024
e03d16f
Merge branch 'main' into derived-state-refactor
crutchcorn Nov 29, 2024
e2eea23
chore: fix build
crutchcorn Nov 29, 2024
4e74c86
fix: only regenerate field.errors when field.errorMap has changed
crutchcorn Nov 29, 2024
643197a
chore: fix tests
crutchcorn Nov 29, 2024
ee4b98c
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 29, 2024
3f4f40f
chore: add previously failing test
crutchcorn Nov 29, 2024
b79d343
chore: only recompute errors when prevDepVal is different
crutchcorn Nov 29, 2024
27f6acc
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 29, 2024
8f820e0
chore: WIP validate new Store API
crutchcorn Nov 29, 2024
a3eccf2
chore: fix issues with tests
crutchcorn Nov 30, 2024
06d0a65
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 30, 2024
1be22f3
chore: fix build
crutchcorn Nov 30, 2024
ebdc29e
ci: apply automated fixes and generate docs
autofix-ci[bot] Nov 30, 2024
1f6f01e
fix: all tests now pass in Form Core and React Form
crutchcorn Dec 26, 2024
4ce1db7
chore: bump Store to 0.7
crutchcorn Dec 26, 2024
bad44a9
Merge branch 'main' into derived-state-refactor
crutchcorn Dec 26, 2024
f9901bf
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 26, 2024
bf1bc79
chore: fix issues with Sherif, fix mount tests
crutchcorn Dec 27, 2024
695c7ba
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 27, 2024
fe64566
test: add previously failing useStore test
crutchcorn Dec 28, 2024
b4cbe58
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 28, 2024
fd9ae4c
chore: fix timing with Solid Form
crutchcorn Dec 29, 2024
94d922f
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 29, 2024
c01b8a4
chore: key rename and fix comment
crutchcorn Dec 29, 2024
937951b
Merge branch 'derived-state-refactor' of https://github.com/TanStack/…
crutchcorn Dec 29, 2024
bc3aaca
ci: apply automated fixes and generate docs
autofix-ci[bot] Dec 29, 2024
1c360a6
chore: fix eslint
crutchcorn Dec 29, 2024
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
50 changes: 40 additions & 10 deletions docs/framework/react/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,62 @@ title: useStore

# Function: useStore()

## Call Signature

```ts
function useStore<TState, TSelected, TUpdater>(store, selector?): TSelected
function useStore<TState, TSelected>(store, selector?): TSelected
```

## Type Parameters
### Type Parameters

**TState**

**TSelected** = `NoInfer`\<`TState`\>

**TUpdater** *extends* `AnyUpdater` = `AnyUpdater`
### Parameters

#### store

`Store`\<`TState`, `any`\>

#### selector?

(`state`) => `TSelected`

### Returns

`TSelected`

### Defined in

node\_modules/.pnpm/@tanstack+react-store@0.7.0\_react-dom@18.3.1\_react@18.3.1\_\_react@18.3.1/node\_modules/@tanstack/react-store/dist/esm/index.d.ts:7

## Call Signature

```ts
function useStore<TState, TSelected>(store, selector?): TSelected
```

### Type Parameters

**TState**

**TSelected** = `NoInfer`\<`TState`\>

## Parameters
### Parameters

### store
#### store

`Store`\<`TState`, `TUpdater`\>
`Derived`\<`TState`, `any`\>

### selector?
#### selector?

(`state`) => `TSelected`

## Returns
### Returns

`TSelected`

## Defined in
### Defined in

node\_modules/.pnpm/@tanstack+react-store@0.6.1\_react-dom@18.3.1\_react@18.3.1\_\_react@18.3.1/node\_modules/@tanstack/react-store/dist/esm/index.d.ts:7
node\_modules/.pnpm/@tanstack+react-store@0.7.0\_react-dom@18.3.1\_react@18.3.1\_\_react@18.3.1/node\_modules/@tanstack/react-store/dist/esm/index.d.ts:8
2 changes: 1 addition & 1 deletion docs/framework/solid/reference/functions/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ function Field<TParentData, TName, TFieldValidator, TFormValidator, TData>(props

## Defined in

[packages/solid-form/src/createField.tsx:185](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L185)
[packages/solid-form/src/createField.tsx:196](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L196)
50 changes: 40 additions & 10 deletions docs/framework/solid/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,62 @@ title: useStore

# Function: useStore()

## Call Signature

```ts
function useStore<TState, TSelected, TUpdater>(store, selector?): Accessor<TSelected>
function useStore<TState, TSelected>(store, selector?): Accessor<TSelected>
```

## Type Parameters
### Type Parameters

**TState**

**TSelected** = `NoInfer`\<`TState`\>

**TUpdater** *extends* `AnyUpdater` = `AnyUpdater`
### Parameters

#### store

`Store`\<`TState`, `any`\>

#### selector?

(`state`) => `TSelected`

### Returns

`Accessor`\<`TSelected`\>

### Defined in

node\_modules/.pnpm/@tanstack+solid-store@0.7.0\_solid-js@1.9.3/node\_modules/@tanstack/solid-store/dist/esm/index.d.ts:8

## Call Signature

```ts
function useStore<TState, TSelected>(store, selector?): Accessor<TSelected>
```

### Type Parameters

**TState**

**TSelected** = `NoInfer`\<`TState`\>

## Parameters
### Parameters

### store
#### store

`Store`\<`TState`, `TUpdater`\>
`Derived`\<`TState`, `any`\>

### selector?
#### selector?

(`state`) => `TSelected`

## Returns
### Returns

`Accessor`\<`TSelected`\>

## Defined in
### Defined in

node\_modules/.pnpm/@tanstack+solid-store@0.6.0\_solid-js@1.9.3/node\_modules/@tanstack/solid-store/dist/esm/index.d.ts:8
node\_modules/.pnpm/@tanstack+solid-store@0.7.0\_solid-js@1.9.3/node\_modules/@tanstack/solid-store/dist/esm/index.d.ts:9
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ type FieldComponent<TParentData, TFormValidator>: <TName, TFieldValidator, TData

## Defined in

[packages/solid-form/src/createField.tsx:160](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L160)
[packages/solid-form/src/createField.tsx:171](https://github.com/TanStack/form/blob/main/packages/solid-form/src/createField.tsx#L171)
50 changes: 40 additions & 10 deletions docs/framework/vue/reference/functions/usestore.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,62 @@ title: useStore

# Function: useStore()

## Call Signature

```ts
function useStore<TState, TSelected, TUpdater>(store, selector?): Readonly<Ref<TSelected>>
function useStore<TState, TSelected>(store, selector?): Readonly<Ref<TSelected>>
```

## Type Parameters
### Type Parameters

• **TState**

• **TSelected** = `NoInfer`\<`TState`\>

• **TUpdater** *extends* `AnyUpdater` = `AnyUpdater`
### Parameters

#### store

`Store`\<`TState`, `any`\>

#### selector?

(`state`) => `TSelected`

### Returns

`Readonly`\<`Ref`\<`TSelected`\>\>

### Defined in

node\_modules/.pnpm/@[email protected]\[email protected]\[email protected]\_/node\_modules/@tanstack/vue-store/dist/esm/index.d.ts:8

## Call Signature

```ts
function useStore<TState, TSelected>(store, selector?): Readonly<Ref<TSelected>>
```

### Type Parameters

• **TState**

• **TSelected** = `NoInfer`\<`TState`\>

## Parameters
### Parameters

### store
#### store

`Store`\<`TState`, `TUpdater`\>
`Derived`\<`TState`, `any`\>

### selector?
#### selector?

(`state`) => `TSelected`

## Returns
### Returns

`Readonly`\<`Ref`\<`TSelected`\>\>

## Defined in
### Defined in

node\_modules/.pnpm/@tanstack+vue-store@0.6.0\[email protected]\[email protected]\_/node\_modules/@tanstack/vue-store/dist/esm/index.d.ts:8
node\_modules/.pnpm/@tanstack+vue-store@0.7.0\[email protected]\[email protected]\_/node\_modules/@tanstack/vue-store/dist/esm/index.d.ts:9
Loading
Loading