Repository navigation
chore(changeset): LayerProvider without Toast loads about 45 KB less - #10106
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes requested: the corrected figure still doesn't follow how this repository measures and states component size.
.changeset/layer-provider-toast-on-import.mdline 5 says "about 44 KB", which counts 1,000 bytes per KB, butarchitecture:component-style-authoringINV6 andspec:AST-080FR8 define 1 KB as 1,024 bytes, so 43,672 bytes is about 42.6 KB and the note would overstate the saving.- The exact "43,672 bytes" does not reproduce with the size report's helper (
.github/scripts/lib/component-size.js): at this head, where theLayerProviderimport's source closure is unchanged since #10012's final head,LayerProviderfrom@astryxdesign/core/Layermeasures 23,119 bytes gzip (23,031 withgzip -9), not the 20,865 the figure rests on.
To fix both, re-measure before and after with that helper at gzip's default level and quote the result in 1,024-byte KB, or drop the byte count and keep a rounded figure in that unit (about 43 KB by #10012's own table). The [perf] tag, patch bump and contributor line are fine, and pnpm check:changesets passes.
[Automated review]
| --- | ||
|
|
||
| [perf] LayerProvider no longer carries the toast viewport. An app that imports `LayerProvider` from `@astryxdesign/core/Layer` and never imports Toast loads about 42 KB less JavaScript (gzip). Toast registers its viewport when it is imported, and LayerProvider then renders it after the app. Without a Toast import, LayerProvider renders no empty viewport. A toast shown before the viewport mounts waits, then shows. On the server, LayerProvider renders no viewport; it mounts after hydration. | ||
| [perf] LayerProvider no longer carries the toast viewport. An app that imports `LayerProvider` from `@astryxdesign/core/Layer` and never imports Toast loads about 44 KB (43,672 bytes) less JavaScript (gzip). Toast registers its viewport when it is imported, and LayerProvider then renders it after the app. Without a Toast import, LayerProvider renders no empty viewport. A toast shown before the viewport mounts waits, then shows. On the server, LayerProvider renders no viewport; it mounts after hydration. |
There was a problem hiding this comment.
"about 44 KB" counts 1,000 bytes per KB; architecture:component-style-authoring INV6 defines 1 KB as 1,024 bytes, where 43,672 bytes is 42.6 KB. The byte count also does not reproduce with .github/scripts/lib/component-size.js, which measures LayerProvider from @astryxdesign/core/Layer at 23,119 bytes at this head, not 20,865. Re-measure before and after with that helper at gzip's default level, or keep a rounded figure in 1,024-byte KB without the byte count (about 43 KB by #10012's table).
The changeset from meta#10012 said about 42 KB. The size report's helper (.github/scripts/lib/component-size.js, gzip at its default level) measures `LayerProvider` from @astryxdesign/core/Layer at 69,280 bytes before meta#10012 and 23,119 bytes after it: 46,161 bytes less, 45.1 KB at 1,024 bytes per KB.
92fef4c to
6748c6d
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
The corrected figure now follows how this repository states component size: 46,161 bytes is 45.1 KB at 1,024 bytes per KB at gzip's default level, and the size report's helper (.github/scripts/lib/component-size.js) gives the same 23,119-byte after figure for LayerProvider from @astryxdesign/core/Layer at this head. pnpm check:changesets passes, and the [perf] tag, patch bump and contributor line are fine.
Next step: mark the pull request ready for review, and a maintainer adds the ci:run label so CI runs.
[Automated review]
Reader impact
The release notes for the next
@astryxdesign/coreversion tell an app that importsLayerProviderfrom@astryxdesign/core/Layerand never imports Toast that it loads about 42 KB less JavaScript (gzip). The size report's own measurement says about 45 KB, so the note understates the saving.Source of truth
The size report's helper,
.github/scripts/lib/component-size.js, at gzip's default level. It measuresLayerProviderfrom@astryxdesign/core/Layerat 69,280 bytes onmainjust before #10012 (73a105d115) and 23,119 bytes just after it (af7037b4a4): 46,161 bytes less, which is 45.1 KB at the 1,024 bytes per KB that the repository's size rules use.Correction
.changeset/layer-provider-toast-on-import.md: "about 42 KB less" becomes "about 45 KB (46,161 bytes) less". The byte count lets a reader check the figure against the size report without guessing the unit. Nothing else in the changeset or the repository changes.Evidence
measureComponentImport('packages/core/dist/Layer/index.js', null, 'packages/core/dist', 'LayerProvider')from that helper. It gives 69,280 and 23,119 bytes; currentmain(87ed8d0819) still gives 23,119.git diffagainstmainis one line in one changeset. The[perf]tag, thepatchbump and the contributor line stay.Scope
Testing
pnpm check:changesetsand the public-text check pass at this head.