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 8 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
Contributor

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
Copy link

nx-cloud bot commented Jun 27, 2025

View your CI Pipeline Execution ↗ for commit 43881d7.


☁️ Nx Cloud last updated this comment at 2025-06-27 08:58:59 UTC

@Coly010
Copy link
Collaborator

Coly010 commented Jun 27, 2025

Hey @Chlebamaticon ! Thanks for the PR, this is great 🎉

Can you rebase this on top of main and run pnpm i as there seem to be lockfile issues

@Chlebamaticon Chlebamaticon force-pushed the add-zoneless-support branch from 43881d7 to 9a65547 Compare June 27, 2025 09:20
@Chlebamaticon
Copy link
Author

Chlebamaticon commented Jun 27, 2025

Rebased and lockfile resolved! 🙌

@Chlebamaticon Chlebamaticon requested a review from Coly010 July 9, 2025 09:53
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.

4 participants