|
| 1 | +--- |
| 2 | +cover: Valibot v1.4 |
| 3 | +title: 'Valibot v1.4: String case transforms, local timestamps, and perf improvements' |
| 4 | +description: >- |
| 5 | + Valibot v1.4 adds four string case transformation actions, a new validation |
| 6 | + action for local ISO timestamps, and a round of performance and compatibility |
| 7 | + improvements. |
| 8 | +published: 2026-05-05 |
| 9 | +authors: |
| 10 | + - fabian-hiller |
| 11 | +--- |
| 12 | + |
| 13 | +import { Link } from '~/components'; |
| 14 | + |
| 15 | +Valibot v1.4 adds four string case transformation actions for converting between common naming conventions, a new validation action for local ISO timestamps without timezone, and a round of performance and compatibility improvements. |
| 16 | + |
| 17 | +Huge thanks to [@ksaurav24](https://github.com/ksaurav24), [@heiwen](https://github.com/heiwen), [@compulim](https://github.com/compulim), [@ysknsid25](https://github.com/ysknsid25), [@alaycock-stripe](https://github.com/alaycock-stripe), [@IlyaSemenov](https://github.com/IlyaSemenov), and [@wszgrcy](https://github.com/wszgrcy) for their contributions to this release. |
| 18 | + |
| 19 | +## String case transformations |
| 20 | + |
| 21 | +Four new transformation actions handle the most common naming convention conversions: <Link href="/api/toCamelCase/">`toCamelCase`</Link>, <Link href="/api/toKebabCase/">`toKebabCase`</Link>, <Link href="/api/toPascalCase/">`toPascalCase`</Link>, and <Link href="/api/toSnakeCase/">`toSnakeCase`</Link>. |
| 22 | + |
| 23 | +These actions split words on `_`, `-`, ASCII whitespace, and case or acronym boundaries, so they work on a wide range of inputs without preprocessing. |
| 24 | + |
| 25 | +```ts |
| 26 | +import * as v from 'valibot'; |
| 27 | + |
| 28 | +const SlugSchema = v.pipe(v.string(), v.toKebabCase()); |
| 29 | + |
| 30 | +v.parse(SlugSchema, 'My Blog Post'); // 'my-blog-post' |
| 31 | +v.parse(SlugSchema, 'getUserByID'); // 'get-user-by-id' |
| 32 | +v.parse(SlugSchema, 'first_name'); // 'first-name' |
| 33 | +``` |
| 34 | + |
| 35 | +This is especially useful at API boundaries: normalizing form fields before persisting, or converting incoming JSON keys before passing them to a typed service. |
| 36 | + |
| 37 | +## Local ISO timestamps |
| 38 | + |
| 39 | +<Link href="/api/isoTimestamp/">`isoTimestamp`</Link> requires a timezone |
| 40 | +designator and <Link href="/api/isoDateTime/">`isoDateTime`</Link> only |
| 41 | +validates `hh:mm`, leaving a gap for local date-times that include seconds, such |
| 42 | +as `1995-03-31T00:00:00`. The new |
| 43 | +<Link href="/api/isoDateTimeSecond/">`isoDateTimeSecond`</Link> action fills |
| 44 | +that gap. |
| 45 | + |
| 46 | +```ts |
| 47 | +import * as v from 'valibot'; |
| 48 | + |
| 49 | +const EventSchema = v.object({ |
| 50 | + startsAt: v.pipe(v.string(), v.isoDateTimeSecond()), |
| 51 | +}); |
| 52 | + |
| 53 | +v.parse(EventSchema, { startsAt: '1995-03-31T00:00:00' }); // ok |
| 54 | +v.parse(EventSchema, { startsAt: '1995-03-31 00:00:00' }); // ok |
| 55 | +``` |
| 56 | + |
| 57 | +This is useful for local-only events, schedules, and database columns like PostgreSQL's `timestamp` (without timezone), where attaching a UTC offset would be incorrect. |
| 58 | + |
| 59 | +## Performance improvements |
| 60 | + |
| 61 | +Hot validation paths now allocate fewer objects, and a long-standing `RangeError` that could occur when spreading very large issue arrays has been fixed. Together, this makes validating large schemas both faster and safer. |
| 62 | + |
| 63 | +TypeScript performance has also improved significantly. The internal types behind <Link href="/api/object/">`object`</Link> and <Link href="/api/record/">`record`</Link> schemas — particularly when combined with <Link href="/api/pipe/">`pipe`</Link> and the <Link href="/api/readonly/">`readonly`</Link> action — have been simplified, making type inference and autocomplete noticeably faster on large codebases. |
| 64 | + |
| 65 | +If you have ever hit a `RangeError` with a large schema, noticed allocation pressure in a validation hot path, or felt sluggish autocomplete on large object schemas, this release should resolve it. |
| 66 | + |
| 67 | +## Compatibility fixes |
| 68 | + |
| 69 | +The build target has been changed to ES2020 so the distributed output stays compatible with environments that lack newer syntax. As part of the same effort, `Object.hasOwn` (ES2022) was replaced with `Object.prototype.hasOwnProperty.call` to keep Valibot working on runtimes that have not yet shipped the newer builtin. |
| 70 | + |
| 71 | +The <Link href="/api/intersect/">`intersect`</Link> schema no longer mutates input values, so frozen objects and arrays can now be merged without throwing. The <Link href="/api/creditCard/">`creditCard`</Link> action also rejects Mastercard numbers with invalid lengths instead of accepting them. |
| 72 | + |
| 73 | +## What's next? |
| 74 | + |
| 75 | +We will continue to focus on performance, broader runtime compatibility, and refining the developer experience around common validation workflows. If there is a validator, transformation, or guide you would like to see next, let us know on [Discord](https://discord.gg/Jwf9vjvReZ) or open a discussion on [GitHub](https://github.com/open-circle/valibot/discussions). |
| 76 | + |
| 77 | +New to Valibot? Check our [quick start guide](/guides/quick-start/). Coming from Zod? Check our [migration guide](/guides/migrate-from-zod/). |
0 commit comments