Use Sätteri 0.10 APIs - #4134
Conversation
🦋 Changeset detectedLatest commit: a9e00b1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
* main: Use a page-specific counter for `<Tabs>` IDs (withastro#4133) Add starlight-pydocs and starlight-quiz (withastro#4130)
## What does this PR do? Brings `apps/docs` up to the dependency set the documentation work assumes. Nothing behaves differently — `astro.config.mjs` is untouched and the rendered site is byte-identical apart from Starlight dropping a dead `pageHide` listener (the DOM event is `pagehide`, so it never fired). Verified by snapshotting `dist/` before the change and diffing after a forced rebuild: same file set, and that one script line is the only delta across both pages, modulo scoped-style and asset hashes. Closes #1852 ### The Starlight range needs a note The ticket asked for `>=0.41.5` "a patch bump inside the existing range". The specifier is `>=0.41.5 <0.41.7` rather than a caret, because `^0.41.5` floats to `0.41.7`, which does not type-check. `0.41.7` shipped on 5 August with `@astrojs/markdown-satteri: ^0.3.5` and its own `satteri: ^0.9.1` — consistent then, since `0.3.5` and `0.3.6` were still on `satteri@^0.9.1`. On 19 August `@astrojs/markdown-satteri@0.3.7` moved to `satteri@^0.10.3` and that range swallowed it. Two Sätteri copies now meet inside Starlight's own `integrations/markdown-plugins.ts`, which `pnpm typecheck` compiles from source, so the docs app fails to type-check on a dependency it never imports. Confirmed upstream rather than a local resolution artefact: it reproduces on `0.41.6` and `0.41.7` with `astro` at both `7.1.1` and `7.2.4`, and forcing `satteri` to `0.10.5` through `pnpm.overrides` only swaps it for a different genuine error in the same file, because Starlight's code targets satteri 0.9. Starlight is migrating in [withastro/starlight#4134](withastro/starlight#4134), blocked on an Astro release carrying [withastro/astro#17766](withastro/astro#17766) (merged, unreleased). `apps/docs/README.md` records the constraint; #1865 tracks lifting it. ### Knip The five new dependencies have no consumer yet — that is the point of the prefactor — so each is listed in knip's `apps/docs` ignore set with a note on which ticket wires it up. ### Reviewer notes - `apps/docs` gets `vitest` without `@plumix/vitest-config`, coverage, or a `test:unit` script, unlike every other vitest-having package. Those belong with the content-check suite ticket. - The cap could alternatively live in root `pnpm.overrides`, the repo's existing mechanism for blocking a bad upstream version. I put it on the dependency so the acceptance criterion's floor and the upstream break sit where a reader is already looking; happy to move it. - No changeset: `apps/docs` is private. ## Type of change - [ ] Bug fix - [ ] Feature (requires [approved Discussion](https://github.com/withplumix/plumix/discussions/categories/ideas)) - [ ] Refactor (no behavior change) - [ ] Documentation - [ ] Performance improvement - [ ] Tests - [x] Chore (dependencies, CI, tooling) ## Checklist - [x] `pnpm typecheck` passes - [x] `pnpm lint` passes - [x] `pnpm build` passes - [ ] I have added/updated tests for my changes (if applicable) `pnpm format`, `pnpm knip`, `pnpm test` and `pnpm install --frozen-lockfile` also pass. No tests added: this change installs dependencies and wires nothing up. The suite that exercises them lands with the content-check ticket. ## AI-generated code disclosure - [x] This PR includes AI-generated code ## Screenshots No admin UI change.
* main: [ci] release (withastro#4137) Fix localisation of Expressive Code UI (withastro#4138) chore: migrate Changesets to v3 (withastro#4139) Add WhatsApp icon (withastro#4142) docs: add starlight-custom-navigation to plugins showcase (withastro#4141) [ci] format i18n(de): update plugins.mdx (withastro#4140) i18n(ko-KR): update `plugins` (withastro#4136)
delucis
left a comment
There was a problem hiding this comment.
This looks great, @HiDeoo! Thanks for taking the time to bring these all up-to-date for the bright and glorious Sätteri future.
The diff is a little harder to read because Git doesn’t recognise things as renames that it probably should. For anyone else curious, I ended up copy-pasting the before/after processor files into https://www.diffchecker.com/ to visualise what actually changed (not much, very clean).
I guess we’ll probably be able to remove the TODO in pnpm-workspace.yaml by merge time given this will be in a minor, but everything else looks good to me here 🙌
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
* main: [ci] release (withastro#4153) i18n(fr): update `resources/plugins.mdx` (withastro#4147) Add Goodreads icon (withastro#4145) [i18nIgnore] docs: update theme links (withastro#4152) i18n(de): update plugins.mdx (withastro#4151) i18n(ko-KR): update `plugins.mdx` (withastro#4146)
commit: |
* main: [ci] release (withastro#4161) feat: add npmx icon (withastro#4159) Add Hypothesis icon (withastro#4156) Add Expressive Code missing translations based on Astro Docs (withastro#4160) docs: add herdr showcase (withastro#4158) [i18nIgnore] docs: reduce 3rd party content weight in search results (withastro#4143)
* main: [i18nIgnore] Transpile Starlight packages (withastro#3572) i18n(ru): update translations (withastro#4170) [ci] release (withastro#4169) Fix hidden heading anchor links (withastro#4167) perf: optimize route and sidebar lookups (withastro#4148) chore: add benchmarks (withastro#4157)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@astrojs/starlight](https://starlight.astro.build) ([source](https://github.com/withastro/starlight/tree/HEAD/packages/starlight)) | [`0.41.11` → `0.42.0`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.41.11/0.42.0) |  |  | --- ### Release Notes <details> <summary>withastro/starlight (@​astrojs/starlight)</summary> ### [`v0.42.0`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0420) [Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.41.11...@astrojs/starlight@0.42.0) ##### Minor Changes - [#​3572](withastro/starlight#3572) [`292fb17`](withastro/starlight@292fb17) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Distributes package as JavaScript files with dedicated type declaration files instead of TypeScript source files. - [#​4121](withastro/starlight#4121) [`2623ae6`](withastro/starlight@2623ae6) Thanks [@​delucis](https://github.com/delucis)! - Simplifies markup for Starlight’s mobile menu toggle **⚠️ Potentially breaking change:** If you use a theme plugin, custom styles, or component overrides targeting the `MobileMenuToggle` button or `PageFrame` components, you may need to adjust these for the new markup. The button is no longer wrapped in a `<starlight-menu-button>` custom element and no longer uses the `aria-expanded` attribute. Instead, you can use the `.sl-menu-button` class name to target the button and the `:popover-open` pseudo-class to style the menu open state specifically. In the following example, custom styles for the menu button are updated for the new approach: ```diff - starlight-menu-button button { + .sl-menu-button { color: var(--sl-color-text); } - starlight-menu-button[aria-expanded='true'] button { + .sl-menu-button:has(~ :popover-open) { color: var(--sl-color-text-accent-high); } ``` See [`MobileMenuToggle.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/components/MobileMenuToggle.astro) and [`PageFrame.astro`](https://github.com/withastro/starlight/blob/main/packages/starlight/components/PageFrame.astro) on GitHub for the full source code of the updated components. - [#​3572](withastro/starlight#3572) [`292fb17`](withastro/starlight@292fb17) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Removes the `tagline` configuration option, which was never used. If your configuration included a `tagline` option, you can safely remove it without any replacement. - [#​4134](withastro/starlight#4134) [`6135f01`](withastro/starlight@6135f01) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Updates internal `@astrojs/mdx`, `@astrojs/markdown-satteri`, and `satteri` dependencies.⚠️ **BREAKING CHANGE:** The following minimum versions are now required: - `astro` v7.2.10 or later - `@astrojs/markdown-satteri` 0.4.0 or later (if you use it) - `@astrojs/markdown-remark` 7.3.0 or later (if you use it) Please update Starlight and Astro together: ```sh npx @astrojs/upgrade ``` - [#​4121](withastro/starlight#4121) [`2623ae6`](withastro/starlight@2623ae6) Thanks [@​delucis](https://github.com/delucis)! - Refactors Starlight’s mobile menu toggle to work when JavaScript fails or is disabled⚠️ **BREAKING CHANGE:** This release drops official support for Chromium-based browsers prior to version 116 (released August 2023), Safari-based browsers prior to version 17.0 (released September 2023), and Firefox prior to version 125 (released April 2024). You can find a list of currently supported browsers and their versions using this [browserslist query](https://browsersl.ist/#q=%3E+0.5%25%2C+not+dead%2C+Chrome+%3E%3D+116%2C+Edge+%3E%3D+116%2C+Firefox+%3E%3D+125%2C+Safari+%3E%3D+17.0%2C+iOS+%3E%3D+17.0%2C+not+op_mini+all). This change also removes the `data-mobile-menu-expanded` attribute, which was previously added to `<body>` while the mobile menu is open. If you have custom code that was depending on this attribute, you will need to update it to use a new selector to check if the mobile menu is open. In the following example, a custom background colour for the site header while the menu is open is updated for the new approach: ```diff - [data-mobile-menu-expanded] header { + body:has(sl-sidebar-pane:popover-open) header { background-color: var(--sl-color-bg); } ``` </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC42NS4yIiwidXBkYXRlZEluVmVyIjoiNDQuNjUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Description
This PR refactors some of the code to use the new Sätteri 0.10 APIs now available in Astro 7.2.4 (but technically 7.2.5 for a fix).
One of the most meaningful change is our components that were previously using rehype and creating processors to parse the default slot content are now using the new Sätteri
htmlToHast()API.Regarding the changeset, not quite sure yet the level of details we should use, e.g. should we just say we updated some deps or go as far as mentioning that we can now only check paths to transform once per plugin type thanks to Sätteri conditional plugin bundles.
Note that GitHub displays some renamed files as deletions + additions because they changed significantly (mostly indentations tho). The rename-only commit may be easier to review separately.
Remaining tasks
<Tabs>IDs #4133 is merged.TODO(HiDeoo)comments.