upgrade: props package upgrade for Solid 2.0#908
Draft
davedbase wants to merge 3 commits into
Draft
Conversation
🦋 Changeset detectedLatest commit: bf6ec8e 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 |
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.
Summary
Upgrades the props package to
solid-js@^2.0.0-beta.13/@solidjs/web@^2.0.0-beta.13and adds two new utilities:combineHandlersandpartitionProps.Breaking changes
Peer dependencies updated
solid-js@^2.0.0-beta.13and@solidjs/web@^2.0.0-beta.13are now required.classListsupport removedSolid 2.0 removes the
classListJSX prop in favour ofclassaccepting objects and arrays.combinePropsno longer handles aclassListkey. Pass an object or array asclassinstead:classcombining semantics updatedWhen all combined
classvalues are strings they are joined with a space (unchanged). When any value is aClassListobject or array the result is a flat array, which Solid 2.0'sclassprop accepts natively.mergereplacesmergePropssemanticsNon-special props now follow
mergesemantics: an explicitundefinedin a later source overrides earlier values (previouslyundefinedwas skipped).New utilities
combineHandlersChains multiple event handlers into one. Handlers that are
null,undefined, orfalseare silently skipped — useful for conditional handlers inline. Returns the single handler unchanged when only one is present (no wrapping overhead). Reactive through Solid's props proxy when used in JSX; for a standalone signal source, read it explicitly before passing or wrap the call increateMemo.partitionPropsSplits a props object into
[matched, rest]— both views are lazy reactive proxies powered byfilterPropsunder the hood, so the predicate runs per property read and both halves stay in sync with dynamic props. For an expensive predicate, pass acreatePropsPredicateresult to share a single cache across both views.Internal changes
mergeProps→merge,MergeProps→MergethroughoutJSXtype imported from@solidjs/webcreateMemo(fn, undefined, options)→createMemo(fn, options)(initialValue arg removed in 2.0)createComputedreplaced withcreateEffect(compute, apply)+flush(); signals created outsidecreateRootto avoidSIGNAL_WRITE_IN_OWNED_SCOPEtest/server.test.ts)