Uh oh!
There was an error while loading. Please reload this page.
feat(context) [next] - Improve createContextProvider types, Add createOptionalContextProvider - #923
Conversation
…eturn a non-undefined value - Added `createOptionalContextProvider` that allows undefined/missing values
🦋 Changeset detectedLatest commit: 5c17bab 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 |
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR updates the ChangesContext API Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Monkeylordz
commented
May 31, 2026
@CodeRabbit review |
✅ Actions performedReview triggered.
|
Uh oh!
There was an error while loading. Please reload this page.
In Solid 2.0,
useContextnow throws if the value is undefined, which made the existingcreateContextProvidertypes out-of-date. Is also introduced a gap which we can solve - namely that some contexts may actually want a missing or undefined value. This PR makes the following additions to address these issues:createContextProvider's types so that theuseContextfunction always returns a non-undefined valuecreateOptionalContextProviderwhich allows undefined/missing valuesSummary by CodeRabbit
New Features
createOptionalContextProviderto handle missing or undefined context values with optional fallback support.createContextProviderwith stronger type safety guarantees for required context scenarios.Documentation