Cut duplicated and speculative code across the package
An over-engineering audit of the whole tree, applied in five reviewed batches. Behaviour stays the same except where UPGRADE.md says otherwise. PHP: the showcase and error-page stylesheets are prebuilt into resources/dist by bin/stylesheets.mjs, through Vite's own postcss-import (first occurrence kept, the order an application's build gives), instead of Stylesheets::bundle() inlining imports on every request; only the import walk DesignGuard needs stays. SchemeStylesheet::withProfiles() replaces three copies of the scheme-plus-profiles loop, material:scheme leaves spec and contrast checks to the node script that already made them, and the error page's scheme cache, the hashed view namespace, the translations path with no lang/ folder and DesignGuard's 1.x-name hints are gone. JS: the androidx shape port progress.js and both bin scripts each carried lives once in resources/js/shapes.js (the generated SVGs are unchanged); util.js holds ringIndex(), ms(), reopenGuard() and remember(), which were written out several times; listeners are released through AbortController; tooltip.js's hoverPopover() serves the rich tooltip too. CSS: every rule for an element inside the navigation rail queries `--md-navigation-rail-value` instead of repeating the seven collapsed conditions under five media branches; badge, alert, progress, slider and button read one non-inheriting colour-role table (components/color.css); the dialog chrome, the submenu's popover chrome, the chip's state layer and touch target, and the visually-hidden inputs use the shared rules they copied; foundation/tokens.css is folded into foundation.css. Views: Support\Field and Support\Link replace the error-key, bound-value and link-attribute blocks copied into the fields and link components; the timepicker period group, the menu filter and the showcase head are partials; the datepicker's steppers and entry fields are loops; component docblocks no longer restate SKILL.md. Tests and tooling: one dataset-driven ComponentStylesheetsTest replaces four per-group files, DesignGuardTest and the layout-component tests use datasets, browser tests share one ready() helper, CSS parsing lives in ComponentStylesheet alone. docs/audits and the finding IDs citing it are removed, as are pestphp/pest-plugin-laravel, the unused composer scripts and check:font; the lint job runs in the feature job, which now installs node packages so the prebuilt-stylesheet staleness test runs in CI. Feature suite 1177 passed, Chrome browser suite 299 passed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
471d927e64
commit
247c596c3a
+16
-4
@@ -2,6 +2,18 @@
|
||||
|
||||
## From 2.1.0 to 2.1.1
|
||||
|
||||
- **Run `php artisan view:clear` after upgrading.** The components are no longer registered under a
|
||||
view namespace named after a hash of their folder, which only views compiled before 1.0.1 still
|
||||
named; such a view shows the tag as text until it is compiled again.
|
||||
- **`DesignGuard`** no longer reports the 1.x package's own names (`text-meta`, `focus-ring`,
|
||||
`rounded-corner-lg`, `shadow-elevation-2`, `type-body-md`, `ease-spatial-fast`) with their 2.0.0
|
||||
replacement. A colour utility on a 1.x ink is still reported, as a colour of the application's own
|
||||
theme; the rest compile to nothing and pass unnoticed.
|
||||
- **`<x-slider>`** redraws when a script sets its input's `value`, as before, but no longer when it
|
||||
sets `valueAsNumber`; write `value` instead.
|
||||
- **The showcase's stylesheet** is served from `assets/css/showcase.{hash}.css`, prebuilt in
|
||||
`resources/dist/`, and the error page inlines prebuilt bundles too. `Stylesheets::bundle()` and
|
||||
`Stylesheets::resetCache()` are gone; nothing outside the package called them.
|
||||
- **`$store.rail.toggle()`** flips what the first rail on the page draws, as its menu button does.
|
||||
With nothing stored, `<x-scaffold>`'s rail is drawn collapsed from 840 to 1199px whatever
|
||||
`rail.default` says, and `toggle()` collapsed it again, so the first press of an application's
|
||||
@@ -124,9 +136,9 @@
|
||||
|
||||
## From 1.x to 2.0.0
|
||||
|
||||
2.0.0 aligns the library with Material Design 3 Expressive as Google documents it
|
||||
(m3.material.io, checked page by page; the audits are in `docs/audits/m3-alignment/`). Most of
|
||||
the change is inside the components. What reaches an application is below, in the order to do it.
|
||||
2.0.0 aligns the library with Material Design 3 Expressive as Google documents it (m3.material.io,
|
||||
checked page by page). Most of the change is inside the components. What reaches an application is
|
||||
below, in the order to do it.
|
||||
|
||||
### 1. Breakpoints are M3's window size classes
|
||||
|
||||
@@ -166,7 +178,7 @@ rest is a token in the application's own CSS:
|
||||
| `state-layer`, `focus-ring`, `touch-target`, `link` (1.x) | `md-state-layer`, `md-focus-ring`, `md-touch-target`, `md-link` |
|
||||
|
||||
The spacing tokens are the 4px grid Tailwind's scale was (`space200` is 16px). `DesignGuard` names
|
||||
each one with its replacement.
|
||||
each of Tailwind's own utilities with its replacement; the 1.x names are no longer reported.
|
||||
|
||||
### 3. Regenerate the colour scheme
|
||||
|
||||
|
||||
Reference in New Issue
Block a user