From 2179403f46f898900ac298e085a734473563be18 Mon Sep 17 00:00:00 2001 From: jdegand <70610011+jdegand@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:54:36 -0400 Subject: [PATCH 1/3] docs: add note to bug-cd-md --- docs/src/content/docs/challenges/angular/32-bug-cd.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/content/docs/challenges/angular/32-bug-cd.md b/docs/src/content/docs/challenges/angular/32-bug-cd.md index 5e402be..ff75a59 100644 --- a/docs/src/content/docs/challenges/angular/32-bug-cd.md +++ b/docs/src/content/docs/challenges/angular/32-bug-cd.md @@ -25,6 +25,10 @@ In this small application, we have a navigation menu to route our application to The goal of the challenge is to debug this application and make it work. +:::note +Without knowing the exact reason for the issue, you can "fix" the error and get the program to function. One such approach would be to memoize the `getMenu` function. The application might function, but you will miss the lesson of this challenge. Make sure you can explain why your fix works. +::: + ## Hints
From eab219abab95f21ffbcbdd1d0d5fdaded20f6fb3 Mon Sep 17 00:00:00 2001 From: jdegand <70610011+jdegand@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:20:43 -0400 Subject: [PATCH 2/3] docs: bug-cd-md-revision --- docs/src/content/docs/challenges/angular/32-bug-cd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/content/docs/challenges/angular/32-bug-cd.md b/docs/src/content/docs/challenges/angular/32-bug-cd.md index ff75a59..313644c 100644 --- a/docs/src/content/docs/challenges/angular/32-bug-cd.md +++ b/docs/src/content/docs/challenges/angular/32-bug-cd.md @@ -26,7 +26,7 @@ In this small application, we have a navigation menu to route our application to The goal of the challenge is to debug this application and make it work. :::note -Without knowing the exact reason for the issue, you can "fix" the error and get the program to function. One such approach would be to memoize the `getMenu` function. The application might function, but you will miss the lesson of this challenge. Make sure you can explain why your fix works. +Without knowing the exact reason for the issue, you can "fix" the error and get the program to function. One such approach would be to memoize the `getMenu` function. The application might work again, but make sure you really understand the problem and its consequences. Making it work isn't always enough; fixing this bug in the wrong way can cause a loss of performance or lead to other problems later on. ::: ## Hints @@ -40,6 +40,6 @@ Without knowing the exact reason for the issue, you can "fix" the error and get
Hint 2 -If you open the [`RouterLinkActive` source code](https://github.com/angular/angular/blob/main/packages/router/src/directives/router_link_active.ts) and go to **line 196**, Angular is calling `this.cdr.markForCheck` inside a microTask which triggers a new CD cycle. If you comment out this line, the application loads again, however the bug is not inside the Angular Framework. 😅😯 +If you open the [`RouterLinkActive` source code](https://github.com/angular/angular/blob/main/packages/router/src/directives/router_link_active.ts) and go to **line 196**, Angular is calling `this.cdr.markForCheck` inside a microTask, which triggers a new CD cycle. If you comment out this line, the application loads again, however, the bug should not be fixed by changing the Angular source code. 😅😯
From dab5143f1ff69dde95c1a1cf42e98da835329d79 Mon Sep 17 00:00:00 2001 From: jdegand <70610011+jdegand@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:33:14 -0400 Subject: [PATCH 3/3] docs: bug-cd-md-revision-2 --- docs/src/content/docs/challenges/angular/32-bug-cd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/content/docs/challenges/angular/32-bug-cd.md b/docs/src/content/docs/challenges/angular/32-bug-cd.md index 313644c..6d5ebdb 100644 --- a/docs/src/content/docs/challenges/angular/32-bug-cd.md +++ b/docs/src/content/docs/challenges/angular/32-bug-cd.md @@ -26,7 +26,7 @@ In this small application, we have a navigation menu to route our application to The goal of the challenge is to debug this application and make it work. :::note -Without knowing the exact reason for the issue, you can "fix" the error and get the program to function. One such approach would be to memoize the `getMenu` function. The application might work again, but make sure you really understand the problem and its consequences. Making it work isn't always enough; fixing this bug in the wrong way can cause a loss of performance or lead to other problems later on. +Without knowing the exact reason for the issue, you can "fix" the error and get the program to function. One such approach would be to memoize `getMenu`. The application might work again, but make sure you really understand the problem and its consequences. Making it work isn't always enough; fixing this bug in the wrong way can cause a loss of performance or lead to other problems later on. ::: ## Hints