Skip to content

perf(addons): switch to empathic for upwards FS traversal#31388

Closed
43081j wants to merge 1 commit into
storybookjs:nextfrom
43081j:better-find-addons-vitest
Closed

perf(addons): switch to empathic for upwards FS traversal#31388
43081j wants to merge 1 commit into
storybookjs:nextfrom
43081j:better-find-addons-vitest

Conversation

@43081j
Copy link
Copy Markdown
Contributor

@43081j 43081j commented May 6, 2025

Switches to empathic for finding parent files, a much faster library.

Part of consolidating every find-* dependency into just one.

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

Existing tests should cover it.

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.

Greptile Summary

This PR replaces the find-up package with empathic for file system traversal in the Storybook Vitest addon, aiming to improve performance during configuration file discovery.

  • Changed startVitest method in vitest-manager.ts to use synchronous empathic/find instead of async find-up
  • Updated package.json to replace find-up dependency with empathic
  • Modified postinstall.ts to use empathic/find for upwards file system traversal
  • Maintains existing functionality while potentially improving performance during Vitest initialization
  • Part of broader initiative to consolidate file-finding dependencies into a single library

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

43081j added a commit to 43081j/storybook that referenced this pull request May 6, 2025
Part of consolidating every `find-*` dependency into one.

Follow-on of storybookjs#31388.
Copy link
Copy Markdown
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

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

43081j added a commit to 43081j/storybook that referenced this pull request May 6, 2025
43081j added a commit to 43081j/storybook that referenced this pull request May 6, 2025
Follow-on of storybookjs#31388.

Switches to using `empathic` for all upwards FS traversal.
Switches to `empathic` for finding parent files, a much faster library.

Part of consolidating every `find-*` dependency into just one.
@43081j 43081j force-pushed the better-find-addons-vitest branch from 035a5b0 to ffae911 Compare May 6, 2025 12:31
43081j added a commit to 43081j/storybook that referenced this pull request May 6, 2025
Part of consolidating every `find-*` dependency into one.

Follow-on of storybookjs#31388.
43081j added a commit to 43081j/storybook that referenced this pull request May 6, 2025
43081j added a commit to 43081j/storybook that referenced this pull request May 6, 2025
Follow-on of storybookjs#31388.

Switches to using `empathic` for all upwards FS traversal.
43081j added a commit to 43081j/storybook that referenced this pull request May 6, 2025
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 6, 2025

View your CI Pipeline Execution ↗ for commit ffae911.

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

☁️ Nx Cloud last updated this comment at 2025-05-06 12:36:23 UTC

@43081j
Copy link
Copy Markdown
Contributor Author

43081j commented May 6, 2025

This and my other branches may actually be replaced by #31338

if we get that PR over the line, this can be closed and my other branches deleted

I'll switch this to a draft for now

@43081j 43081j marked this pull request as draft May 6, 2025 14:33
@mrginglymus
Copy link
Copy Markdown
Contributor

@43081j this can be closed now?

@43081j
Copy link
Copy Markdown
Contributor Author

43081j commented Oct 6, 2025

it can! thanks for pinging me 🙏

@43081j 43081j closed this Oct 6, 2025
@43081j 43081j deleted the better-find-addons-vitest branch October 6, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants