Version Packages (next) - #1002
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated.
nextis currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exitonnext.Releases
@solid-primitives/favicon@1.0.0-next.0
Major Changes
63b3375: New package:
@solid-primitives/faviconPrimitives for controlling the document favicon, built for Solid 2.0 (beta.24).
makeFavicon/createFaviconNon-reactive base and reactive primitive for swapping the favicon
<link>href. Reuses an existing<link rel="icon">if present and restores its previous href ondispose()/cleanup; creates and removes one otherwise. Nested/sequential calls compose correctly under normal mount/unmount ordering.makeFaviconAnimation/createFaviconAnimationCycles 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/playingsignals andplay/pause, and automatically pauses while the tab is hidden (document.visibilitychange), resuming if it was playing before.makeFaviconBadge/createFaviconBadgeComposites a notification count, short string, or plain dot onto a base icon via an offscreen canvas.
0/false/undefined/""render no badge;truerenders a dot; numbers clamp to"{max}+". Falls back to the plain base href if the base image fails to load.makeFaviconScheme/createFaviconSchemeSwaps between a light/dark icon to match
prefers-color-scheme, staying in sync via amatchMedialistener as the OS/browser preference changes. Treats SSR as"light"(no reliable server-side signal for OS theme).makeFaviconProgress/createFaviconProgressComposites a progress ring (0–100, clamped) onto a base icon via an offscreen canvas — for upload/download-style indicators.
undefinedshows the base icon with no ring;0still draws the (empty) ring track. Falls back to the plain base href if the base image fails to load.FaviconLinkA component that renders the favicon
<link>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<head>region (e.g. your SSR framework's root document component); anymake*/create*call elsewhere composes with it automatically, sincebindFaviconLink's existing "reuse an existing link" lookup finds and takes over the exact element it rendered.Design notes
Rather than one
createAdvancedFaviconcombining all of this behind an options object, each capability is its own smallmake*/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 for the full reasoning.