angular / angular-cli

CLI tool for Angular
https://cli.angular.dev
MIT License
26.79k stars 11.98k forks source link

feat(@angular/ssr): add `modulepreload` for lazy-loaded routes #28919

Open alan-agius4 opened 4 days ago

alan-agius4 commented 4 days ago

Enhance performance when using SSR by adding modulepreload links to lazy-loaded routes. This ensures that the required modules are preloaded in the background, improving the user experience and reducing the time to interactive.

Closes #26484

alan-agius4 commented 18 hours ago

I think my biggest concern is that I'm not sure how comfortable I am .toString()-ing a function and parsing out the dynamic import() statement at runtime in a production server.

This only happens during the build, when building the manifest, on a production server the preloads are already extracted.