diff --git a/.changeset/great-mayflies-shake.md b/.changeset/great-mayflies-shake.md deleted file mode 100644 index 66f7eaa..0000000 --- a/.changeset/great-mayflies-shake.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'@formspree/react': minor -'@formspree/core': minor ---- - -# Fix types in @formspree/core - -## `@formspree/core` - -- fix `SubmissionData` has a type of `any` causing everything after it to opt-out typechecking -- remove a no-op `teardown` method on `Client` and `Session` -- remove `utils.now` and use `Date.now` instead -- remove unused functions from `utils` module: `append`, `toCamel`, `camelizeTopKeys` -- add tests for `utils.appendExtraData` and convert the test file to typescript -- add tests for `session.data()` -- no longer export `Session` type - -## `@formspree/react` - -- update types as a result of `SubmissionData` is no longer `any` -- fix `createPaymentMethod` does not properly map payload when the submission data is a type of `FormData` -- fix the `Client` is not updated when project changes diff --git a/.changeset/orange-otters-teach.md b/.changeset/orange-otters-teach.md deleted file mode 100644 index 697b853..0000000 --- a/.changeset/orange-otters-teach.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@formspree/core': major -'@formspree/react': minor ---- - -## Improve error handling - -- `@formspree/core` `submitForm` function now will never rejects but always produces a type of `SubmissionResult`, different types of the result can be refined/narrowed down using the field `kind`. -- Provide `SubmissionErrorResult` which can be used to get an array of form errors and/or field errors (by field name) -- `Response` is no longer made available on the submission result -- Update `@formspree/react` for the changes introduced to `@formspree/core` diff --git a/.changeset/thirty-ladybugs-bow.md b/.changeset/thirty-ladybugs-bow.md deleted file mode 100644 index 17eda04..0000000 --- a/.changeset/thirty-ladybugs-bow.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'@formspree/core': major -'@formspree/react': minor ---- - -`@formspree/core` - -- rename client config `stripePromise` to `stripe` since it expects the resolved Stripe client not a promise - -`@formspree/react` - -- add a new hook: `useSubmit` which is suitable with code that uses other ways to manage submission state (e.g. with a library like react-hook-form) -- update `useForm` to use `useSubmit` under the hood -- fix: `FormspreeContext` updates the client when `props.project` change diff --git a/packages/formspree-core/CHANGELOG.md b/packages/formspree-core/CHANGELOG.md index 8ebb07f..d8503f6 100644 --- a/packages/formspree-core/CHANGELOG.md +++ b/packages/formspree-core/CHANGELOG.md @@ -1,5 +1,46 @@ # Changelog +## 3.0.0 + +### Major Changes + +- 49730d9: ## Improve error handling + + - `@formspree/core` `submitForm` function now will never rejects but always produces a type of `SubmissionResult`, different types of the result can be refined/narrowed down using the field `kind`. + - Provide `SubmissionErrorResult` which can be used to get an array of form errors and/or field errors (by field name) + - `Response` is no longer made available on the submission result + - Update `@formspree/react` for the changes introduced to `@formspree/core` + +- d025831: `@formspree/core` + + - rename client config `stripePromise` to `stripe` since it expects the resolved Stripe client not a promise + + `@formspree/react` + + - add a new hook: `useSubmit` which is suitable with code that uses other ways to manage submission state (e.g. with a library like react-hook-form) + - update `useForm` to use `useSubmit` under the hood + - fix: `FormspreeContext` updates the client when `props.project` change + +### Minor Changes + +- 4c40e1b: # Fix types in @formspree/core + + ## `@formspree/core` + + - fix `SubmissionData` has a type of `any` causing everything after it to opt-out typechecking + - remove a no-op `teardown` method on `Client` and `Session` + - remove `utils.now` and use `Date.now` instead + - remove unused functions from `utils` module: `append`, `toCamel`, `camelizeTopKeys` + - add tests for `utils.appendExtraData` and convert the test file to typescript + - add tests for `session.data()` + - no longer export `Session` type + + ## `@formspree/react` + + - update types as a result of `SubmissionData` is no longer `any` + - fix `createPaymentMethod` does not properly map payload when the submission data is a type of `FormData` + - fix the `Client` is not updated when project changes + ## 2.8.3 ### Patch Changes diff --git a/packages/formspree-core/package.json b/packages/formspree-core/package.json index b39bf65..03e86a1 100644 --- a/packages/formspree-core/package.json +++ b/packages/formspree-core/package.json @@ -1,6 +1,6 @@ { "name": "@formspree/core", - "version": "2.8.3", + "version": "3.0.0", "private": false, "description": "The core library for Formspree", "homepage": "https://formspree.io", diff --git a/packages/formspree-react/CHANGELOG.md b/packages/formspree-react/CHANGELOG.md index 39ad0d6..54a2aba 100644 --- a/packages/formspree-react/CHANGELOG.md +++ b/packages/formspree-react/CHANGELOG.md @@ -1,5 +1,51 @@ # Changelog +## 2.5.0 + +### Minor Changes + +- 4c40e1b: # Fix types in @formspree/core + + ## `@formspree/core` + + - fix `SubmissionData` has a type of `any` causing everything after it to opt-out typechecking + - remove a no-op `teardown` method on `Client` and `Session` + - remove `utils.now` and use `Date.now` instead + - remove unused functions from `utils` module: `append`, `toCamel`, `camelizeTopKeys` + - add tests for `utils.appendExtraData` and convert the test file to typescript + - add tests for `session.data()` + - no longer export `Session` type + + ## `@formspree/react` + + - update types as a result of `SubmissionData` is no longer `any` + - fix `createPaymentMethod` does not properly map payload when the submission data is a type of `FormData` + - fix the `Client` is not updated when project changes + +- 49730d9: ## Improve error handling + + - `@formspree/core` `submitForm` function now will never rejects but always produces a type of `SubmissionResult`, different types of the result can be refined/narrowed down using the field `kind`. + - Provide `SubmissionErrorResult` which can be used to get an array of form errors and/or field errors (by field name) + - `Response` is no longer made available on the submission result + - Update `@formspree/react` for the changes introduced to `@formspree/core` + +- d025831: `@formspree/core` + + - rename client config `stripePromise` to `stripe` since it expects the resolved Stripe client not a promise + + `@formspree/react` + + - add a new hook: `useSubmit` which is suitable with code that uses other ways to manage submission state (e.g. with a library like react-hook-form) + - update `useForm` to use `useSubmit` under the hood + - fix: `FormspreeContext` updates the client when `props.project` change + +### Patch Changes + +- Updated dependencies [4c40e1b] +- Updated dependencies [49730d9] +- Updated dependencies [d025831] + - @formspree/core@3.0.0 + ## 2.4.4 ### Patch Changes diff --git a/packages/formspree-react/package.json b/packages/formspree-react/package.json index 3ebb3eb..8b72c67 100644 --- a/packages/formspree-react/package.json +++ b/packages/formspree-react/package.json @@ -1,6 +1,6 @@ { "name": "@formspree/react", - "version": "2.4.4", + "version": "2.5.0", "private": false, "description": "The React component library for Formspree", "bugs": { @@ -32,7 +32,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@formspree/core": "^2.8.3", + "@formspree/core": "^3.0.0", "@stripe/react-stripe-js": "^1.7.1", "@stripe/stripe-js": "^1.35.0" },