Commit 90cc273
committed
Fix Twoslash polyfill mismatches in new 2.2 docs
Since PR #768 made Fedify's generated `.d.ts` resolve `Temporal`
through the ambient `lib.esnext.temporal` namespace, Twoslash blocks
that import `Temporal` from `@js-temporal/polyfill` and then construct
a Fedify vocab object fail with TS2322 ("until(...).sign" mismatch).
Merging 2.1.13 into 2.2-maintenance surfaced four docs added on the
2.2 line where this happens.
The rule depends on whether the polyfill import is visible to readers:
- Hidden by `---cut-before---` / `---cut---` (type-check-only
context): drop the line. The ambient `Temporal` from
`lib.esnext.temporal` then resolves the references, leaving the
rendered output untouched. Done in `docs/manual/migrate.md`,
`docs/manual/pragmatics.md`, and two cut-prefixed blocks in
`docs/tutorial/content-sharing.md`.
- Visible to the reader (no cut directive): the tutorial still needs
that line so Node 22-25 readers know to install the polyfill, so
keep the import and add `2322` to the block's `// @Noerrors:`
directive instead. Done in two `docs/tutorial/content-sharing.md`
blocks (the `server/federation.ts` "imports to add" snippet and
the `comments.post.ts` example).
`astro-blog.md` and `microblog.md` already shield their polyfill
imports with `// @noErrors` wildcards or plain `typescript` fences,
so they don't need changes.
`vitepress build` completes locally without errors.
#767
Assisted-by: Claude Code:claude-opus-4-71 parent 4e8c673 commit 90cc273
3 files changed
Lines changed: 2 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1787 | 1787 | | |
1788 | 1788 | | |
1789 | 1789 | | |
1790 | | - | |
1791 | | - | |
1792 | 1790 | | |
1793 | 1791 | | |
1794 | 1792 | | |
| |||
1942 | 1940 | | |
1943 | 1941 | | |
1944 | 1942 | | |
1945 | | - | |
1946 | | - | |
1947 | 1943 | | |
1948 | 1944 | | |
1949 | 1945 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
553 | 552 | | |
554 | 553 | | |
555 | 554 | | |
| |||
587 | 586 | | |
588 | 587 | | |
589 | 588 | | |
590 | | - | |
591 | 589 | | |
592 | 590 | | |
593 | 591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3465 | 3465 | | |
3466 | 3466 | | |
3467 | 3467 | | |
3468 | | - | |
| 3468 | + | |
3469 | 3469 | | |
3470 | 3470 | | |
3471 | 3471 | | |
| |||
3506 | 3506 | | |
3507 | 3507 | | |
3508 | 3508 | | |
3509 | | - | |
3510 | 3509 | | |
3511 | 3510 | | |
3512 | 3511 | | |
| |||
6516 | 6515 | | |
6517 | 6516 | | |
6518 | 6517 | | |
6519 | | - | |
| 6518 | + | |
6520 | 6519 | | |
6521 | 6520 | | |
6522 | 6521 | | |
| |||
6706 | 6705 | | |
6707 | 6706 | | |
6708 | 6707 | | |
6709 | | - | |
6710 | 6708 | | |
6711 | 6709 | | |
6712 | 6710 | | |
| |||
0 commit comments