Skip to content

Make type narrowing of islands easier for consumers#21

Merged
CMeeg merged 2 commits intomainfrom
ssr-island-types
Jan 10, 2025
Merged

Make type narrowing of islands easier for consumers#21
CMeeg merged 2 commits intomainfrom
ssr-island-types

Conversation

@CMeeg
Copy link
Owner

@CMeeg CMeeg commented Jan 10, 2025

  • Consumers may need to narrow the type of a Phoria Island based on the framework in scenarios such as customising the SSR strategy in the server entry i.e. only apply a strategy if the island contains a React component
  • The types for the PhoriaIsland SSR class have been amended to accept the framework name as a string literal type
  • The framework plugin libraries export functions that make it convenient to check if a PhoriaIsland is using a particular framework e.g. isReactIsland
  • Consumers can then use these functions to narrow the PhoriaIsland type and identify the type of framework and type of component

@CMeeg CMeeg self-assigned this Jan 10, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: 88c9146

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@phoria/phoria Patch
@phoria/phoria-svelte Patch
@phoria/phoria-react Patch
@phoria/phoria-vue Patch

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

@CMeeg CMeeg merged commit edff1eb into main Jan 10, 2025
1 check passed
@CMeeg CMeeg deleted the ssr-island-types branch January 10, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant