Skip to content

Commit c31661a

Browse files
committed
docs(docs): tighten the form and provider recipes and the h3 install
Address the second review of #470: - The form recipe proves the fix with inspect-forms, since explain-form-changes only shows what changed, not the current status. - The missing provider recipe leads with the stack and scan-providers when the component never reached the tree, where explain-injection answers "No injector on page", and calls a lookup from another injector partial. - The h3 install on the Vite page uses the four package manager group.
1 parent a26c1ff commit c31661a

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎apps/docs/src/content/agents/recipes.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ invalid and why, fix the cause in the code, then show me the form is valid.
3030
| Find the invalid fields | `explain-invalid-forms` |
3131
| Look at one field | `explain-field` with `form` and `path` |
3232
| See why submit does nothing | `explain-submit` |
33-
| Prove the fix | `explain-form-changes` with the marker as `after` |
33+
| See what the fix changed | `explain-form-changes` with the marker as `after` |
34+
| Prove the form is valid | `inspect-forms` with `form`, for its current status |
3435

3536
Check that the answer names the failing validator and its message for each field, not only that the form is invalid. Values that look secret stay redacted. See [Forms](./tools.md#forms).
3637

@@ -63,7 +64,7 @@ Angular looked for it and why no injector provided it, then fix the providers.
6364
| Walk the lookup path | `explain-injection` with the owner as `injector` and the token |
6465
| Read the providers at a level | `inspect-providers` |
6566

66-
`explain-error` adds the missing provider explainer, and its owner id works as the `injector` of `explain-injection`. If it says **Component: not found**, for example when a routed component fails before it is in the tree, read the stack of the error for the class that injects the token, pass that class name as `injector`, and call `scan-providers` to see where the source provides the token. Check that the answer marks each injector on the path as **provides it**, **not provided** or **hidden**. See [explain-injection](./tools.md#explain-injection).
67+
`explain-error` adds the missing provider explainer, and its owner id works as the `injector` of `explain-injection`. If it says **Component: not found**, for example when a routed component fails before it is in the tree, `explain-injection` has no injector to start from and answers **No injector on page**. Read the stack of the error for the class that injects the token, then call `scan-providers` to see where the source provides the token. A live lookup from an injector that is on the page, such as the parent route's component or `Root`, shows only part of the path. When an owner is found, check that the answer marks each injector on the path as **provides it**, **not provided** or **hidden**. See [explain-injection](./tools.md#explain-injection).
6768

6869
## Find wasted change detection
6970

‎apps/docs/src/content/getting-started/vite.md‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,22 @@ export const appConfig: ApplicationConfig = {
234234

235235
To fill the **SSR requests** table in the **SSR & HTTP** tab, add a Nitro server middleware that traces each page render. Analog runs files in `src/server/middleware` before it renders the page, on the dev server too. The middleware imports `h3`, so add `h3` 1 to your app first, the version Analog's server uses:
236236

237-
```bash
237+
```bash group="install-h3" name="pnpm" image="https://cdn.simpleicons.org/pnpm/F69220" active
238238
pnpm add h3@^1.15.0
239239
```
240240

241+
```bash group="install-h3" name="npm" image="https://cdn.simpleicons.org/npm/CB3837"
242+
npm install h3@^1.15.0
243+
```
244+
245+
```bash group="install-h3" name="yarn" image="https://cdn.simpleicons.org/yarn/2C8EBB"
246+
yarn add h3@^1.15.0
247+
```
248+
249+
```bash group="install-h3" name="bun" image="https://bun.sh/logo.svg"
250+
bun add h3@^1.15.0
251+
```
252+
241253
Then add the middleware:
242254

243255
```ts

0 commit comments

Comments
 (0)