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

Addon-A11y: Fix preset loading when loaded via getAbsolutePath #30563

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Feb 18, 2025

Closes #

What I did

I have re-exported project annotations in the root preview.js of @storybook/addon-a11y so that project annotations can be loaded from @storybook/addon-a11y if it is loaded when the wrapPnP automigration is applied and addons module path are loaded via getAbsolutePath.

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

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/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 pull request has been released as version 0.0.0-pr-30563-sha-6397c214. Try it out in a new sandbox by running npx storybook@0.0.0-pr-30563-sha-6397c214 sandbox or in an existing project with npx storybook@0.0.0-pr-30563-sha-6397c214 upgrade.

More information
Published version 0.0.0-pr-30563-sha-6397c214
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/fix-addon-a11y-loading-after-wrap-pnp-automigration
Commit 6397c214
Datetime Tue Feb 18 11:44:37 UTC 2025 (1739879077)
Workflow run 13389792678

To request a new release of this pull request, mention the @storybookjs/core team.

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 80.6 MB 80.6 MB 0 B 0.74 0%
initSize 80.6 MB 80.6 MB 0 B 0.74 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.31 MB 7.31 MB 0 B 0.74 0%
buildSbAddonsSize 1.9 MB 1.9 MB 0 B 0.23 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 0.82 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.97 MB 3.97 MB 0 B 0.4 0%
buildPreviewSize 3.34 MB 3.34 MB 0 B 0.73 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 20.7s 19.5s -1s -163ms 0.48 -6%
generateTime 20.2s 31s 10.8s 8.96 🔺34.8%
initTime 4.8s 6.4s 1.6s 6.04 🔺24.7%
buildTime 9.8s 11.9s 2.1s 3.23 🔺17.6%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.2s 5.1s -1s -64ms -0.47 -20.6%
devManagerResponsive 4.7s 3.9s -759ms -0.41 -19.2%
devManagerHeaderVisible 819ms 1s 250ms 2.33 🔺23.4%
devManagerIndexVisible 888ms 1s 188ms 2.09 🔺17.5%
devStoryVisibleUncached 4.4s 3.9s -515ms 0.16 -13%
devStoryVisible 917ms 1s 179ms 1.81 🔺16.3%
devAutodocsVisible 911ms 727ms -184ms -0.44 -25.3%
devMDXVisible 955ms 964ms 9ms 1.83 0.9%
buildManagerHeaderVisible 891ms 921ms 30ms 0.51 3.3%
buildManagerIndexVisible 978ms 931ms -47ms 0.34 -5%
buildStoryVisible 860ms 880ms 20ms 0.45 2.3%
buildAutodocsVisible 675ms 1.1s 431ms 0.79 39%
buildMDXVisible 675ms 471ms -204ms -1.61 🔰-43.3%

Greptile Summary

This PR modifies the preview.js file in @storybook/addon-a11y to fix project annotations loading when using the wrapPnP automigration with getAbsolutePath.

  • Changed code/addons/a11y/preview.js to re-export all exports from './dist/preview' to ensure proper loading of project annotations
  • Ensures compatibility with wrapPnP automigration when addon paths are loaded via getAbsolutePath
  • Maintains existing a11y addon functionality while fixing the module resolution issue

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Feb 18, 2025

View your CI Pipeline Execution ↗ for commit 6397c21.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 58s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-18 11:49:19 UTC

@valentinpalkovic valentinpalkovic merged commit f457f7b into next Feb 18, 2025
63 of 73 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/fix-addon-a11y-loading-after-wrap-pnp-automigration branch February 18, 2025 12:03
@github-actions github-actions bot mentioned this pull request Feb 18, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants