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

Refactor: app config and header component signals #2427

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

chrismclarke
Copy link
Member

@chrismclarke chrismclarke commented Sep 18, 2024

PR Checklist

  • PR title descriptive (can be used in release notes)

TODO

Description

Following recent improvements to app config handling, update the main app.component.ts and app.header.ts to make use of signals, computes and effects. These should be generally more performant and simplify some of the more complex usage patterns (e.g. rxjs observable subscriptions)

Review Notes

See demo below triggering skin change which should also trigger knock-ons to theme, header and footer config. These appeared to all be working as expected when testing locally, but would be good to verify

Screenity.video.-.Sep.18.2024.webm

Dev Notes

I've started just refactoring these components as they are the most visible in the app and so should have the most immediate benefit/impact. There's around 10-15 additional services which call the appConfigService and could potentially be refactored, although most of these are less related to UI (but would still likely benefit from more fine-grained update handling).

It's hard to measure the exact performance improvements, although see benchmarks from angular profiler below. These are skewed however as angular change detection runs more greedily in development mode than production anyways, but should still give some indication

Git Issues

Closes #

Screenshots/Videos

Before
Using angular devtools profiler, can see while switching skins a huge number of change detection cycles triggered
image

After
Minimal detection cycles triggered
image

@github-actions github-actions bot added the maintenance Core updates, refactoring and code quality improvements label Sep 18, 2024
@github-actions github-actions bot added the scripts Work on backend scripts and devops label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Core updates, refactoring and code quality improvements scripts Work on backend scripts and devops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant