Add createIslandSignal for sharing reactive state across Solid islands#17159
Open
matthewp wants to merge 3 commits into
Open
Add createIslandSignal for sharing reactive state across Solid islands#17159matthewp wants to merge 3 commits into
createIslandSignal for sharing reactive state across Solid islands#17159matthewp wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 350c93f The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
delucis
reviewed
Jun 24, 2026
delucis
left a comment
Member
There was a problem hiding this comment.
Is there a reason this is needed? We already document how to do this here: https://docs.astro.build/en/recipes/sharing-state-islands/
(Also seems unusual to add an API that only works for one framework when there's an agnostic approach documented.)
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.
Changes
createIslandSignalfunction exported from@astrojs/solid-js/signalsthat lets users create signals in.astrofrontmatter and pass them to multipleclient:*Solid components. All islands sharing the same signal get a single reactive instance on the client, so updating it in one island updates all others.data-solid-signalsJSON attribute mapping prop names to shared signal IDs ("sg0","sg1", etc.). On the client, a module-levelsharedSignalMapcreates or reusescreateSignaltuples by ID.!suffix on the signal ID), and signals nested inside arrays or objects..peek()scalars replace signals before render). Props are replaced with scalar values only after rendering, before Astro'sserializePropsruns.Testing
packages/integrations/solid/test/signals.test.ts— Integration tests verifyingdata-solid-signalsserialization: shared signals between islands get the same ID, array signals produce[id, index]tuples, object signals produce[id, key]tuples, and SSR output contains correct values.packages/astro/e2e/solid-signals.test.ts— E2E tests verifying signals hydrate with the correct initial value and that clicking a button in one island reactively updates a shared signal displayed in another island.Docs
@astrojs/solid-js/signalsexport andcreateIslandSignalAPI. Not included in this PR.