Skip to content

Make toolkit imports granular and tree-shakeable - #7

Merged
fabiofranzini merged 5 commits into
devfrom
apvee/granular-tree-shaking
Oct 7, 2026
Merged

fabiofranzini merged 5 commits into
devfrom
apvee/granular-tree-shaking

Conversation

@fabiofranzini

@fabiofranzini fabiofranzini commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Importing a small root export previously retained unrelated PnP registrations and inflated consumer bundles. Add canonical domain/narrow entrypoints and keep registration effects in the four feature-owning PnP services. Root, domain and preserved legacy leaf imports now produce identical production bundle sizes across nine fixture families.

  • Preserve all 599 historical packed paths, declaration contracts, dependency/peer ownership and provider isolation; add the styles facade and exact export/type resolution contracts.
  • Make standalone list services register their required webs feature. Direct PnP consumers must explicitly import the features they use instead of relying on incidental root registration. Release/version assessment is required before publication.
  • Add installed-tarball bundle, runtime and mutation gates to CI, plus public import/migration documentation and an interactive Imports sample.

Validation

Fresh local checks before this PR:

  • npm run build (library before app), npm run verify, npm run verify:package, and git diff --check.
  • 676 tests; 36 production bundle variants, 18 fresh runtime probes and nine intentional mutations.
  • All 18 blocking root/domain-versus-leaf gzip gaps are zero, with zero forbidden emitted modules. Minimum useSx root fixture falls from 24,087 to 11,986 gzip bytes; its extra size versus direct Griffel is 1,971 gzip bytes.
  • Actual ImportsPanel Chrome QA: 65 observations without failures, including mixed imports, current captured callbacks, style overrides, LTR/RTL and mobile keyboard scrolling. The user also confirmed the web part works correctly.

Authenticated tenant checklist details and the full peer/browser matrix were not independently executed. Existing npm/SPFx metadata advisories remain visible. See .docs/maintenance/2026-10-07-granular-tree-shaking-verification.md for measurements, provenance and evidence.

Scrollbar follow-up

scrollbar.fluent now uses 6px on both axes with 3px rounded thumb corners in Edge/Chrome, with Fluent colors, transparent tracks and native forced-colors fallback. Foreign Griffel width/color overrides keep their original composition precedence.

Fresh verification passes: 676 tests, complete 36/18/9 package gates, and 477 sample + 967 engine observations in each of Edge154 and Chrome155. Both actual gutter dimensions are6px; computed thumb radius is3px. See .docs/maintenance/2026-10-07-scrollbar-axes-fix.md.

Scrollbar interaction restoration

Restored Fluent hover and pressed/dragged thumb colors, including pressed priority, release and mouse-leave feedback. Width/height remain6px and corners3px. Actual Edge/Chrome pointer tests and168 screenshot pixel checks pass in light, dark and high-contrast palettes;676 tests and all package gates pass. See .docs/maintenance/2026-10-07-scrollbar-hover-fix.md.

Actual SharePoint host theme correction

The real workbench host theme flattened base/hover/pressed scrollbar colors to the same v8 neutralSecondary token. Preserve the migration output except its two state tokens: map hover/pressed to host neutralPrimary/neutralDark. Real converter and host-provider regression tests now cover this path.

Verified in the user's authenticated Edge workbench after restarting the dev server: base#605e5c → hover#323130, pressed token#201f1e, still6px/radius3px. Actual native-window pixel checks confirm the hover change.676 tests and full package gates pass; no tenant writes or broad host-permission claims.

@fabiofranzini
fabiofranzini merged commit b2c3560 into dev Oct 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant