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

Core: Always update initial args when loading a story #16487

Merged
merged 4 commits into from
Oct 27, 2021

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Oct 27, 2021

Issue: #16486

And also update the current args with the delta. This means both when we change story (to an HMR-ed story) and when we HMR the current story.

What I did

Instead of updating args only when the current story's implementation changes, instead always "update" the args when we load a story, if the initialArgs have changed.

How to test

  1. Open button.stories.ts in react-ts
  2. Browse to a story
  3. Edit the args of a different story (e.g. StoryNoRender) in the editor, wait for HMR.
  4. Browse to that story, check it is correct

Also try different combinations, e.g. if you visit the changing story first (before switching away) or if you only ever visit the other story.

  • Is this testable with Jest or Chromatic screenshots?

And also update the current args with the delta. This means both when we change story (to an HMR-ed story) and when we HMR the current story.
@nx-cloud
Copy link

nx-cloud bot commented Oct 27, 2021

Nx Cloud Report

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

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

lib/store/src/ArgsStore.ts Outdated Show resolved Hide resolved
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.

Impressive tests 😍

@shilman shilman changed the title Always update initial args when loading a story Core: Always update initial args when loading a story Oct 27, 2021
@shilman shilman added this to the 6.4 PRs milestone Oct 27, 2021
@shilman shilman merged commit 9814f81 into next Oct 27, 2021
@shilman shilman deleted the 16486-fix-non-selected-hmr branch October 27, 2021 17:03
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.

3 participants