Skip to content

Cut the download size and add size budgets for every entry point #32

Closed

Description

@n4ff4h

A labelled text field costs ~29 KB gzipped and the "admin form" scenario ~95 KB, mostly from how translations and icons are bundled.

  • Split the English text by area (common, form, …) so a component only pulls in the strings it uses (today every component loads the whole ~37 KB file).
  • OnuProvider no longer bundles the Dhivehi text (~61 KB) or ~250 Lucide icons (~38 KB) into English-only apps: Dhivehi and the icon map load when an app asks for them.
  • Keep date-fns out of components that don't show dates (text field, modal).
  • A size-limit budget for every package.json export (charts, maps, editor, calendar, media, export, primitives…), checked in CI.

Activity

  1. n4ff4h commented on Oct 14, 2026

    @n4ff4h
    CollaboratorAuthor

    Done in 88e8031 (merged to main in 8884104).

    • English text is registered per namespace by the modules that use it, so a component no longer pulls in the whole English file.
    • OnuProvider no longer bundles Dhivehi or the Lucide icon map. Pass locale={dv} from the new @javaabu/onu/locales/dv entry to bundle Dhivehi up front; locale="dv" loads it on demand. Icons named through <Icon name> load the map on first use; icons={lucideIconMap} bundles it up front.
    • date-fns is gone from components that show no dates.
    • size-limit now has a budget for every JS and CSS export plus the core scenarios. CI already runs it.
    Import (brotli) Before After
    FormField + TextInput 28.4 kB 16.0 kB
    Modal 36.6 kB 24.3 kB
    Select 50.8 kB 38.5 kB
    DataTable 81.7 kB 73.0 kB
    OnuProvider 36.6 kB 1.3 kB
    OnuProvider + 9 form components 111.3 kB 81.4 kB

    API notes are in .changeset/smaller-locales-and-icons.md.


    Generated by Claude Code

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions