NAS-141025 / 27.0.0-BETA.1 / Remove the last of Angular Material - #14110
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## NAS-142357-3 #14110 +/- ##
================================================
+ Coverage 89.05% 89.07% +0.02%
================================================
Files 1867 1863 -4
Lines 70072 69951 -121
Branches 9189 9163 -26
================================================
- Hits 62402 62310 -92
+ Misses 7670 7641 -29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Two findings, both LOW. 🎉 Nothing here blocks — this is a clean landing for a sweep this wide. Genuinely nice work on the parts that are easy to get wrong in a dependency-removal PR: the three non-Material consumers of MDC custom properties were re-pointed ( I checked the two claims in the description that a reviewer can't take on faith, and both hold:
Two smaller things I specifically looked for and cleared rather than flagged: the The findings are inline:
|
|
This PR has been merged and conversations have been locked. |
Straggler sweep for Epic NAS-141021: removes the Angular Material that was left
after the feature-area and shared-infrastructure tickets, and drops the
dependency so it cannot creep back.
Templates / TypeScript
ix-errorsheld the last<mat-error>; it now renders<div class="error-message">.Its colour rule has to stay global (messages are injected via
[innerHTML], so theycarry no
_ngcontentattribute and emulated component styles never reach them).test.directive.ts: dropped everymat-*case and everytn-*case from thetag→test-id switch. A parse of all templates confirms
[ixTest]is never placed on atn-*element — those take the library's owntestIdinput — so both groups were dead.Only native tags plus
ix-dateremain.navigate-and-highlight.service.tshad live.mat-mdc-menu-panel/.mat-mdc-menu-itemqueries driving its FocusKeyManager arrow-key dance. Re-pointed at tn-menu's DOM
(
div.tn-menu[cdkMenu], which also carries CdkMenu's keydown host listener, andbutton.tn-menu-item). CdkMenu still reads the deprecatedevent.keyCode, so theexisting keyCode patch stays necessary.
editable.component.ts: removed four dead Material overlay selectors.ix-date-adapter.ts— aNativeDateAdaptersubclass that was never providedanywhere — plus
MatButtonModule/provideNativeDateAdapter()frommain.tsand all15
Mat*Moduleglobal injections fromsetup-jest.ts.Styles
No
.mat-*/.mdc-*selectors and no--mat-*/--mdc-*custom properties remain._material-overrides.scss,_angular15.scss,_mat-card.scss,_mat-button-group.scss, andmixins/buttons.scss(its only mixin,stroked-button,was Material-only).
_tn-styles.scss(−577 lines, including the wholemat.*theme andtypography layer),
_fn-styles.scss,_egret_overrides.scss,mixins/cards.scss,_charts.scss,_dynamic-markdown.scss, and five component stylesheets._material-reduction.scss→_globals.scss. It no longer contains any Material —just base typography, the
.form-elementrhythm, tooltips, the search-highlight pulseand two overlay z-indexes.
Worth a reviewer's eye:
_material-overrides.scssdefined MDC custom properties thatthree non-Material consumers read. Those were re-pointed rather than dropped —
--mdc-dialog-subhead-font→var(--font-family-body),--mdc-icon-button-icon-color→
var(--fg2). Likewise the oldmat-tab-nav-panelhighlight rule is now rooted on[role='tabpanel'], which the plain<div>tab hosts carry sincetn-tabsreplaced it.Dependency
@angular/materialis removed frompackage.json, along with its twomoduleNameMapperentries in
jest.config.cjs. Only the root workspace depended on it.@angular/cdkstays— overlay, a11y, drag-drop, tree, and
CdkMenuundertn-menuall use it.@material-design-icons/svgalso stays. It is the icon set, not the component library:tn-iconrenders from a sprite thatyarn tn-iconsgenerates, and the generator resolves@material-design-icons/svg/filled/*.svgfrom webui's ownnode_modules. Eight of the 18mat-*symbols in the sprite are demanded by@truenas/ui-componentsitself (tn-tablesort arrows, tn-select chevrons), so dropping it is a library-side change first.
Also removed
The
new-feature-indicatordirective, which was entirely unused —*ixNewFeatureIndicatorappeared in zero templates. Its wrapper component, service, interface and specs go with it,
along with the store plumbing that existed only to feed it: the
shownNewIndicatorKeysUpdatedaction, its reducer case, its entry in the
saveUpdatedPreferences$effect, and theshownNewFeatureIndicatorKeyspreference. Note this changes the shape of the preferencesblob written via
auth.set_attribute— harmless, since it is an arbitrary JSON blob andnothing reads the field, but flagging it.
Testing
yarn buildpasses;styles.cssis 45 KB (the Material theme was the bulk of the oldglobal CSS).
yarn lintandstylelintclean.yarn test:changed(126 tests) plusmodules/forms|dialog|listsandstore/preferences|dashboardas sanity slices — all green.