Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BYOC] Fix type errors when creating custom BYOC components that use context SDKs #1675

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

ambrauer
Copy link
Contributor

Description / Motivation

This PR fixes type errors when creating custom BYOC component that use context SDKs (i.e. Events Cloud SDK).

  • Remove undefined from getSDK return type. This matches the augmented type we have in @sitecore/components/context. If an invalid SDK is passed somehow then we return a rejected promise instead.
  • Also added import @sitecore/components/context in byoc/index so that the augmented types are included by default.

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

…type we have in @sitecore/components/context. If an invalid SDK is passed somehow then we return a rejected promise instead.

Also import @sitecore/components/context in byoc/index so that the augmented types are included by default.
@ambrauer ambrauer requested a review from a team November 22, 2023 21:23
@ambrauer ambrauer merged commit 417cf38 into dev Nov 22, 2023
1 check passed
@ambrauer ambrauer deleted the fix/JSS-1254 branch November 22, 2023 21:31
ambrauer added a commit that referenced this pull request Nov 22, 2023
…context SDKs (#1675)

* Remove undefined from getSDK return type. This matches the augmented type we have in @sitecore/components/context. If an invalid SDK is passed somehow then we return a rejected promise instead.

Also import @sitecore/components/context in byoc/index so that the augmented types are included by default.

* CHANGELOG update
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.

2 participants