-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Addon-Test: Fix config and watch mode inconsistencies #30491
Conversation
View your CI Pipeline Execution ↗ for commit 94f64dd.
☁️ Nx Cloud last updated this comment at |
…ybookjs/storybook into jeppe/universal-store-in-addon-test
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 52 | 52 | 0 |
Self size | 19.18 MB | 19.20 MB | 🚨 +19 KB 🚨 |
Dependency size | 14.19 MB | 14.19 MB | 0 B |
Bundle Size Analyzer | Link | Link |
storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 53 | 53 | 0 |
Self size | 24 KB | 23 KB | 🎉 -710 B 🎉 |
Dependency size | 33.37 MB | 33.39 MB | 🚨 +19 KB 🚨 |
Bundle Size Analyzer | Link | Link |
sb
Before | After | Difference | |
---|---|---|---|
Dependency count | 54 | 54 | 0 |
Self size | 1 KB | 1 KB | 0 B |
Dependency size | 33.40 MB | 33.41 MB | 🚨 +19 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/cli
Before | After | Difference | |
---|---|---|---|
Dependency count | 358 | 358 | 0 |
Self size | 261 KB | 261 KB | 🚨 +145 B 🚨 |
Dependency size | 83.83 MB | 83.85 MB | 🚨 +21 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/codemod
Before | After | Difference | |
---|---|---|---|
Dependency count | 276 | 276 | 0 |
Self size | 612 KB | 612 KB | 0 B |
Dependency size | 65.43 MB | 65.45 MB | 🚨 +19 KB 🚨 |
Bundle Size Analyzer | Link | Link |
…iversal-store-in-addon-test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
38 file(s) reviewed, 17 comment(s)
Edit PR Review Bot Settings | Greptile
const status = 'status' in payload ? payload.status : undefined; | ||
const progress = 'progress' in payload ? payload.progress : undefined; | ||
const error = 'error' in payload ? payload.error : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh TypeScript...
channel.on( | ||
TESTING_MODULE_PROGRESS_REPORT, | ||
async (payload: TestingModuleProgressReportPayload) => { | ||
if (payload.providerId !== TEST_PROVIDER_ID) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate why a separate telemetry handling is necessary for addon test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we want telemetry to include the information of whether or not coverage/a11y was enabled for the run. And that information is now completely opaque to SB core, so the default core telemetry can't include that information.
@@ -182,7 +182,6 @@ export class StorybookReporter implements Reporter { | |||
} as TestingModuleProgressReportProgress, | |||
details: { | |||
testResults, | |||
config: this.testManager.config, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will very likely cause behavioural changes in the frontend. Each run request sent information of how the run should be executed (e.g. a11y=true|false). When sending progress back to the frontend, we take the initial config and send it back. The reason is, that certain states in the sidebar require information of how and whether a particular StatusAPI status should be shown. When receiving the progress report and the user afterwards changes settings, like activating/deactivating a11y, certain statuses might be shown wrongly in the Sidebar. The changes made here are therefore very likely wrong, because they only take the current state into account and not the state from the former test run.
Context: https://github.com/storybookjs/storybook/pull/30077/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, if you keep this setting, you don't have to move this telemetry section to addon-test, but rather it can remain as it was in core-presets, because the progress contains the configuration information with which the run was triggered.
Co-authored-by: Norbert de Langen <norbert@chromatic.com>
…ybookjs/storybook into jeppe/universal-store-in-addon-test
Closes #30201
What I did
Changed the flow for Testing Providers, to move config and watch handling to be an internal thing, completely opaque to Storybook core. This means that addon-test now handles all of that internally, using the new UniversalStore API instead.
User facing changes:
Breaking API changes to the experimental Test provider API:
watching
,watchable
and changing config is now not part of the API anymore. None of these were used by VTA, the only other known user of the API.Updated telemetry to include data on coverage and a11y state.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 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>
Greptile Summary
This PR refactors the addon-test module to internalize configuration and watch mode handling using the new UniversalStore API, improving state synchronization across tabs and removing session storage persistence.
watching
,watchable
, and config properties from the experimental Test Provider API, making these features internal to the addon