Skip to content

refactor(core): use version>0 instead of hasRun#62467

Closed
milomg wants to merge 1 commit intoangular:mainfrom
milomg:has-run
Closed

refactor(core): use version>0 instead of hasRun#62467
milomg wants to merge 1 commit intoangular:mainfrom
milomg:has-run

Conversation

@milomg
Copy link
Copy Markdown
Member

@milomg milomg commented Jul 4, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #63667

What is the new behavior?

This saves a field for effect and watch nodes. Additionally, it should make effect nodes flash in the devtools when they rerun.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jul 4, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 4, 2025
return;
}
this.hasRun = true;
this.version++;
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 guess setting a value to true will be cheaper memory wise, as there would be no need to allocate memory for each new value that ++ generates, while the boolean flag only allocates memory once, and uses that memory location.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's just a number though (fixed 64 bit), It shouldn't really matter ?

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.

This has to go through the perf benchmarks I guess.

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.

In fact, in V8 this is going to be stored as an SMI (so a 32 bit integer). So unless there will be 2 billion increments, the impact is pretty minimal.

this saves a field for effect and watch nodes
@milomg milomg marked this pull request as ready for review September 11, 2025 17:35
@pullapprove pullapprove bot added the requires: TGP This PR requires a passing TGP before merging is allowed label Sep 11, 2025
@AndrewKushnir AndrewKushnir requested review from alxhub and removed request for AndrewKushnir September 12, 2025 00:49
@thePunderWoman
Copy link
Copy Markdown
Contributor

thePunderWoman commented Sep 16, 2025

TESTED=TGP

Copy link
Copy Markdown
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

LGTM

reviewed-for: fw-general, public-api, primitives

@thePunderWoman
Copy link
Copy Markdown
Contributor

TGP is green. Safe to merge

@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Sep 22, 2025
@ngbot
Copy link
Copy Markdown

ngbot bot commented Sep 22, 2025

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "google-internal-tests" is failing
    pending status "pullapprove" is pending
    pending 1 pending code review

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@tbondwilkinson
Copy link
Copy Markdown
Contributor

LGTM

reviewed-for: primitives-shared

@tbondwilkinson tbondwilkinson self-assigned this Sep 22, 2025
@tbondwilkinson tbondwilkinson self-requested a review September 22, 2025 15:42
@tbondwilkinson tbondwilkinson removed their assignment Sep 22, 2025
@thePunderWoman thePunderWoman removed the request for review from ENAML September 22, 2025 16:51
thePunderWoman pushed a commit that referenced this pull request Sep 22, 2025
this saves a field for effect and watch nodes

PR Close #62467
@thePunderWoman
Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

@milomg milomg deleted the has-run branch September 24, 2025 02:51
@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 Oct 25, 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: core Issues related to the framework runtime requires: TGP This PR requires a passing TGP before merging is allowed target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants