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 Onboarding: Use @neoconfetti/react as alternative #30100

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Dec 18, 2024

Closes #

What I did

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 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>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.7 MB 77.7 MB 0 B - 0%
initSize 136 MB 136 MB -2.84 kB 0.65 0%
diffSize 58.4 MB 58.4 MB -2.84 kB 0.65 0%
buildSize 7.22 MB 7.22 MB -898 B 0.99 0%
buildSbAddonsSize 1.86 MB 1.86 MB -898 B 0.99 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B 1 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.92 MB 3.92 MB -898 B 0.99 0%
buildPreviewSize 3.3 MB 3.3 MB 0 B 1 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 25.7s 24.2s -1s -518ms 0.84 -6.3%
generateTime 23.3s 21.7s -1s -577ms -0.41 -7.3%
initTime 15.9s 16.5s 571ms 2.18 3.4%
buildTime 9s 11.8s 2.7s 6.9 🔺23.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.6s 6s 1.3s 2.58 🔺22.6%
devManagerResponsive 3.5s 4.4s 974ms 9.18 🔺21.7%
devManagerHeaderVisible 551ms 696ms 145ms 4.99 🔺20.8%
devManagerIndexVisible 582ms 760ms 178ms 7.92 🔺23.4%
devStoryVisibleUncached 1.7s 2s 253ms 1.35 🔺12.6%
devStoryVisible 583ms 761ms 178ms 7.82 🔺23.4%
devAutodocsVisible 485ms 668ms 183ms 3.29 🔺27.4%
devMDXVisible 497ms 598ms 101ms 4.44 🔺16.9%
buildManagerHeaderVisible 566ms 695ms 129ms 9.55 🔺18.6%
buildManagerIndexVisible 640ms 796ms 156ms 11.01 🔺19.6%
buildStoryVisible 525ms 649ms 124ms 9.87 🔺19.1%
buildAutodocsVisible 417ms 548ms 131ms 7.33 🔺23.9%
buildMDXVisible 423ms 559ms 136ms 8.42 🔺24.3%

Greptile Summary

This PR replaces react-confetti-boom with @neoconfetti/react in the onboarding addon, simplifying the confetti animation implementation while maintaining core functionality.

  • Replaced dependency in code/addons/onboarding/package.json with @neoconfetti/react
  • Modified code/addons/onboarding/src/components/Confetti/Confetti.tsx to use half-width positioning and fixed dimensions
  • Added React.memo optimization to Confetti component
  • Simplified component by removing state management and fade-out logic
  • Unused timeToFade prop remains in interface despite removal of fade functionality

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.

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

Comment on lines +27 to +28
stageHeight={window.innerHeight}
stageWidth={window.innerWidth}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: using window.innerHeight/Width directly can cause issues if window is undefined (SSR) or resized

particleCount={particleCount}
fadeOutHeight={10}
particleCount={200}
duration={5000}
Copy link
Contributor

Choose a reason for hiding this comment

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

style: duration is hardcoded to 5000 while timeToFade prop exists - consider using timeToFade prop here

Copy link

nx-cloud bot commented Dec 18, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 717e256. 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.

@yannbf yannbf merged commit f202d2a into norbert/fix-confetti-bundling Dec 18, 2024
53 of 58 checks passed
@yannbf yannbf deleted the norbert/fix-confetti-bundling-alternative branch December 18, 2024 15:09
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.

1 participant