Fragiola

Concepts

Tree-shaking

One entry per component and per toolkit mechanism, ESM only and no side effects, so an app that uses two components ships only those two.

An app that uses Dialog and Tabs gets Dialog, Tabs and the toolkit code they use, nothing else. That is a hard requirement of the library, checked on every build.

One entry per component

Every framework package has one entry per component, and a root entry that only re-exports them:

import { Dialog } from "@fragiola/primitives-react/dialog";
import { Tabs } from "@fragiola/primitives-react/tabs";

Importing from the root (@fragiola/primitives-react) tree-shakes to the same output. In Angular each component is an ng-packagr secondary entry point (@fragiola/primitives-angular/dialog).

An opt-in feature is an entry of its own, never a prop: the virtual lists (/listbox-virtual, /select-virtual, /combobox-virtual, /autocomplete-virtual, /command-virtual) and the async list (/async-list). A Listbox, Select, Combobox, Autocomplete or Command that does not import them ships the same code, with no virtualizer.

A calendar system and a time zone are injected, never looked up: a date component takes calendar={persian} (one export per system from @fragiola/primitives/calendar-systems), a date field timeZone={timeZone("America/New_York")} (from @fragiola/primitives/time-zone). No component imports either entry, so an app ships only the systems it passes, and no zone code when it passes none.

No registry

There is no Vue app.use() plugin and no Angular NgModule of every directive: nothing references every component. A component imports only the toolkit mechanisms it uses, each its own entry (@fragiola/primitives/focus, /overlay, /scroll-lock, ...).

ESM, no side effects

Every package is ESM only, with "sideEffects": false, and no module runs code when it is imported.

The bundle guard

The repository builds a small app per framework that imports Dialog and Tabs, and fails when any other component or an unused mechanism (the dates, the range math) is in its output.