Skip to content

Next-gen: javaabu/forms v2.0 #15

Open

Description

@n4ff4h

New major of the Blade form components. Drop material-admin and Bootstrap 5.3, add Bootstrap 6 and Onu (same Tailwind styles as Onu), reach feature parity with @javaabu/forms, and ship frontend assets through javaabu/manifest.

Package: javaabu/forms · Target: v2.0 (from v1.71) · Wave: 1
Depends on: javaabu/manifest, @javaabu/forms, @javaabu/onu

Built to the next-gen general rules: CI with test and coverage badges, full docs for people and agents, Laravel Boost guideline and skill, Javaabu codestyle, PHP 8.4 / Laravel 12+ (Laravel packages) or TypeScript (JS packages), Dhivehi and RTL, Blade and Inertia React for views, overridable controllers and policies with javaabu/permissions.

Checklist

Developed by an agent orchestrated from the Javaabu next-gen plan. Cross-package requests go in the dependency's repo with the cross-package label.

Activity

  1. added
    next-genNext-gen Javaabu packages
    epicTracks a whole package
    on Nov 4, 2026
  2. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    Author

    Implementation plan (package agent)

    All work is on the next-gen branch (created from main, which stays on 1.x). At the end there will be one PR, next-gen → main, left for the user to merge.

    Architecture

    • Same component API as v1. <x-forms::…> names, attributes, model binding (@model/<x-forms::form :model>), old input, error display and generated ids/labels stay as they are. All PHP logic stays in src/Views/Components, and each framework is only a view folder: forms::{framework}.{view}.
    • Frameworks: bootstrap-6 (targets 6.0.0-alpha.1, e.g. Modal → Dialog, .check/.radio/.switch, .btn-solid.theme-*) and onu. bootstrap-5 and material-admin-26 are removed and noted in docs/upgrading.md. Per-framework settings stay in forms.frameworks.*.
    • Onu framework: Blade views output the same markup as @javaabu/onu primitives (data-slots and the same Tailwind class strings), so Blade and React pages look identical. The design tokens and theme come from @javaabu/onu/tailwind.css; nothing is copied. Apps add one import, @import "…/vendor/javaabu/forms/resources/css/onu.css", which @sources the Blade views. A sync script plus a CI check keeps the class strings matched to the onu version we target.
    • Icons: one <x-forms::icon> that renders inline SVG (the lucide names onu uses), so no icon font is required. Each framework can map icons to font classes instead.
    • JS (resources/js, TypeScript, no jQuery): ports the js-utilities behaviours the components rely on: conditional display (same data-enable-* attributes), date pickers, enhanced selects (ajax, cascades, tags; Tom Select instead of Select2/jQuery), file upload previews, wysiwyg and maps. Strings go through @javaabu/i18n. It is built with Vite into a committed dist/, so apps without a JS build still work.
    • Assets seam: a component declares what it needs (forms::select, forms::dates, …) through a small Javaabu\Forms\Assets\AssetLoader contract. Until javaabu/manifest's API is on its main, the default implementation renders tags once via @formsScripts/@formsStyles (or pushes them to forms.scripts_stack). Once the API lands, I'll switch the default to manifest's registration and auto-injection.

    Public API sketch

    <x-forms::form :model="$article" method="PATCH" :action="route('articles.update', $article)">
        <x-forms::text name="title" required />
        <x-forms::select2 name="category_id" :options="App\Models\Category::query()" />
        <x-forms::date name="published_at" />
        <x-forms::submit>{{ __('Save') }}</x-forms::submit>
    </x-forms::form>

    config('forms.framework') selects onu | bootstrap-6, and any component accepts framework="…" to override it.

    Order of work

    1. Foundations: PHP 8.4 / Laravel 12+, CI matrix, coverage and codestyle #5 Foundations: composer constraints (PHP 8.4, L12/13, Testbench 10/11), dev-next-gen → 2.x-dev, Pint with Javaabu style, the CI matrix on next-gen and PRs, Codecov, badges
    2. Drop material-admin and Bootstrap 5.3 #6 Drop material-admin and Bootstrap 5.3 (and their tests); the test suite moves to the new frameworks as they land
    3. Bootstrap 6 framework #7 Bootstrap 6 views for every component
    4. Onu framework using Onu's Tailwind styles #8 Onu views, onu CSS entry, class sync check
    5. Feature parity with @javaabu/forms #9 Parity with @javaabu/forms plus docs/parity.md (anything new in React's API gets added here)
    6. Ship JS and CSS through javaabu/manifest #10 JS rewrite plus the asset seam, and manifest once it lands
    7. Dhivehi localization and RTL #13 lang/en and lang/dv (real Dhivehi), RTL review, Thaana in tests
    8. Documentation for people and agents #11 Docs, llms.txt, AGENTS.md, upgrading guide; Laravel Boost guideline and skill #12 Boost guideline and skill
    9. The PR into main

    Open questions / decisions taken (shout if you disagree)

    • Default framework: onu, because it's the shared design system for Blade and React. bootstrap-6 is opt-in while Bootstrap 6 is still in alpha.
    • Tom Select instead of Select2. It drops jQuery and the data-* attribute API stays the same. Select2's own select2-* CSS classes go away.
    • Committed dist/ for the package JS and CSS until javaabu/manifest can build package assets for apps.
    • javaabu/manifest has no code yet, so asset loading stays behind the seam above.
  3. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    Author

    Final summary

    Everything is on next-gen, with CI green on the full matrix (PHP 8.4/8.5 × Laravel 12/13 × lowest/stable, plus Pint and Assets). PR: #16 (open, not merged). Every next-gen issue is closed except #14 (needs a human).

    Built

    • Frameworks:
      • onu (the default) uses Onu's markup and classes, generated from @javaabu/onu's own components and checked in CI.
      • bootstrap-6 targets 6.0.0-alpha.1.
      • Views shared by both frameworks live in forms::common; custom frameworks register with Frameworks::register().
    • Parity: all @javaabu/forms components and attributes exist in Blade, plus error-summary, pagination, formatted-value and icon. The matrix (docs/parity.md) is agreed with react-forms in Parity with javaabu/forms v2: defaults, Blade-only attributes and string keys react-forms#18.
    • Assets: TypeScript (no jQuery) replaces js-utilities and loads through javaabu/manifest. Each component declares what it needs. The prebuilt dist/ is committed, and the alias is @javaabu/forms-blade.
    • Tests: 389 PHPUnit and 151 Vitest tests, including a smoke test that renders every fixture with every framework, plus Dhivehi/Thaana and manifest injection tests.
    • Docs and Dhivehi: Docusaurus docs, llms.txt, AGENTS.md, the Boost guideline and skill (with a generated attribute reference), and Dhivehi for every string.
    • Bug fixes: a docs pass found 30 code issues and the real ones are fixed: textarea escaping, binding leaks, radio checking, positional arguments, date formats, no-bulk and more.

    Intentionally out of scope

    • Not ported from js-utilities, because no v2 view uses them: data-select-children, data-toggle-hide, .select2-b-image, and the drag-and-drop sortable. The map selector also stays app-side, as in v1; only the Google Maps loader ships.
    • No floating labels in Onu: Onu has none, so floating renders a normal label.
    • TinyMCE isn't bundled: apps host it, and forms.wysiwyg.tinymce_url sets where it loads from.

    For the user

  4. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    Author

    Follow-ups done on next-gen (PR #16 updates itself; CI green on 3cf84cd):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicTracks a whole packagenext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions