Skip to content

Ship JS and CSS through javaabu/manifest #10

Closed

Description

@n4ff4h

Components that need JS (selects, date pickers, file inputs, conditional display, editors) declare their assets with javaabu/manifest so they load automatically. Replace the dependency on js-utilities globals where practical; JS strings use @javaabu/i18n.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    Author

    Done on next-gen (up to 8ae5828); CI green, including the new Assets job (lint, format, typecheck, 151 Vitest tests with coverage to Codecov, build diff).

    • Manifest: Assets::register() declares forms::forms (core), forms::select, forms::dates, forms::files, forms::wysiwyg and forms::onu (the prebuilt stylesheet). Components implement manifest's DeclaresAssets, so each page loads only what it uses; for example, plain selects don't load Tom Select. The JS alias is @javaabu/forms-blade, because @javaabu/forms is the React package's name.
    • js-utilities replaced (TypeScript, no jQuery): conditional display, select all, table sorting, submit spinner, focus on error, Thaana typing (@javaabu/onu/thaana), auto-resize, decimals, and the Onu dialog/tab/alert/menu widgets. Select2 is replaced by Tom Select, with the same data- attributes, ajax query format and cascades; flatpickr handles dates (with a Dhivehi locale); file inputs and uploads are ported too. TinyMCE stays app-hosted, with a configurable URL.
    • Prebuilt dist/ with .vite/manifest.json is committed for apps without Vite; apps with manifest's Vite plugin build from source.
    • i18n: the JS strings come from lang/{en,dv}. @javaabu/i18n can't be installed from GitHub yet because it has no prepare script (Add a prepare script so GitHub installs (github:Javaabu/i18n#main) get dist/ i18n#3), so a temporary local __() with the same signature is used. Switching later is a one-line change in resources/js/lang.ts.
    • Not ported (no v2 view uses them): js-utilities' data-select-children, data-toggle-hide, .select2-b-image, and the map selector, which v1 also left to apps.
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

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions