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.
Closes #21284
What I did
In Storybook 7.0 we use the new bootstrapApplication API to bootstrap a middleman Storybook Standalone Module to the DOM. The module is configured to respect your configured imports, declarations and schemas. This also means that there is no root ngModule anymore. Previously you could add ModuleWithProviders, likely the result of a 'Module.forRoot()'-style call, to your
imports
array of themoduleMetadata
definition. This is now discouraged. Instead, you should use the newapplicationConfig
decorator to define application-wide providers and environment providers. Previously, we extracted all providers (and nested ones) from the modules, which were provided viaimports
automatically, which wasn't a clean solution and was causing bugs like #21284. Instead, now the user has to define all necessary environment-related providers manually.For example, if you want to configure BrowserAnimationModule in your stories, please do the following:
You can also use the
provide-style
decorator to provide an application-wide service:Please visit https://angular.io/guide/standalone-components#configuring-dependency-injection for more information.
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]