Skip to content

chore(changeset): LayerProvider without Toast loads about 45 KB less - #10106

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:fix/changeset-layer-toast-size
Nov 5, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:fix/changeset-layer-toast-size

Conversation

@vjeux

@vjeux vjeux commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Reader impact

The release notes for the next @astryxdesign/core version tell an app that imports LayerProvider from @astryxdesign/core/Layer and 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 measures LayerProvider from @astryxdesign/core/Layer at 69,280 bytes on main just 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

  • Re-run: build core at each commit, then call measureComponentImport('packages/core/dist/Layer/index.js', null, 'packages/core/dist', 'LayerProvider') from that helper. It gives 69,280 and 23,119 bytes; current main (87ed8d0819) still gives 23,119.
  • git diff against main is one line in one changeset. The [perf] tag, the patch bump and the contributor line stay.

Scope

  • This PR changes documentation only, or names every necessary generated artifact.
  • Runtime, API, visual, and policy changes were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

pnpm check:changesets and the public-text check pass at this head.

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 5, 2026 5:07pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 5, 2026
@astracat-bot

astracat-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 5, 2026, 5:12 PM UTC

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 6748c6d

Storybook · Sandbox · built from this PR's head

API changes: none in this pull request

Committed API report behind this build: cli 9 rows, core 8 rows; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the corrected figure still doesn't follow how this repository measures and states component size.

  • .changeset/layer-provider-toast-on-import.md line 5 says "about 44 KB", which counts 1,000 bytes per KB, but architecture:component-style-authoring INV6 and spec:AST-080 FR8 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 the LayerProvider import's source closure is unchanged since #10012's final head, LayerProvider from @astryxdesign/core/Layer measures 23,119 bytes gzip (23,031 with gzip -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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6748c6d: the note now quotes the size report's helper, measureComponentImport('packages/core/dist/Layer/index.js', null, 'packages/core/dist', 'LayerProvider') from component-size.js, run before and after #10012, in 1,024-byte KB.

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.
@vjeux
vjeux force-pushed the fix/changeset-layer-toast-size branch from 92fef4c to 6748c6d Compare November 5, 2026 16:58
@vjeux vjeux changed the title chore(changeset): LayerProvider without Toast loads about 44 KB less chore(changeset): LayerProvider without Toast loads about 45 KB less Nov 5, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@vjeux
vjeux marked this pull request as ready for review November 5, 2026 17:19
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 5, 2026
@cixzhang
cixzhang marked this pull request as draft November 5, 2026 17:25
@cixzhang
cixzhang marked this pull request as ready for review November 5, 2026 17:25
@cixzhang
cixzhang merged commit da41162 into meta:main Nov 5, 2026
215 of 233 checks passed
@vjeux
vjeux deleted the fix/changeset-layer-toast-size branch November 5, 2026 21:29

This branch was successfully deployed

1 active deployment
Preview — 6748c6d7 Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants