upgrade: clipboard package upgrade for Solid 2.0#850
Draft
davedbase wants to merge 1 commit intosolidjs-community:nextfrom
Draft
upgrade: clipboard package upgrade for Solid 2.0#850davedbase wants to merge 1 commit intosolidjs-community:nextfrom
davedbase wants to merge 1 commit intosolidjs-community:nextfrom
Conversation
🦋 Changeset detectedLatest commit: c05d43f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
atk
reviewed
Apr 21, 2026
| import { isServer } from "solid-js/web"; | ||
| // isServer moved from solid-js/web (1.x) to @solidjs/web (2.x). | ||
| // typeof window is a universal fallback compatible with both versions. | ||
| const isServer = typeof window === "undefined"; |
Member
There was a problem hiding this comment.
maybe globalThis.window !== globalThis instead?
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.
Migrates the clipboard package to Solid.js 2.0 (beta.7).
Breaking changes
createClipboardnow returns an async accessor —createResource(removed in 2.0) is replaced with an asynccreateMemo. The returnedclipboardaccessor starts synchronously with an empty array; afterrefetch()it reads from the clipboard asynchronously. The previous value stays visible during a pending read (isPending(() => clipboard())returnstrue).copyToClipboarddirective → ref function — Solid 2.0 no longer supports theuse:directive namespace extension pattern.copyToClipboardis now a factory that returns arefcallback:The
declare module "solid-js"JSX directive augmentation has been removed accordingly.isServerimport — moved fromsolid-js/web→@solidjs/web.Peer dependency bumped to
solid-js@^2.0.0-beta.7.Internal
readClipboardItems()async helper (replaces inlineon+createResourcepattern)."texfield"→ ``"textarea"`.copyToClipboardnow uses@ts-expect-errorinstead of@ts-ignore.