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-docs: Track code-level args changes in ArgsTable #16488

Merged
merged 2 commits into from
Oct 28, 2021

Conversation

tmeasday
Copy link
Member

Issue: #16174

What I did

Emit a STORY_ARGS_UPDATED event whenever the current story's implementation changes

This means things like the ArgsTable can keep up to date.

NOTE: this does not work if a different story to the the "selected" story is updated in docs mode, which can be visible on the screen. This is a symptom of a larger problem in the way that docs mode works.

How to test

  1. Browse to a docs page for a story with args in react-ts
  2. Edit the args [note this has to be the story you have selected!].
  3. Check the ArgsTable.
  • Is this testable with Jest or Chromatic screenshots?

…entation changes.

This means things like the `ArgsTable` can keep up to date.

NOTE: this does not work if a different story to the the "selected" story is updated in docs mode, which can be visible on the screen. This is a symptom of a larger problem in the way that docs mode works.
@nx-cloud
Copy link

nx-cloud bot commented Oct 27, 2021

Nx Cloud Report

CI ran the following commands for commit db17405. 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.

@yannbf
Copy link
Member

yannbf commented Oct 27, 2021

I gotta test out first, but have you tried updating jsdocs and seeing if HMR updated them in controls as well? I know that was a problem before.

@tmeasday
Copy link
Member Author

I gotta test out first, but have you tried updating jsdocs and seeing if HMR updated them in controls as well?

I'm not sure. I think there are a few pieces to that puzzle that might not work.

@shilman shilman changed the title Track code-level args changes in ArgsTable Addon-docs: Track code-level args changes in ArgsTable Oct 27, 2021
const { selection } = this.urlStore;
const {
selection,
selection: { storyId },
Copy link
Member

Choose a reason for hiding this comment

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

Can selection ever be nullish? the previous code was run under a try block and the new code isn't.

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Good thought! But no ☝️

@shilman shilman added this to the 6.4 PRs milestone Oct 28, 2021
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.

None yet

3 participants