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

RVF v6 rewrite #369

Merged
merged 298 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
298 commits
Select commit Hold shift + click to select a range
eb20641
refactor: getFormProps instead of handleSubmit
airjp73 May 3, 2024
3bf8d84
feat: tap into reset event
airjp73 May 3, 2024
415ea7b
fix: consistent preventDefault
airjp73 May 3, 2024
b0426d9
test: todo for formNoValidate
airjp73 May 3, 2024
705b38d
refactor: don't make validationBehaviorConfig a state value
airjp73 May 3, 2024
9d7dda2
revert
airjp73 May 3, 2024
9728d5b
feat: copy/move getInputProp
airjp73 May 3, 2024
1193b21
ideas
airjp73 May 3, 2024
103249d
refactor: split array and field into separate files
airjp73 May 8, 2024
4c3f42d
feat: clear error if not should validate
airjp73 May 8, 2024
698a8dc
refactor: put getters in the store
airjp73 May 8, 2024
570a0b6
refactor: only clearError instead of setError
airjp73 May 9, 2024
e1db036
feat: add getInputProps and getControlProps
airjp73 May 9, 2024
a5027b2
feat: add refs to field output
airjp73 May 9, 2024
4f9eb2f
fix: test
airjp73 May 9, 2024
21e115b
feat: expand field helpers
airjp73 May 9, 2024
c75162d
fix: exports
airjp73 May 9, 2024
3105f10
fix: subscriptions be externalizing getters
airjp73 May 9, 2024
bb82a20
test: update uncontrolled test
airjp73 May 9, 2024
1528238
feat: improve checkbox support
airjp73 May 9, 2024
c7aef2f
test: radio
airjp73 May 9, 2024
b71f7eb
test: update more tests
airjp73 May 9, 2024
fbbe15a
feat: better isolation components and more tests
airjp73 May 9, 2024
e958471
fix: test
airjp73 May 9, 2024
5f1beb7
fix: uncontrolled initial values and field arrays
airjp73 May 9, 2024
15e5a05
test: update
airjp73 May 9, 2024
8cb09c8
clean: remove old ideas
airjp73 May 9, 2024
976ec2b
feat: add submitSource option
airjp73 May 9, 2024
985b1ab
feat: field array hook and validation behavior option
airjp73 May 9, 2024
aab25a0
test: todo
airjp73 May 9, 2024
2e11212
clean
airjp73 May 9, 2024
d962383
chore: update exports
airjp73 May 9, 2024
abce9b5
feat: context for useField
airjp73 May 9, 2024
50bc6a6
feat: context-able field array
airjp73 May 9, 2024
ff4fdf2
feat: validate helper on field
airjp73 May 9, 2024
52a47a3
feat: legacy useField impl
airjp73 May 9, 2024
2e77cc3
chore: organize and export
airjp73 May 9, 2024
0e6fabe
decision: don't port useFormContext
airjp73 May 9, 2024
4a15e12
chore: re-export everything from react package
airjp73 May 9, 2024
4403346
decision: don't port over the field hooks either
airjp73 May 9, 2024
1123373
refactor: rename onSubmit to handleSubmit
airjp73 May 10, 2024
0cb21c6
feat: ValidatedForm component
airjp73 May 10, 2024
b15bb10
test: todos
airjp73 May 10, 2024
589f283
test: getFormProps tests
airjp73 May 10, 2024
8652f96
clean: remove irrelevant todo tests
airjp73 May 10, 2024
ce78887
test: remove novalidate test
airjp73 May 10, 2024
80a7b1b
feat: keep submitsource up-to-date
airjp73 May 10, 2024
9a83555
feat: sync validationBehaviorConfig as it changes
airjp73 May 10, 2024
196adaa
chore: re-export
airjp73 May 10, 2024
2adf4c6
test: todo
airjp73 May 10, 2024
56bb0f8
wip: remix version of useRvf
airjp73 May 10, 2024
238b1f9
feat: pass the formData to DOM submit handlers to support remix submit
airjp73 May 10, 2024
9ecb665
fix: type errors and remix handleSubmit logic
airjp73 May 10, 2024
9ea5d10
feat: include submitter data
airjp73 May 10, 2024
96c1d22
feat: port over createValidator
airjp73 May 10, 2024
1f6f727
refactor: remove `with` from yup and zod folders
airjp73 May 10, 2024
ab36a9d
chore: rename yup and zod packages
airjp73 May 10, 2024
5ed3fc7
clean: remove bug repro for now
airjp73 May 10, 2024
ac2e341
feat: update deps to use @rvf/remix
airjp73 May 10, 2024
7ca98a6
chore: temporarily remove apps from workspaces
airjp73 May 10, 2024
6f60078
feat: update zod and yup packages
airjp73 May 10, 2024
54f6763
test: peer dep test
airjp73 May 10, 2024
a1a10a2
fix: type error
airjp73 May 10, 2024
b467ebd
chore: re-add apps to workspaces
airjp73 May 10, 2024
5002f2f
chore: set docs site to use publicly available versions of original RVF
airjp73 May 11, 2024
8e9bd2f
fix: regenerate lockfile
airjp73 May 11, 2024
c6ebab2
fix: bun for dev scripts
airjp73 May 11, 2024
871f203
feat: support scope method directly on rvf
airjp73 May 11, 2024
66dcc57
fix: add deps where necessary
airjp73 May 11, 2024
b18e6bb
fix: use Ref instead of RefCallback
airjp73 May 11, 2024
09dbdba
chore: update form components
airjp73 May 11, 2024
a374fa6
feat: add remix version of ValidatedForm
airjp73 May 11, 2024
b4be590
feat: add dummy impls for server helpers
airjp73 May 11, 2024
875143f
feat: support optional default values
airjp73 May 11, 2024
8f4ec03
fix: add missing deps
airjp73 May 11, 2024
a32cc14
clean: remove old remix-validated-form package
airjp73 May 11, 2024
0c1e04f
chore: regenerate lockfile
airjp73 May 11, 2024
33cafc1
test: todos
airjp73 May 11, 2024
52949b2
feat: also support dot syntax for arrays
airjp73 May 13, 2024
6fac9e6
Revert "feat: also support dot syntax for arrays"
airjp73 May 13, 2024
bc15f4f
feat: be more permissive with the type when defaultValues omitted
airjp73 May 14, 2024
dfe32e2
test: add a test for checkbox groups setValue
airjp73 May 14, 2024
924b9fd
refactor: allow multiple refs per field
airjp73 May 14, 2024
fa9a7ed
feat: properly set the value of transient checkboxes and radios
airjp73 May 14, 2024
ed355c2
refactor: use setFormControlValue
airjp73 May 14, 2024
0d3bc85
test: todo
airjp73 May 16, 2024
d655a0f
feat: some automatic form handling
airjp73 May 16, 2024
c279df2
refactor: move autoform stuff to the actual form props
airjp73 May 16, 2024
eac4088
clean
airjp73 May 16, 2024
a56bdce
test: validating auto-form
airjp73 May 16, 2024
3bb66fa
feat: report validity natively when a field is not registered
airjp73 May 16, 2024
48ad786
wip: converting test-app
airjp73 May 16, 2024
f50740d
todo: notes from wip-test-app-conversion
airjp73 May 16, 2024
4422a13
feat: add action
airjp73 May 17, 2024
dec17ea
feat: more getters
airjp73 May 17, 2024
92d174c
fix: ref type in getInputProps
airjp73 May 17, 2024
447c0d7
feat: add name to field and fieldArray (and add some doc comments)
airjp73 May 17, 2024
a7dedca
feat: provide form id via getInputProps
airjp73 May 17, 2024
7824613
feat: ensure fields connect to the form element when used outside a form
airjp73 May 17, 2024
22b9519
fix: missing types
airjp73 May 17, 2024
b50d85b
todos: move todo to a fast-follow
airjp73 May 17, 2024
b6c7f56
feat: disableNativeValidation and disableFocusOnError options
airjp73 May 17, 2024
ecd2d6f
todo: add todo tests
airjp73 May 17, 2024
7ee4b94
feat: add core support for server errors
airjp73 May 17, 2024
5e30708
todos
airjp73 May 17, 2024
a1bee79
todo
airjp73 May 17, 2024
2fbe4f2
feat: remix client-server hooks
airjp73 May 17, 2024
8be8d14
feat: component versions of Field and FieldArray
airjp73 May 17, 2024
a28c3ee
chore: convert many field array tests
airjp73 May 17, 2024
558834e
feat: scope handleSubmit based on subaction
airjp73 May 17, 2024
b889d4e
fix: move subaction type logic into remix
airjp73 May 17, 2024
caece13
feat: resetAfterSubmit
airjp73 May 17, 2024
a3be6d6
chore: convert the rest
airjp73 May 17, 2024
dfa040f
fix: use type exports
airjp73 May 17, 2024
595e1b8
fix: correct remaining type errors
airjp73 May 17, 2024
7ab5863
fix: typecheck
airjp73 May 17, 2024
4d310d8
fix: deps spaghetti
airjp73 May 17, 2024
1136cc6
clean: remove duplicate Field component
airjp73 May 18, 2024
02ba743
fix: get rid of import.meta errors
airjp73 May 18, 2024
cb3f31c
fix: incorrect import & build isues
airjp73 May 18, 2024
744369e
fix: dynamic require issue
airjp73 May 18, 2024
7dac1dd
fix: dynamic require of "react" is not supported
airjp73 May 18, 2024
7b5b7d3
fix: first round of test failure errors
airjp73 May 18, 2024
65e96d9
todos
airjp73 May 18, 2024
962e20d
feat: remove disableNativeValidation (and the native validation featu…
airjp73 May 19, 2024
9dc16cb
fix; array length issue
airjp73 May 19, 2024
e1389a0
todo: remove todo for native validation
airjp73 May 20, 2024
566284e
todos
airjp73 May 20, 2024
42751ff
refactor: use `useSyncExternalStore` for the hydrated check
airjp73 May 21, 2024
0fe488b
fix: revert default valdidationBehaviorConfig to what it was before
airjp73 May 21, 2024
8d60e16
todo
airjp73 May 21, 2024
72ead84
fix: crash in test
airjp73 May 21, 2024
e770384
fix: missing options in remix hook
airjp73 May 21, 2024
a0cf438
todo
airjp73 May 21, 2024
51bddbc
feat: export a helper to support server hooks in hook mode
airjp73 May 21, 2024
ad19f91
feat: migrate base react package to default to dom mode
airjp73 May 22, 2024
6cb6f8c
fix: exclude built tets
airjp73 May 22, 2024
97bf84a
todo: remove todo
airjp73 May 22, 2024
9aeee77
todo: prioritize
airjp73 May 22, 2024
fa4f981
todo
airjp73 May 22, 2024
7f7dc20
test: update route to render internal form id
airjp73 May 22, 2024
6a59c42
fix: controlled field tests
airjp73 May 23, 2024
c1787fc
fix: default values tests
airjp73 May 23, 2024
eef3dba
fix: validation external
airjp73 May 23, 2024
9107ecb
todo
airjp73 May 23, 2024
db409b1
fix: hole in field-array logic
airjp73 May 23, 2024
a756020
todo
airjp73 May 23, 2024
8a0c4b3
fix: some incorrect nested field array logic
airjp73 May 23, 2024
2a53dcf
fix: clean up inconsistencies by switching fully to computed index no…
airjp73 May 23, 2024
86f474e
fix: more field array issues
airjp73 May 23, 2024
b7e382e
test: expand store-level array tests and fix issue
airjp73 May 24, 2024
dc38bb7
test: fix field-array test
airjp73 May 24, 2024
46973c1
test: add a check for file inputs
airjp73 May 24, 2024
3773e1f
fix: array update operation issues
airjp73 May 28, 2024
fcf5cb4
todo
airjp73 May 28, 2024
5144a6a
fix: ensure array operations that don't modify length, also update
airjp73 May 28, 2024
295949d
wip: field-array integ test improvements
airjp73 May 28, 2024
9c15375
feat: implement a smart validate
airjp73 May 28, 2024
8f4db63
feat: capture "ref" to hidden input elements
airjp73 May 28, 2024
8bb9f60
feat: handle controlled field validation in dom mode
airjp73 May 28, 2024
c179552
feat: default controlled fields to serialize as a string
airjp73 May 28, 2024
5dc2b21
refactor: directly inject values in for unknown controlled fields
airjp73 May 29, 2024
2eec208
fix: correctly stub in values again
airjp73 May 29, 2024
453bf4c
test: add failing test for validation logic inconsistencies
airjp73 May 29, 2024
2a2fed4
fix: test assertion
airjp73 May 29, 2024
3c8ce6c
fix: controlled field & array validations by awaiting updates in dom …
airjp73 May 29, 2024
6b53dda
test: add failing test for form event changes
airjp73 May 29, 2024
c34af03
refactor: move global-ish form event into core and get failing test p…
airjp73 May 30, 2024
2734819
refactor: manually construct Response so we don't depend on server co…
airjp73 May 30, 2024
ad95b64
test: add unit tests to the remix package
airjp73 May 30, 2024
a9bcd8b
feat: add helper to convert data into a path object
airjp73 May 31, 2024
5e24c38
feat: flesh out remix submission
airjp73 May 31, 2024
5fcd379
fix: remove unused import
airjp73 Jun 2, 2024
bbcc1c3
feat: add test and fix
airjp73 Jun 2, 2024
6fbc77b
test: another test for selects
airjp73 Jun 2, 2024
c8beaaa
chore: migrate test-app to remix v2 + vite
airjp73 Jun 3, 2024
27b70df
fix: types
airjp73 Jun 3, 2024
14ffbdd
fix: cypress issue
airjp73 Jun 3, 2024
93d5c63
fix: all remaining field-arry tests
airjp73 Jun 3, 2024
bf1cac5
todo: todos
airjp73 Jun 3, 2024
686822e
fix: rename index routes
airjp73 Jun 3, 2024
5410d31
fix: some file input weirdness
airjp73 Jun 4, 2024
85cb2f5
clean: imports
airjp73 Jun 4, 2024
5acca96
fix: crash on file inputs
airjp73 Jun 4, 2024
dc1a69f
fix: include formId in the validator output again
airjp73 Jun 4, 2024
5053e62
test: make render count test more strict 🎉
airjp73 Jun 4, 2024
abe2d9f
todos
airjp73 Jun 4, 2024
f2c4508
fix: issues in e2e tests
airjp73 Jun 4, 2024
85a0cfc
clean: remove test
airjp73 Jun 4, 2024
9474790
fix: more e2e tests
airjp73 Jun 4, 2024
fba25e8
todo: add todo test
airjp73 Jun 4, 2024
d1553a9
feat: submitter improvements
airjp73 Jun 5, 2024
06ee221
fix: form action issue
airjp73 Jun 5, 2024
72ee023
todo
airjp73 Jun 5, 2024
a6fd348
todo
airjp73 Jun 5, 2024
d7a564e
test: fetcher test
airjp73 Jun 6, 2024
b0ae0e1
tests
airjp73 Jun 6, 2024
90bd645
fix: index route
airjp73 Jun 6, 2024
7ce1b63
fix: only use submitter formAction if it's explicitly set
airjp73 Jun 6, 2024
425cc0f
fix: submission tests
airjp73 Jun 6, 2024
44c17f2
feat: initial impl for success/failure callbacks
airjp73 Jun 6, 2024
a650e22
fix: add missing generic
airjp73 Jun 6, 2024
0a8b06c
fix: type issue
airjp73 Jun 7, 2024
bf3efc4
clean: remove log
airjp73 Jun 7, 2024
ca822a3
feat: implement callbacks on remix side
airjp73 Jun 7, 2024
d9ae533
feat: port over to component
airjp73 Jun 7, 2024
74793bc
chore: params
airjp73 Jun 7, 2024
4206bd0
feat: move resetAfterSubmit to react package
airjp73 Jun 8, 2024
56ab9fb
fix: test
airjp73 Jun 8, 2024
19fab10
feat: type changes on remix side
airjp73 Jun 8, 2024
a3c822b
fix: some tests
airjp73 Jun 8, 2024
302b926
test: unit tests for radio focus behavior
airjp73 Jun 8, 2024
0316e3c
fix: update test to break
airjp73 Jun 8, 2024
1eaa68b
fix: correct focus-on-error logic surrounding radios
airjp73 Jun 8, 2024
8c2c47c
fix: multiple e2e tests
airjp73 Jun 8, 2024
c908d11
fix: disableFocusOnError causing submission
airjp73 Jun 8, 2024
1292d0a
fix: forward remix form props onto the form element
airjp73 Jun 8, 2024
5fd3125
chore: document breaking change
airjp73 Jun 8, 2024
a462176
fix: test-app routing
airjp73 Jun 8, 2024
28f61ef
fix: repopulateFields
airjp73 Jun 8, 2024
f8d79e8
refactor: rely on validateField's builtin behavior instead of getting…
airjp73 Jun 8, 2024
9e1d5dd
feat: focus first invalid field when errors come from server
airjp73 Jun 8, 2024
25e329a
fix: validation e2e tests
airjp73 Jun 8, 2024
357d1e3
feat: call onSubmitFailure when server errors are returned
airjp73 Jun 8, 2024
24798f2
fix: use default values from server response
airjp73 Jun 8, 2024
5cc488e
chore: update workflow
airjp73 Jun 8, 2024
8597f6d
fix: type errors
airjp73 Jun 8, 2024
a74fb34
chore: update bug report template
airjp73 Jun 8, 2024
d3f0aa4
chore: updating todos
airjp73 Jun 8, 2024
e08b8e1
fix: build, then typecheck
airjp73 Jun 8, 2024
1ab8a2b
fix: withResolvers polyfill
airjp73 Jun 8, 2024
cd1119e
fix: use node 20
airjp73 Jun 8, 2024
c8cdb58
feat: reload document option
airjp73 Jun 8, 2024
b99b0ca
fix: use npm to run dev
airjp73 Jun 8, 2024
2fd435a
fix: accidental import
airjp73 Jun 8, 2024
c8dd442
fix: type error
airjp73 Jun 8, 2024
b15e23d
fix: use `sort` instead of `toSorted` for compat
airjp73 Jun 8, 2024
46a07f0
fix: use id prop
airjp73 Jun 8, 2024
113b1c2
fix: use a ponyfill for withResolvers
airjp73 Jun 8, 2024
89b0d71
fix?: run tests directly instead of using cypress action
airjp73 Jun 8, 2024
6718edc
fix?: only run test-app tests
airjp73 Jun 8, 2024
5958bac
fix: isolate docs site from the rest of the monorepo
airjp73 Jun 8, 2024
2a6c53d
revert: use gh action for cypress again
airjp73 Jun 8, 2024
b79d374
feat: try a new cypress workflow
airjp73 Jun 9, 2024
a99c2fc
Merge pull request #367 from airjp73/announcement
airjp73 Apr 30, 2024
14065e1
fix: remove extra command
airjp73 Jun 9, 2024
3554c77
fix: setup bun
airjp73 Jun 9, 2024
4ba281d
fix?: try this again
airjp73 Jun 9, 2024
06fe006
fix: run cypress tests against prod build
airjp73 Jun 9, 2024
a9ef919
refactor: move cypress fixes back over to main workflow file
airjp73 Jun 9, 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
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

49 changes: 0 additions & 49 deletions .eslintrc.js

This file was deleted.

14 changes: 8 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ body:
attributes:
label: Which packages are impacted?
options:
- label: "`remix-validated-form`"
- label: "`@remix-validated-form/with-zod`"
- label: "`@remix-validated-form/with-yup`"
- label: "`@rvf/react`"
- label: "`@rvf/remix`"
- label: "`@rvf/zod`"
- label: "`@rvf/yup`"
- label: "`zod-form-data`"
- type: textarea
attributes:
label: What version of these packages are you using?
placeholder: |
- `remix-validated-form`: ^0.0.0
- `@remix-validated-form/with-zod`: ^0.0.0
- `@remix-validated-form/with-yup`: ^0.0.0
- `@rvf/react`: ^0.0.0
- `@rvf/remix`: ^0.0.0
- `@rvf/zod`: ^0.0.0
- `@rvf/yup`: ^0.0.0
- `zod-form-data`: ^0.0.0
validations:
required: true
Expand Down
51 changes: 35 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,49 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
- uses: oven-sh/setup-bun@v1
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"

- name: Install Deps
run: yarn install --frozen-lockfile
run: bun install

- name: Lint
run: yarn run lint

- name: Typecheck
run: yarn run typecheck
run: bun run lint

- name: Build
run: yarn run build
run: bun run build

- name: Vitest
run: yarn run vitest:run
- name: Typecheck
run: bun run typecheck

- name: Cypress Tests
uses: cypress-io/github-action@v2
- name: Vitest
run: bun run vitest:run

- name: Verify Cypress
env:
CI: 1
run: |
bunx cypress verify
bunx cypress info
bunx cypress version
bunx cypress version --component package
bunx cypress version --component binary
bunx cypress version --component electron
bunx cypress version --component node

- name: Cypress tests
run: |
cd apps/test-app
bun run test
env:
TERM: xterm

# Save screenshots as test artifacts
# https://github.com/actions/upload-artifact
- uses: actions/upload-artifact@v4
if: failure()
with:
working-directory: ./apps/test-app
start: yarn dev
wait-on: http://localhost:3000
name: screenshots
path: cypress/screenshots
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ dist
stats.html
.idea
apps/docs/api/index.js
apps/docs/api/index.js.map
apps/docs/api/index.js.map
metafile.*.json
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ npm install remix-validated-form
There are official adapters available for `zod` and `yup`.
If you're using a different library, see the [Validation library support](#validation-library-support) section below.

- @remix-validated-form/with-zod
- @remix-validated-form/with-yup
- @rvf/zod
- @rvf/yup

```bash
npm install @remix-validated-form/with-zod
npm install @rvf/zod
```

If you're using zod, you might also find `zod-form-data` helpful.
Expand All @@ -59,7 +59,7 @@ If you're using zod, you might also find `zod-form-data` helpful.
In order to display field errors or do field-by-field validation, it's recommended to incorporate this library into an input component using `useField`.

```tsx
import { useField } from "remix-validated-form";
import { useField } from "@rvf/remix";

type MyInputProps = {
name: string;
Expand All @@ -83,7 +83,7 @@ export const MyInput = ({ name, label }: MyInputProps) => {
To best take advantage of the per-form submission detection, we can create a submit button component.

```tsx
import { useFormContext, useIsSubmitting } from "remix-validated-form";
import { useFormContext, useIsSubmitting } from "@rvf/remix";

export const MySubmitButton = () => {
const isSubmitting = useIsSubmitting();
Expand All @@ -110,7 +110,7 @@ Now that we have our components, making a form is easy.
import { DataFunctionArgs, json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import * as yup from "yup";
import { validationError, ValidatedForm, withYup } from "remix-validated-form";
import { validationError, ValidatedForm, withYup } from "@rvf/remix";
import { MyInput, MySubmitButton } from "~/components/Input";

// Using yup in this example, but you can use anything
Expand All @@ -119,7 +119,7 @@ const validator = withYup(
firstName: yup.string().label("First Name").required(),
lastName: yup.string().label("Last Name").required(),
email: yup.string().email().label("Email").required(),
})
}),
);

export const action = async ({ request }: DataFunctionArgs) => {
Expand Down Expand Up @@ -209,7 +209,7 @@ type Validator<DataType> = {
validate: (unvalidatedData: unknown) => ValidationResult<DataType>;
validateField: (
unvalidatedData: unknown,
field: string
field: string,
) => ValidateFieldResult;
};
```
Expand All @@ -224,7 +224,7 @@ The out-of-the-box support for `yup` in this library works as the following:

```ts
export const withYup = <Schema extends AnyObjectSchema>(
validationSchema: Schema
validationSchema: Schema,
// For best result with Typescript, we should type the `Validator` we return based on the provided schema
): Validator<InferType<Schema>> =>
createValidator({
Expand Down
16 changes: 16 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- Consider adding a `beforeSubmit` callback

// follows

- Globally setting some settings with a context or something.
- turn on hydrateRoot to test that mode

- Add a new bug repro template

- Maybe add a `validatePlainObject` method to `createValidator` to be more efficient

# Some breaking change notes

- Unmounting controlled fields no longer clears the value.
- `defaultValues` configured via `"path.fields"` no longer works. The default values object should be in the expected shape.
- `validate` helper returns an object of errors instead of a validation result.
6 changes: 0 additions & 6 deletions apps/bug-repro/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions apps/bug-repro/app/entry.client.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions apps/bug-repro/app/entry.server.tsx

This file was deleted.

32 changes: 0 additions & 32 deletions apps/bug-repro/app/root.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions apps/bug-repro/app/routes/index.tsx

This file was deleted.

36 changes: 0 additions & 36 deletions apps/bug-repro/package.json

This file was deleted.

Binary file removed apps/bug-repro/public/favicon.ico
Binary file not shown.
11 changes: 0 additions & 11 deletions apps/bug-repro/remix.config.js

This file was deleted.

Loading
Loading