From cace91a2073c893f0606cb7a8466105a1d8d8902 Mon Sep 17 00:00:00 2001 From: jdegand <70610011+jdegand@users.noreply.github.com> Date: Mon, 11 Dec 2023 19:43:13 -0500 Subject: [PATCH 1/2] docs: clarify command --- .../docs/challenges/performance/40-christmas-web-worker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/content/docs/challenges/performance/40-christmas-web-worker.md b/docs/src/content/docs/challenges/performance/40-christmas-web-worker.md index a341d4d..badff8c 100644 --- a/docs/src/content/docs/challenges/performance/40-christmas-web-worker.md +++ b/docs/src/content/docs/challenges/performance/40-christmas-web-worker.md @@ -29,4 +29,4 @@ First, create a web worker using the schematics, then move the issuing function. ### Note -Since we are inside an Nx workspace, simply replace the `ng` command with `nx` when running the schematic. +Since we are inside an Nx workspace, simply replace the `ng` command with `nx` when running the schematic with `npx`. From c26e7251e87909fb23aed9831790bcd935117d84 Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 12 Dec 2023 08:25:43 +0100 Subject: [PATCH 2/2] feat: update doc following comments --- .../challenges/performance/40-christmas-web-worker.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/src/content/docs/challenges/performance/40-christmas-web-worker.md b/docs/src/content/docs/challenges/performance/40-christmas-web-worker.md index badff8c..a1b81eb 100644 --- a/docs/src/content/docs/challenges/performance/40-christmas-web-worker.md +++ b/docs/src/content/docs/challenges/performance/40-christmas-web-worker.md @@ -19,14 +19,16 @@ This application is basic. We click on the **Discover** button to reveal the sur Since JavaScript is single-threaded, when we perform a heavy task, the browser cannot update the UI or respond to mouse clicks or any events. To free the main thread, the goal is to isolate the heavy computation into a different thread. To do so, we will need to use web workers. Web workers can run any scripts in the background, in isolation from the main thread, allowing the browser to still provide your user with a good experience. -In Angular, this technology is often underused, however, it's straightforward to create one. There is a schematic that you can find here. +In Angular, this technology is often underused, however, it's straightforward to create one. There is a schematic that you can find [here](https://angular.io/guide/web-worker). ## Statement The goal of this challenge is to create a smooth animation by isolating the heavy computation function into a web worker. -First, create a web worker using the schematics, then move the issuing function. Finally, the animation should be smooth and provide an awesome user experience. +First, create a web worker using a schematic, then move the issuing function. Finally, the animation should be smooth and the progress percentage should update, which will provide an awesome user experience. -### Note +:::note +Since we are inside an Nx workspace, simply replace the `ng` command with `nx` when running the schematic. -Since we are inside an Nx workspace, simply replace the `ng` command with `nx` when running the schematic with `npx`. +If `nx` is not install globally on your machine, prefix your command with `npx`. +:::