-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Angular: Support v19.2 when @angular/animations is not installed #30611
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { logger } from 'storybook/internal/node-logger'; | ||
| import { AngularLegacyBuildOptionsError } from 'storybook/internal/server-errors'; | ||
| import { WebpackDefinePlugin } from '@storybook/builder-webpack5'; | ||
| import { WebpackDefinePlugin, WebpackIgnorePlugin } from '@storybook/builder-webpack5'; | ||
|
|
||
| import { BuilderContext, targetFromTargetString } from '@angular-devkit/architect'; | ||
| import { JsonObject, logging } from '@angular-devkit/core'; | ||
|
|
@@ -40,6 +40,16 @@ export async function webpackFinal(baseConfig: webpack.Configuration, options: P | |
| }) | ||
| ); | ||
|
|
||
| try { | ||
| await import('@angular/platform-browser/animations'); | ||
| } catch (e) { | ||
| webpackConfig.plugins.push( | ||
| new WebpackIgnorePlugin({ | ||
| resourceRegExp: /@angular\/platform-browser\/animations$/, | ||
| }) | ||
| ); | ||
| } | ||
|
Comment on lines
+43
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Consider catching a more specific error type than just 'e' to avoid accidentally catching unrelated errors |
||
|
|
||
| return webpackConfig; | ||
| } | ||
|
|
||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Removing this template file will break the OpenCloseComponent and its stories unless corresponding changes are made to move this template inline or provide an alternative. |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: init() is now public and async but constructor no longer calls it - this could cause issues if callers forget to call init()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of requiring everyone to call
PropertyExtractor.init()manually after constructing, maybe you can do:so you can do
await new PropertyExtractor(), that will run init and return the instance.