Skip to content

Commit

Permalink
feat: make accessing field properties faster and more stable
Browse files Browse the repository at this point in the history
* chore: WIP migration to derived state

* chore!: temporarily remove broken tests

* ci: apply automated fixes and generate docs

* chore: refactor derived state in FormApi to use Derived class

* ci: apply automated fixes and generate docs

* chore: fix build

* ci: apply automated fixes and generate docs

* Revert "chore: fix build"

This reverts commit 4087d87.

* ci: apply automated fixes and generate docs

* chore: migrate to form mount on every test

* chore: simplify complex tests

* ci: apply automated fixes and generate docs

* chore: refactor all derived state into `FormApi`, even field derived values

* ci: apply automated fixes and generate docs

* chore: fix build

* fix: only regenerate field.errors when field.errorMap has changed

* chore: fix tests

* ci: apply automated fixes and generate docs

* chore: add previously failing test

* chore: only recompute errors when prevDepVal is different

* ci: apply automated fixes and generate docs

* chore: WIP validate new Store API

* chore: fix issues with tests

* ci: apply automated fixes and generate docs

* chore: fix build

* ci: apply automated fixes and generate docs

* fix: all tests now pass in Form Core and React Form

* chore: bump Store to 0.7

* ci: apply automated fixes and generate docs

* chore: fix issues with Sherif, fix mount tests

* ci: apply automated fixes and generate docs

* test: add previously failing useStore test

* ci: apply automated fixes and generate docs

* chore: fix timing with Solid Form

* ci: apply automated fixes and generate docs

* chore: key rename and fix comment

* ci: apply automated fixes and generate docs

* chore: fix eslint

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
crutchcorn and autofix-ci[bot] authored Dec 29, 2024
1 parent d178f33 commit be7f9bf
Show file tree
Hide file tree
Showing 30 changed files with 1,084 additions and 890 deletions.
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/@tanstack+vue-store@0.7.0\_vue@3.5.12\_typescript@5.7.2\_/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\_vue@3.5.12\_typescript@5.7.2\_/node\_modules/@tanstack/vue-store/dist/esm/index.d.ts:8
node\_modules/.pnpm/@tanstack+vue-store@0.7.0\_vue@3.5.12\_typescript@5.7.2\_/node\_modules/@tanstack/vue-store/dist/esm/index.d.ts:9
Loading

0 comments on commit be7f9bf

Please sign in to comment.