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

CSF3: Remove path from autoTitle browser code #17185

Merged
merged 2 commits into from
Jan 10, 2022
Merged

CSF3: Remove path from autoTitle browser code #17185

merged 2 commits into from
Jan 10, 2022

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Jan 10, 2022

Issue:

In attempting to get autoTitle functionality working in the vite builder, I found that path was being used in one of the modules which runs in the browser. This is a node.js module, and while webpack polyfills it, vite does not.

See storybookjs/builder-vite#201 for context.

What I did

I've replaced the usage of path with a simple join using /, and then performing a replacement of sets of one or more / with a single /.

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

Existing tests seem to be robust enough to cover this change (there are tests for both trailing slashes and no trailing slashes).

@IanVS IanVS added the bug label Jan 10, 2022
@nx-cloud
Copy link

nx-cloud bot commented Jan 10, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit 6e98cec. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@IanVS
Copy link
Member Author

IanVS commented Jan 10, 2022

It looks like some windows snapshot failures have snuck in while they haven't been running (see #17148), but I don't think there are any test failures related to this PR.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Minor nit otherwise LGTM

lib/store/src/autoTitle.ts Outdated Show resolved Hide resolved
@shilman shilman changed the title Remove path from autoTitle browser code CSF3: Remove path from autoTitle browser code Jan 10, 2022
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @IanVS 🚀

@shilman shilman merged commit e7aefb3 into next Jan 10, 2022
@shilman shilman deleted the autotitle-path branch January 10, 2022 15:21
@shilman shilman added patch:yes Bugfix & documentation PR that need to be picked to main branch patch:done Patch/release PRs already cherry-picked to main/release branch labels Jan 20, 2022
shilman added a commit that referenced this pull request Jan 20, 2022
CSF3: Remove `path` from autoTitle browser code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug compatibility with other tools csf3 patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants