-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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: On demand store #15871
Merged
Merged
Core: On demand store #15871
Conversation
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
If you update an arg value, then change the underlying (initial) args, we look at what you've changed, then try and apply it over the new initial args.
Also this ensures weird stuff doesn't happen when we change arg/global names.
Nx Cloud ReportCI ran the following commands for commit 5a981b4. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
We need to wait to emit DOCS_RENDERED until all the stories are rendered.
This also enables us to simplify `SourceContainer`.
…ect-sourceContainer Fix `useEffect` in docs and `SourceContainer`
…docs Addon-docs: Bugfixes for new on-demand architecture
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From the migration notes:
Introduces an opt-in feature flag,
features.storyStoreV7
, which loads stories in an "on demand" way (that is when rendered), rather than up front when the Storybook is booted. This way of operating will become the default in 7.0 and will likely be switched to opt-out in that version.The key benefit of the on demand store is that stories are code-split automatically (in
builder-webpack4
andbuilder-webpack5
), which allows for much smaller bundle sizes, faster rendering, and improved general performance via various opt-in Webpack features.The on-demand store relies on the "story index" data structure which is generated in the server (node) via static code analysis. As such, it has the following limitations:
storiesOf()
However, the
autoTitle
feature is supported.Behavioral differences
The key behavioral differences of the v7 store are:
SET_STORIES
is not emitted on boot up. Instead the manager loads the story index independenly.STORY_PREPARED
is emitted when a story is rendered for the first time, which contains metadata about the story, such asparameters
.extract()
need to be proceeded by an async call toloadAllCSFFiles()
which fetches all CSF files and processes them.Using the v7 store
To activate the v7 mode set the feature flag in your
.storybook/main.js
config:NOTE:
features.storyStoreV7
impliesfeatures.buildStoriesJson
and has the same limitations.This PR is too large to be sensibly reviewed, instead it has been split into several smaller PRs that can be examined separately and changes will be cherry picked back here:
@storybook/store
and@storybook/preview-web
#15999ClientApi
to be a facade in front of the store #16006Current limitations:
These limitations will be addressed in follow up PRs.