Skip to content

feat(angular-rspack): Add "zoneless" option to enable Angular's provideZonelessChangeDetection() usage #115

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Chlebamaticon
Copy link

@Chlebamaticon Chlebamaticon commented Jun 6, 2025

Added "zoneless" property to AngularRspackPluginOptions, so PrerenderPlugin is capable of skipping "zone.js" initialisation.

I tried using rspack to build my Angular SSR application without "zone.js" and PrerenderPlugin did complain about missing dependency.

Suggestion

"zoneless" is about to be new default in Angular v20, so all e2e tests by default could become zoneless and for sake of backward compatibility tests that incl. zone.js could be prefixed instead.

@@ -265,6 +265,7 @@ export async function normalizeOptions(
vendorChunk: options.vendorChunk ?? false,
verbose: options.verbose ?? false,
watch: options.watch ?? false,
zoneless: options.zoneless ?? false,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: I'm questioning a bit the requirement of a dedicated config option for zoneless support, as

  • running zoneless actually could be inferred by the absence of 'zone.js' in the polyfillsconfig option
  • additionally, based on your changes it seems to only affect SSR respectively pre-rendering. So if a dedicated config option would really be a requirement, maybe it fits better to add it to ssr or prerender ?

Copy link
Author

@Chlebamaticon Chlebamaticon Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running zoneless actually could be inferred by the absence of 'zone.js' in the polyfillsconfig option

That'd be better I think; wasn't sure If such implicit behaviour might be breaking, or not. I guess it will do a lot more good, then bad.

Will make this change, thanks for review.

@Chlebamaticon Chlebamaticon requested a review from vz-tl June 17, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants