Releases: sergiodxa/remix-utils
v4.0.0
What's Changed
New Features
- Always return string[] from
getClientLocales
by @arnaudambro in #84 - Remove json, useLoaderData and useActionData by @sergiodxa in #102
- Add typed cookies utilities by @sergiodxa in #104
- Update how DynamicLinks, ExternalScripts and StructuredData works by @sergiodxa in #105
- Add createTypedSessionStorage by @sergiodxa in #107
Documentation Changes
- Delete examples folder by @sergiodxa in #103
New Contributors
- @arnaudambro made their first contribution in #84
Full Changelog: v3.4.0...v4.0.0
v3.4.0
What's Changed
New Features
- Accept FormData in verifyAuthenticityToken alongside a Request by @dahlbyk in #90
- Only create a new authenticity token if not already in the session by @myleslinder in #97
Documentation Changes
New Contributors
- @dadamssg made their first contribution in #87
- @dahlbyk made their first contribution in #90
- @myleslinder made their first contribution in #97
Full Changelog: v3.3.0...v3.4.0
v3.3.0
What's Changed
New Features
Documentation Changes
- Fix spelling of cacheAssets by @brandonpittman in #80
Bug Fixes
- Ensure useLoaderData & useActionData has stable values by @sergiodxa in #85
New Contributors
- @brandonpittman made their first contribution in #80
- @dusty made their first contribution in #82
Full Changelog: v3.2.0...v3.3.0
v3.2.0
What's Changed
New Features
- Add cacheAssets function by @sergiodxa in #78
Documentation Changes
- Fix DynamicLinks example in README.md by @dandaneel in #75
- Remove ENV test for in README by @machour in #77
New Contributors
- @dandaneel made their first contribution in #75
- @machour made their first contribution in #77
Full Changelog: v3.1.0...v3.2.0
v3.1.0
What's Changed
New Features
- Allow broader react version by @Jarrku in #72
- Add useGlobalPendingState hook by @sergiodxa in #74
Documentation Changes
New Contributors
Full Changelog: v3.0.0...v3.1.0
v3.0.0
What's Changed
json
and useLoaderData
/useActionData
The json
response helper was updated to don't use type-fest anymore, and now in the init options (second argument) it can receive a replacer
function to let you customize how values are transformed to string. Useful to support BigInt, Date, etc.
There are new useActionData
and useLoaderData
hooks, wrapping the Remix ones, which let you pass a reviver
to parse back the objects you serialized with a replacer
.
Both hooks lets you also pass a validator
function, it receives the value from the loader/action and let you run a validation (e.g. using Zod) to check the value is correct. If you pass a validator, the return type of both hooks is inferred from the return type of the validator
.
All response helpers use that json
, also a new created
response helper for a 201 status code.
Other React changes
The useRouteData
now uses the match.id
instead of the pathname or a custom ID.
The useRevalidate
hook was replaced with useDataRefresh
using useFetcher
internally. It simulates the same API being discussed on the Remix repo.
The RevalidateLink
was removed.
The deprecated usage of ClientOnly
was removed.
The custom Outlet
and useParentData
hooks were removed.
Other Server changes
The verifyAuthenticityToken
function now checks if the request body was already used and throw an error.
The bodyParser
object was removed.
Full Changelog: v2.11.1...v3.0.0
v2.11.1
What's Changed
New Features
- Pluralize locale to locales by @sergiodxa in #63
Full Changelog: v2.11.0...v2.11.1
v2.11.0
What's Changed
New Features
- Add getClientLocale and useLocale by @sergiodxa in #61
- Add promiseHash helper by @sergiodxa in #62
Full Changelog: v2.10.0...v2.11.0