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-actions: Omit sending window object thru the channel #16514

Merged
merged 2 commits into from
Nov 12, 2021

Conversation

forivall
Copy link
Contributor

Issue: #6471

What I did

I detect a react synthetic event, perform a shallow clone, mark the clone with persist() and, if the event has a view property which is an instance of Window, also perform a shallow clone on that object, so that the entire window object is not passed through the channel (which would cause it to be fully cloned every time with the structured clone algorithm

How to test

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

If your answer is yes to any of these, please make sure to include it in your PR.

  • Let me know if this approach is suitable. I'm not sure how to approach testing this; I verified it by making sure things still worked in the demo storybook (the one started with yarn start).

Everything continues to work, the UI is much more responsive (since it's not cloning the entire window on every action), and you can see that the "Window" entry for view is not expandable.
Screen Shot 2021-10-28 at 4 28 58 PM

@nx-cloud
Copy link

nx-cloud bot commented Oct 28, 2021

Nx Cloud Report

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

@shilman shilman changed the title fix(addon-actions): omit sending window object thru the channel Addon-actions: Omit sending window object thru the channel Nov 1, 2021
@shilman shilman added this to the 6.4 PRs milestone Nov 2, 2021
@ndelangen
Copy link
Member

👏👏👏

@ndelangen ndelangen merged commit 007e19b into storybookjs:next Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants