From bd489017ae14055edee7747ffecf9542f08fef3c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2026 11:47:56 +0000 Subject: [PATCH] Version Packages (next) --- .changeset/pre.json | 4 +++- packages/favicon/CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++++ packages/favicon/package.json | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 packages/favicon/CHANGELOG.md diff --git a/.changeset/pre.json b/.changeset/pre.json index 38ca75ecf..41e37dce1 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -100,7 +100,8 @@ "@solid-primitives/vibrate": "0.0.100", "@solid-primitives/video": "0.0.100", "@solid-primitives/async": "0.0.100", - "@solid-primitives/url": "0.1.0" + "@solid-primitives/url": "0.1.0", + "@solid-primitives/favicon": "0.0.100" }, "changesets": [ "a11y-dataset-hydration-safety", @@ -130,6 +131,7 @@ "event-bus-solid2-migration", "event-dispatcher-solid2-migration", "event-props-solid2-migration", + "favicon-initial", "filesystem-solid2-migration", "fix-barrel-exports-rolldown-compat", "flux-store-solid2-migration", diff --git a/packages/favicon/CHANGELOG.md b/packages/favicon/CHANGELOG.md new file mode 100644 index 000000000..55871d526 --- /dev/null +++ b/packages/favicon/CHANGELOG.md @@ -0,0 +1,37 @@ +# @solid-primitives/favicon + +## 1.0.0-next.0 + +### Major Changes + +- 63b3375: New package: `@solid-primitives/favicon` + + Primitives for controlling the document favicon, built for Solid 2.0 (beta.24). + + ### `makeFavicon` / `createFavicon` + + Non-reactive base and reactive primitive for swapping the favicon `` href. Reuses an existing `` if present and restores its previous href on `dispose()`/cleanup; creates and removes one otherwise. Nested/sequential calls compose correctly under normal mount/unmount ordering. + + ### `makeFaviconAnimation` / `createFaviconAnimation` + + Cycles the favicon through a sequence of hrefs on an interval — for build-status spinners and similar loading indicators. The reactive version accepts a static or reactive frame list, exposes `frame`/`playing` signals and `play`/`pause`, and automatically pauses while the tab is hidden (`document.visibilitychange`), resuming if it was playing before. + + ### `makeFaviconBadge` / `createFaviconBadge` + + Composites a notification count, short string, or plain dot onto a base icon via an offscreen canvas. `0`/`false`/`undefined`/`""` render no badge; `true` renders a dot; numbers clamp to `"{max}+"`. Falls back to the plain base href if the base image fails to load. + + ### `makeFaviconScheme` / `createFaviconScheme` + + Swaps between a light/dark icon to match `prefers-color-scheme`, staying in sync via a `matchMedia` listener as the OS/browser preference changes. Treats SSR as `"light"` (no reliable server-side signal for OS theme). + + ### `makeFaviconProgress` / `createFaviconProgress` + + Composites a progress ring (0–100, clamped) onto a base icon via an offscreen canvas — for upload/download-style indicators. `undefined` shows the base icon with no ring; `0` still draws the (empty) ring track. Falls back to the plain base href if the base image fails to load. + + ### `FaviconLink` + + A component that renders the favicon `` directly, so its initial href is part of the server-rendered HTML instead of only applying once client JS hydrates. Place it once in your document's real `` region (e.g. your SSR framework's root document component); any `make*`/`create*` call elsewhere composes with it automatically, since `bindFaviconLink`'s existing "reuse an existing link" lookup finds and takes over the exact element it rendered. + + ### Design notes + + Rather than one `createAdvancedFavicon` combining all of this behind an options object, each capability is its own small `make*`/`create*` pair sharing internal DOM (`link.ts`) and canvas (`canvas.ts`) helpers — consistent with this repo's existing layered-primitive packages (e.g. `video`). See [DESIGN.md](../packages/favicon/DESIGN.md) for the full reasoning. diff --git a/packages/favicon/package.json b/packages/favicon/package.json index 85358ca5b..ec420a5c6 100644 --- a/packages/favicon/package.json +++ b/packages/favicon/package.json @@ -1,6 +1,6 @@ { "name": "@solid-primitives/favicon", - "version": "0.0.100", + "version": "1.0.0-next.0", "description": "Reactive primitives for controlling the document favicon, including animated frame cycling and notification badges.", "author": "David Di Biase ", "contributors": [],