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

Vue2: Fix play function within & args updating in decorators #19207

Merged
merged 15 commits into from
Oct 2, 2022

Conversation

shilman
Copy link
Member

@shilman shilman commented Sep 18, 2022

Issue: #19204

There are a couple problems with Vue2's renderToDom

  • The element #storybook-root is re-created on first render, which breaks the play function's within(canvas)
  • Decorators that reassign args, e.g. storyFn({ args: { somethingElse } }) don't work like the other renderers. Unfortunately this is a pattern we use in our sandbox Pre component all over the place.

What I did

Fixes with @prashantpalikhe:

  • Render the story into the child of #storybook-root instead of overwriting it
  • Fix args handling so that args can be updated by decorators
  • Enable CI for vue-cli/vue2 repro template

How to test

  • CI passes

@shilman shilman changed the title Vue2: Fix play's within(canvas) by preserving #storybook-root Vue2: Fix play within(canvas) by preserving #storybook-root Sep 18, 2022
@shilman shilman changed the title Vue2: Fix play within(canvas) by preserving #storybook-root Vue2: Fix story rendering Sep 18, 2022
@IanVS
Copy link
Member

IanVS commented Sep 22, 2022

Does this PR address #19204?

@shilman
Copy link
Member Author

shilman commented Sep 22, 2022

@IanVS Not yet. This PR addresses within(canvas) failing in play functions. It's kind of a hack so I'd like to work with somebody to figure out the "args binding" problem described in that comment before merging anything

@shilman
Copy link
Member Author

shilman commented Sep 28, 2022

@IanVS update: i looked at this with @prashantpalikhe and we're closer to a solution but still have more to figure out. thanks for your patience!

@shilman shilman changed the title Vue2: Fix story rendering Vue2: Fix play function & args updating in decorators Oct 2, 2022
@shilman shilman changed the title Vue2: Fix play function & args updating in decorators Vue2: Fix play function within & args updating in decorators Oct 2, 2022
@shilman shilman merged commit e562342 into next Oct 2, 2022
@shilman shilman deleted the shilman/vue2-rendering-improvements branch October 2, 2022 12:24
@shilman shilman mentioned this pull request Oct 5, 2022
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