-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻ Refactor to gather story snapshot dom without reloading the page
When relying on the snapshot method to capture the DOM, each story is loaded from scratch. For some larger Storybooks, this can create a lot of extra time repeatedly initializing all of Storybook's JavaScript for each story. By refactoring to gather DOM from a single page, this initial load time only happens once, and asset discovery can be performed on the static DOM snapshot without needing JavaScript enabled. In practice, this seems to speed up most Storybooks by roughly 20-40% depending on how well optimized the stories are. For poorly optimized stories, we also automatically handle page crashes and will only error if a page crashes on the same story more than once. When testing large Storybooks of 800+ stories, it takes about 2 minutes (on my machine). However if that is too slow for some (or if stories are slow to load), a few additional flags were added to split snapshots into shards to allow parallel processes for the same Percy build. The new flags `--shard-count` or `--shard-size` will determine how to split snapshots, and `--shard-index` will determine which shard to use for the current process. Also the `--partial` flag from the exec command was incorporated, which can mark a build as partial to hide missing snapshots in the UI.
- Loading branch information
Showing
15 changed files
with
1,885 additions
and
1,280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.