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

Tags: Fix composition with older storybooks #27358

Merged
merged 5 commits into from
May 24, 2024

Conversation

shilman
Copy link
Member

@shilman shilman commented May 24, 2024

Closes #27352

What I did

Starting in 8.1, all stories get the dev tag by default and users have to opt-out if they want to hide them from the sidebar. Unfortunately, previous versions of Storybook did not add the dev tag by default, so those stories would be filtered from the sidebar when composed.

We don't know the version of the Storybook we're composing, so instead I bumped the index version. When we compose a Storybook with a lower index version, we automatically add the dev tag to all stories.

  • Added new index/ref handling logic
  • Added E2E test in one sandbox (react-vite/devault-ts)
  • Updated snapshots from existing tests

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

To test this fix by hand, fire up the react-vite/default-ts (or navigate to it from the CI results) and verify by hand that:

  1. It composes 8.0 and 7.6 storybooks
  2. The stories from those storybooks show correctly

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

@shilman shilman added bug patch:yes Bugfix & documentation PR that need to be picked to main branch composition tags ci:normal labels May 24, 2024
Copy link

nx-cloud bot commented May 24, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit a6bdab7. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@valentinpalkovic
Copy link
Contributor

I think you would like to bump the index here as well: https://github.com/storybookjs/storybook/blob/next/code/lib/preview-api/src/modules/store/StoryIndexStore.ts#L27. Potentially, all places can refer to the same variable, so that this will not been overseen again

@shilman shilman requested a review from tmeasday May 24, 2024 12:24
@shilman shilman merged commit fc915d6 into next May 24, 2024
60 of 61 checks passed
@shilman shilman deleted the shilman/27352-fix-tags-composition branch May 24, 2024 13:05
storybook-bot pushed a commit that referenced this pull request May 24, 2024
…position

Tags: Fix composition with older storybooks
(cherry picked from commit fc915d6)
@github-actions github-actions bot mentioned this pull request May 24, 2024
13 tasks
storybook-bot pushed a commit that referenced this pull request May 24, 2024
…position

Tags: Fix composition with older storybooks
(cherry picked from commit fc915d6)
@github-actions github-actions bot mentioned this pull request May 24, 2024
25 tasks
storybook-bot pushed a commit that referenced this pull request May 24, 2024
…position

Tags: Fix composition with older storybooks
(cherry picked from commit fc915d6)
storybook-bot pushed a commit that referenced this pull request May 27, 2024
…position

Tags: Fix composition with older storybooks
(cherry picked from commit fc915d6)
@shilman shilman mentioned this pull request May 27, 2024
2 tasks
storybook-bot pushed a commit that referenced this pull request May 27, 2024
…position

Tags: Fix composition with older storybooks
(cherry picked from commit fc915d6)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ci:normal composition patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch tags
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Storybook 8.1 does not display stories from composable (refs) like in previous version
2 participants