Skip to content

Conversation

@alan-agius4
Copy link
Contributor

The renderApplication and renderModule methods currently encapsulate the entire rendering process, making it difficult to intercept key phases from a non-Angular context. This change exports the internal render method, allowing us to perform operations such as:

  • Flushing headers before hydration preparation
  • Handling non static redirects (e.g., 302 responses)
  • Intercepting router events for additional processing

This refactor serves as an experimental step toward improving the API for better customization and integration in the future.

//cc @jkrems, I believe you might also find this useful.

…ibility

The `renderApplication` and `renderModule` methods currently encapsulate the entire rendering process, making it difficult to intercept key phases from a non-Angular context. This change exports the internal `render` method, allowing us to perform operations such as:

- Flushing headers before hydration preparation
- Handling non static redirects (e.g., 302 responses)
- Intercepting router events for additional processing

This refactor serves as an experimental step toward improving the API for better customization and integration in the future.
@angular-robot angular-robot bot added the area: server Issues related to server-side rendering label Mar 17, 2025
@ngbot ngbot bot added this to the Backlog milestone Mar 17, 2025
@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Mar 17, 2025
Copy link
Contributor

@hybrist hybrist left a comment

Choose a reason for hiding this comment

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

That looks like a nice level of abstraction for exploration (and +1 on marking it as private API)! Thanks for the ping.

@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 17, 2025
@alan-agius4 alan-agius4 marked this pull request as ready for review March 17, 2025 13:48
@AndrewKushnir AndrewKushnir removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 17, 2025
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 18, 2025
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Mar 18, 2025
@pkozlowski-opensource
Copy link
Member

This PR was merged into the repository by commit bf5d995.

The changes were merged into the following branches: main, 19.2.x

pkozlowski-opensource pushed a commit that referenced this pull request Mar 18, 2025
…ibility (#60416)

The `renderApplication` and `renderModule` methods currently encapsulate the entire rendering process, making it difficult to intercept key phases from a non-Angular context. This change exports the internal `render` method, allowing us to perform operations such as:

- Flushing headers before hydration preparation
- Handling non static redirects (e.g., 302 responses)
- Intercepting router events for additional processing

This refactor serves as an experimental step toward improving the API for better customization and integration in the future.

PR Close #60416
@alan-agius4 alan-agius4 deleted the platform-server-render branch March 18, 2025 14:17
* @param applicationRef - Reference to the Angular application.
* @returns A promise that resolves to the rendered string.
*/
export async function renderInternal(
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks a lot 🙏 Even though this is private, this allows us to use incremental hydration without much hackery (as we also have a custom lifecycle on ssr)

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: server Issues related to server-side rendering target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants