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

fix(docs): gracefully handle missing compositions #9093

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

luvkapur
Copy link
Member

@luvkapur luvkapur commented Aug 6, 2024

This PR updates the docs preview runtime by gracefully handling missing compositions. When the onlyOverview param is true, compositions in the docs iframe are mounted from the client side - which results in the docs preview runtime receiving an empty array of compositions. Before this fix, the docs preview runtime would just try to extract the first element from the compositions array and forward it to the mounters - which resulted them in receiving it as undefined during runtime (even though the docs props indicated that the compositions prop is not optional)

With this fix, we fallback to an empty array when there are missing compositions so the mounters don't get undefined for compositions prop.

@luvkapur luvkapur changed the title fix(Docs): gracefully handle missing compositions fix(docs): gracefully handle missing compositions Aug 6, 2024
@luvkapur luvkapur enabled auto-merge (squash) August 6, 2024 18:13
@luvkapur luvkapur merged commit cab93bb into master Aug 6, 2024
11 checks passed
@luvkapur luvkapur deleted the docs-preview-handle-missing-compositions branch August 6, 2024 19:17
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