Skip to content

Releases: codinglabsau/inertia-form-builder

v2.0.3

05 Feb 07:20

Choose a tag to compare

What's Changed

  • Requires @codinglabsau/gooey ^2.2.0 (adds SimpleSelect component)

Full Changelog: v2.0.2...v2.0.3

v2.0.2

05 Feb 05:30

Choose a tag to compare

Remove redundant setup-node registry config

v2.0.1

05 Feb 05:27

Choose a tag to compare

Restore .npmrc for local development

v2.0.0

05 Feb 05:08

Choose a tag to compare

Inertia Form Builder v2.0.0

Major upgrade — reactive schemas, Gooey UI integration, generic events config, and modernised build tooling.

Highlights

  • Reactive schemas — pass a function or ref to useSchema() for dynamic fields that auto-sync
  • Gooey v2 integration — migrated from @codinglabsau/ui to @codinglabsau/gooey ^2.0.0
  • Inertia v2 — upgraded to @inertiajs/vue3 ^2.2.0
  • Generic events config — replaced precognitive/precognitiveEvent with events map. Element.vue no longer knows about precognition — consumers wire up validation themselves
  • Simplified precognition APIuseSchema('post', '/users', elements) mirrors laravel-precognition-vue signature
  • 52 unit tests + 8 E2E tests
  • Vue demo/docs app with Shiki syntax highlighting (replaces VitePress)
  • GitHub Pages docs deployment

v1 → v2 Migration Guide

1. Update dependencies

npm uninstall @codinglabsau/ui

npm install @codinglabsau/gooey@^2.0.0
npm install @codinglabsau/inertia-form-builder@^2.0.0
npm install @inertiajs/vue3@^2.2.0

# Optional: install precognition if you use it
npm install laravel-precognition-vue-inertia@^0.7.2

2. Update component imports

- import { Input, Select, Textarea } from '@codinglabsau/ui'
+ import { Input, Select, Textarea } from '@codinglabsau/gooey'

Component renames in Gooey v2:

  • PrimaryButtonButton
  • ErrorFieldError
  • WarningAlertAlert (with variant="warning")

3. Update CheckboxGroup usage

- <CheckboxGroup v-model="form.tags" :items="items" />
+ // In schema definition:
+ tags: {
+   component: CheckboxGroup,
+   checked: ['initial', 'values'],
+   items: ['option-a', 'option-b', 'option-c'],
+ }

4. Adopt reactive schemas (optional)

- const schema = useSchema({
-   name: Input,
-   email: showEmail ? Input : undefined,
- })
+ const schema = useSchema(() => ({
+   name: Input,
+   ...(showEmail.value ? { email: Input } : {}),
+ }))

5. Update showLabel to label

- showLabel: false,
+ label: false,

If using both showLabel: false and label: 'Text', move display label to props:

  full_time: {
    component: Checkbox,
-   showLabel: false,
-   label: 'Full Time',
+   label: false,
+   props: { label: 'Full Time' },
  },

6. Update precognition usage

- const schema = useSchema(elements, {
-   precognition: true,
-   method: 'post',
-   url: '/users',
- })
+ const schema = useSchema('post', '/users', elements)

Replace precognitive/precognitiveEvent with events:

- name: {
-   component: Input,
-   precognitive: true,
-   precognitiveEvent: 'blur',
- }
+ name: {
+   component: Input,
+   events: {
+     blur: (form, name) => form.validate(name),
+   },
+ }

Reusable helper for repeated patterns:

const precog = (event = 'change') => ({
  events: { [event]: (form, name) => form.validate(name) },
})

const schema = useSchema('post', '/users', {
  name: { component: Input, ...precog('blur') },
  email: { component: Input, ...precog() },
})

Breaking changes summary

v1 v2
@codinglabsau/ui @codinglabsau/gooey ^2.0.0
@inertiajs/vue3 ^1.0 @inertiajs/vue3 ^2.2.0
PrimaryButton Button
Error FieldError
WarningAlert Alert
precognition in devDeps Optional peer dep
useSchema(els, { precognition: true, method, url }) useSchema(method, url, els)
SchemaOptions type Removed
optInPrecognition Removed
precognitive / precognitiveEvent events: { blur: (form, name) => ... }
schema.options Removed from return type
Static schemas only Static + reactive (function/ref)
showLabel: false label: false