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

Build: split lib/addons into manager & preview part, move code to manager-api #19952

Merged
merged 21 commits into from
Nov 25, 2022

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Nov 24, 2022

Move preview related code from lib/addons partially into preview-api

before:
Untitled Diagram drawio (6)

after:
storybook-prebundling-preview-architecture drawio

I've also moved all manager related code fromlib/addons to manager-api:
storybook-prebundling-preview-architecture drawio (1)

lib/addons still exist, but it just re-exports parts from preview-api and manager-api.
This is for backwards compatibility

@ndelangen ndelangen self-assigned this Nov 24, 2022
@ndelangen ndelangen added the maintenance User-facing maintenance tasks label Nov 24, 2022
@storybookjs storybookjs deleted a comment from github-actions bot Nov 24, 2022
@ndelangen ndelangen changed the title Tech/split-addons Build: split lib/addons into manager & preview part, move code to manager-api Nov 24, 2022
@storybookjs storybookjs deleted a comment from socket-security bot Nov 24, 2022
@ndelangen
Copy link
Member Author

@JReinhold I think I'd like to verify with you something that seems to be happening here:
https://www.chromatic.com/test?appId=635781f3500dd2c49e189caf&id=637feadb2547552d19290761

When I load this story locally, the play function is ran, and the component renders as the before did in chromatic:
Screenshot 2022-11-24 at 23 37 53

But it seems in chromatic the 'undefined' state is stuck, which would mean the play function did not run?
Screenshot 2022-11-24 at 23 38 12

but somehow the play-function DID run on other stories, or we'd see many more stories get flagged for review.
So I'm wondering if this is some timing issue that is surfacing, or what else could be the cause?
Any ideas @JReinhold or @shilman ? 🙏

@ndelangen
Copy link
Member Author

I'll see if i can add a delay to the story, perhaps chromatic doesn't understand that this is actually a story with a play function at all, therefore it doesn't wait for the play function to finish.

@JReinhold
Copy link
Contributor

The special case about that story is that in itself it doesn't contain any interaction tests, but it contains a <Story /> block which references a story that does have interaction tests, which it is suppose to run because of docs.autoplay on that sub-story.

So Chromatic doesn't know there's an interaction test to run here. We should just add a delay that ensure the nested interaction test finishes.

@@ -1,4 +1,4 @@
import { addons } from '@storybook/addons';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an entry to migration.md

Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Make sure to remember about documentation bits!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: addons maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants