Skip to content

feat(core): add utility for resolving defer block information to ng global#59184

Closed
crisbeto wants to merge 3 commits intoangular:mainfrom
crisbeto:defer-debug
Closed

feat(core): add utility for resolving defer block information to ng global#59184
crisbeto wants to merge 3 commits intoangular:mainfrom
crisbeto:defer-debug

Conversation

@crisbeto
Copy link
Copy Markdown
Member

Adds the getDeferBlocks function to the global ng namespace which returns information about all @defer blocks inside of a DOM node. This information can be useful either directly in the browser console or to implement future functionality in the dev tools.

Also includes the following supporting changes:

refactor(core): remove unused field

Removes the prefetchTriggers field from the TDeferBlockDetails since we weren't reading or writing to it anywhere.

refactor(core): track debugging information about deferred triggers

Adds a field on the TDeferBlockDetails where we can track debugging information about the defer block. Also uses it to store text representation of the different triggers which can be shown to the dev tools.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Dec 13, 2024
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: core Issues related to the framework runtime labels Dec 13, 2024
@ngbot ngbot bot added this to the Backlog milestone Dec 13, 2024
@crisbeto crisbeto marked this pull request as ready for review December 13, 2024 16:26
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 13, 2024
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we should move this code in the packages/core/src/defer folder (for ex. packages/core/src/defer/debug.ts).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I put it here since this is where we keep all of the window.ng code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good. We'd probably need to revisit this (for ex. create a separate folder for all debug-related code), but it's outside of the scope of this PR.

Removes the `prefetchTriggers` field from the `TDeferBlockDetails` since we weren't reading or writing to it anywhere.
Adds a field on the `TDeferBlockDetails` where we can track debugging information about the defer block. Also uses it to store text representation of the different triggers which can be shown to the dev tools.
Copy link
Copy Markdown
Member Author

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

Feedback has been addressed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I put it here since this is where we keep all of the window.ng code.

@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 14, 2024
Copy link
Copy Markdown
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@crisbeto thanks for implementing this API 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good. We'd probably need to revisit this (for ex. create a separate folder for all debug-related code), but it's outside of the scope of this PR.

…lobal

Adds the `getDeferBlocks` function to the global `ng` namespace which returns information about all `@defer` blocks inside of a DOM node. This information can be useful either directly in the browser console or to implement future functionality in the dev tools.
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 14, 2024
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 14, 2024
@AndrewKushnir
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 57f3550.

The changes were merged into the following branches: main

AndrewKushnir pushed a commit that referenced this pull request Dec 16, 2024
…59184)

Adds a field on the `TDeferBlockDetails` where we can track debugging information about the defer block. Also uses it to store text representation of the different triggers which can be shown to the dev tools.

PR Close #59184
AndrewKushnir pushed a commit that referenced this pull request Dec 16, 2024
…lobal (#59184)

Adds the `getDeferBlocks` function to the global `ng` namespace which returns information about all `@defer` blocks inside of a DOM node. This information can be useful either directly in the browser console or to implement future functionality in the dev tools.

PR Close #59184
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Jan 16, 2025
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
Removes the `prefetchTriggers` field from the `TDeferBlockDetails` since we weren't reading or writing to it anywhere.

PR Close angular#59184
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
…ngular#59184)

Adds a field on the `TDeferBlockDetails` where we can track debugging information about the defer block. Also uses it to store text representation of the different triggers which can be shown to the dev tools.

PR Close angular#59184
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
…lobal (angular#59184)

Adds the `getDeferBlocks` function to the global `ng` namespace which returns information about all `@defer` blocks inside of a DOM node. This information can be useful either directly in the browser console or to implement future functionality in the dev tools.

PR Close angular#59184
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: core Issues related to the framework runtime detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants