@vinejs/vine
4.4.0 · 27 Apr 2026MIT595.8k / weekRepositoryHomepagenpmAtom feed
3.0.1 is the newest release of 3.x.
In short
1 breaking5 new2 fixed1 changed1 internal
- breaking
This release contains a few breaking changes along with a handful of new improvements and bug fixes.
Release note
This release contains a few breaking changes along with a handful of new improvements and bug fixes.
Breaking changes
Infer type
The infer type of schema now marks optional fields as optional within the TypeScript types. This ensures the property can be missing altogether from the data object/inferred types vs being marked as undefined explicitly. For example:
// Schema
vine.object({
username: vine.string(),
age: vine.number().optional(),
})
// Old output
{
age: number | undefined;
username: string;
}
// New output
{
age?: number | undefined;
username: string;
}SUBTYPE symbol
Custom types extending the VineJS BaseLiteralType now must define the symbols.SUBTYPE property on the schema. This property can be used by schema transformers to get a more accurate type for the schema node. Here's how the StringSchema defines the SUBTYPE property.
For example:
import { symbols, BaseLiteralType } from '@vinejs/vine'
class MySchemaType extends BaseLiteralType<Input, Output, CamelCaseOutput> {
[symbols.SUBTYPE] = 'multipartFile'
}Bug Fixes
Add tests to ensure field names with special chars are allowed (67f6c52), closes #50 #63 #82
Do not use Error.captureStackTrace when not available (715e761), closes #49
Infer types
Features
Add support for conditional validation in arrays, object, records and tuples (890228e), closes #71
Add support for ULID validation
Pull Requests
Export VineNativeEnum class
Add support for ULID validation
Infer types