Skip to content
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

Migration to new Angular Control Flow syntax #3997

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

FrancescoMolinaro
Copy link
Contributor

References

Resolve #3674

Description

Migration to new Angular control flow syntax to improve readbility, type checks on Html , performances and bundle size.

Instructions for Reviewers/List of changes in this PR:

Migrated all templates and import to new syntax.

Removed all NgIf/NgFor/NgForOf/NgSwitch directives and related imports.

Added new lint rule to enforce new syntax.

Functionalities remain unaltered.

To test the rendering improvements was quite difficult as they are not really noticeable on small lists.
Therefore I mocked a list of ca. 1000 elements in /admin/registries/metadata (table with NgFor).
I did run then several tests comparing the two version (old/new) with different methods (tested in CSR):

  1. MutationObservers and performace.measure()

I did set up a mutation observer that would mark the start and the end of the performance measurament when the first and the last item in the list would enter the DOM.
The rendering time could vary based on different facotrs e.g. machine used, memory allocation etc. , so I tried to run the tests in the most similar conditions on a local machine.

In general here the render time is very similar but I will list the two best results I got (duration value is in millisecond):

Old Syntax

{
"name": "render list",
"entryType": "measure",
"startTime": 14961.10000000149,
"duration": 20.299999999254942
}

New Syntax

{
"name": "render list",
"entryType": "measure",
"startTime": 13188.5,
"duration": 19.399999998509884
}

  1. Lighthouse Performance

I have then performed some tests on with the Lightouse extension from Google , we can notice that the time also here is very similar but the total blocking time seems reduce.
Best two results I could gather:

Old syntax

Screenshot from 2025-02-14 17-14-41

New Syntax

Screenshot from 2025-02-14 17-29-17

@tdonohue tdonohue added new feature performance / caching Related to performance, caching or embedded objects high priority labels Feb 14, 2025
@tdonohue tdonohue changed the title Task/main/duracom 307 Migration to new Angular Control Flow syntax Feb 14, 2025
Copy link

Hi @FrancescoMolinaro,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority merge conflict new feature performance / caching Related to performance, caching or embedded objects
Projects
Status: 👀 Under Review
Development

Successfully merging this pull request may close these issues.

Migration to new Control Flow syntax
2 participants