Changelog
Relevant source files
The following files were used as context for generating this wiki page:- packages/remotes/CHANGELOG.md
- packages/remotes/package.json
- README.md
- packages/remotes/README.md
- packages/remotes/src/lib/enhance.svelte.ts
- packages/remotes/src/lib/validation.svelte.ts
- commit-message.txt
- packages/remotes/src/lib/index.ts
- packages/remotes/eslint.config.js
- packages/remotes/tsconfig.json
- packages/remotes/src/app.html
- packages/remotes/vite.config.ts
- packages/remotes/src/app.d.ts
- packages/remotes/svelte.config.js
This document outlines the version history and notable changes for the @opensky/remotes package. The package provides SvelteKit helper utilities, specifically createValidation and createEnhancedForm, designed to improve the developer and user experience when working with SvelteKit's remote form functions.
The changelog tracks the evolution of the API, including new features, breaking changes, and improvements to form state management, validation, and submission lifecycle handling. Each version entry details the specific modifications, providing context for the library's development trajectory.
Sources: packages/remotes/CHANGELOG.md, packages/remotes/package.json:2-3, README.md:1-3
[0.0.3]
This version introduced several significant enhancements and breaking changes aimed at improving type safety, API consistency, and developer control over the form submission process.
Sources: packages/remotes/CHANGELOG.md:3-16, packages/remotes/package.json:4
Added
reset()method for enhanced forms: Areset()method was added to the instance returned bycreateEnhancedForm, allowing developers to manually revert the form's state to'idle'.
Sources: packages/remotes/CHANGELOG.md:5, packages/remotes/src/lib/enhance.svelte.ts:311-313cancel()andupdates()inonSubmit: TheonSubmitcallback now receivescancel()andupdates()functions.cancel()allows for aborting the submission based on client-side logic, whileupdates()facilitates optimistic UI updates.
Sources: packages/remotes/CHANGELOG.md:6, packages/remotes/src/lib/enhance.svelte.ts:80-85addIssue()for custom validation: ThecreateValidationhelper now includes anaddIssue()method, enabling the programmatic addition of custom validation errors to specific fields.
Sources: packages/remotes/CHANGELOG.md:7, packages/remotes/src/lib/validation.svelte.ts:121-130
The following diagram illustrates the new control flow within the onSubmit callback.
Changed
This version included three breaking changes to improve the API's clarity and type safety.
Sources: packages/remotes/CHANGELOG.md:9
-
successstate renamed toresult: The terminal success state was renamed fromsuccesstoresultfor better semantic meaning. Theresultstate is now set whenremote.resultis truthy after a submission.
Sources: packages/remotes/CHANGELOG.md:10, packages/remotes/src/lib/enhance.svelte.ts:233-235, packages/remotes/src/lib/enhance.svelte.ts:296-298 -
validatoroption renamed tovalidation: IncreateEnhancedForm, the option for passing a validation helper was renamed fromvalidatortovalidationto align with thecreateValidationfunction name.
Sources: packages/remotes/CHANGELOG.md:11, packages/remotes/src/lib/enhance.svelte.ts:44 -
Timing options moved to creation: The
delayMsandtimeoutMsoptions were moved from theenhance()callback to thecreateEnhancedForm()constructor. This architectural change enables conditional typing, where thedelayedandtimeoutstates and their correspondingonDelayandonTimeoutcallbacks are only available if the timing options are provided at creation.Sources: packages/remotes/CHANGELOG.md:12-16, commit-message.txt, packages/remotes/src/lib/enhance.svelte.ts:192-224
The diagram below shows the structural change of moving timing options.
| Breaking Change | Old API (pre-0.0.3) | New API (0.0.3+) | Rationale |
|---|---|---|---|
| State Name | form.success (boolean) | form.result (boolean) | Better semantic clarity. |
| Option Name | createEnhancedForm(remote, { validator: valid }) | createEnhancedForm(remote, { validation: valid }) | Consistency with createValidation. |
| Timing Config | form.enhance({ delayMs: 500 }) | createEnhancedForm({ delayMs: 500 }) | Enables type-safe conditional states (delayed) and callbacks (onDelay). |
Sources: packages/remotes/CHANGELOG.md:9-16, packages/remotes/src/lib/enhance.svelte.ts
[0.0.2]
This version introduced the core createEnhancedForm helper.
Sources: packages/remotes/CHANGELOG.md:18-21
Added
createEnhancedFormhelper: This function was added to manage the form submission lifecycle. It provides reactive state getters to track the form's status (idle,pending,delayed,timeout,issues,error,success) and integrates withcreateValidationfor automatic validation handling.
The following diagram shows the possible state transitions managed by createEnhancedForm.
[0.0.1]
This was the initial release of the package, establishing the foundation for form validation.
Sources: packages/remotes/CHANGELOG.md:23-26, packages/remotes/package.json:4
Added
createValidationhelper: This utility was created to provide reactive form validation with several key features:- Debounced remote validation to avoid excessive server calls.
- Smart issue display logic: issues appear on
blurand are cleared oninput, improving user experience. - Methods for accessing and managing validation issues (
fields,issues,allIssues,reset, etc.).
Sources: packages/remotes/CHANGELOG.md:24-26, packages/remotes/src/lib/validation.svelte.ts:11-14, README.md:5-8