[Feature Request] Angular: Support zoneless #28400
Closed
valentinpalkovic
started this conversation in
Ideas
Replies: 1 comment
-
|
Closing in favour of #28403 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Currently, Storybook always uses zone.js for change detection.
Describe the solution you'd like
Angular has introduced an experimental feature called zoneless.
The main benefit is that users can remove Zone.js to
The solution would be to enable experimental zoneless mode in Storybook by setting an experimental flag in Storybook's Angular builder options
Tasklist
-- code/frameworks/angular/src/builders/build-storybook/schema.json
-- https://github.com/storybookjs/storybook/blob/next/code/frameworks/angular/src/builders/build-storybook/index.ts
-- https://github.com/storybookjs/storybook/blob/next/code/frameworks/angular/src/builders/start-storybook/schema.json
-- https://github.com/storybookjs/storybook/blob/next/code/frameworks/angular/src/builders/start-storybook/index.ts
-- This file imports always globals.ts, which loads always zone.js. We could try to remove the import and rely on people setting
zone.jsin the polyfills section of their angular.json, which Storybook in theory should also pick up. -- If theexperimentalZoneless` flag is set, we would have to register the zoneless provider here:const applicationRef = await queueBootstrapping(() => { return bootstrapApplication(application, { ...storyFnAngular.applicationConfig, providers: [ + // Consider, that `provideExperimentalZonelessChangeDetection` cannot be imported "normally", because former Angular versions do not provide this export. A conditional dynamic import will be necessary + experimentalZoneless ? provideExperimentalZonelessChangeDetection() : null storyPropsProvider(newStoryProps$), ...analyzedMetadata.applicationProviders, ...(storyFnAngular.applicationConfig?.providers ?? []), - ], + ].filter(Boolean), }); });Acceptance criteria
angular.json's<project>/architect/build/polyfillsarray defined AND theexperimentalZonelessoption is set in<project>/architect/storybook|build-storybook/options, Storybook and change detection via control changes should work.Development workflow
Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
As a maintainer I can support contributors to implement this feature if questions arise.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions