Repository navigation
Astro 7 support - #3951
Astro 7 support#3951
Conversation
🦋 Changeset detectedLatest commit: 423f7d2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
* main: Fix Markdown processing path matching (withastro#3953) Improve Sätteri import comment (withastro#3948) i18n(de): bring outdated pages up to date (withastro#3949)
commit: |
|
|
||
| _Community Starlight plugins and Astro integrations may also need to be manually updated to work with Astro v7. If you encounter any issues, please reach out to the plugin or integration author to see if it is a known issue or if an updated version is being worked on._ | ||
|
|
||
| ⚠️ **BREAKING CHANGE:** This release drops official support for Chromium-based browsers prior to version 111 (released 07 March 2023) and Safari-based browsers prior to version 16.4 (released 27 March 2023). 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+111%2C+Edge+%3E%3D+111%2C+Firefox+%3E%3D+121%2C+Safari+%3E%3D+16.4%2C+iOS+%3E%3D+16.4%2C+not+op_mini+all). |
There was a problem hiding this comment.
Aligns with Vite 8 default browser target changes and uses the baseline-widely-available target.
In our case, the most impactful change seems to be the new range media query syntax (e.g. @media (width >= 400px)) being used.
If we ever want to avoid this, we would need to update the build.target Vite configuration option.
There was a problem hiding this comment.
Interesting 👀
I’m generally a little sceptical of Baseline (there can sometimes be important cases where older browsers are still in use, so the two-year cut-off is sometimes a bit arbitrary). But it doesn’t really make sense for Starlight to override the Vite default would be my guess. Happy to go with this and if we get feedback that people are hitting compatibility issues we can reconsider.
|
Updated the branch to the latest Astro beta version ( I also took the liberty of reorganizing some files in the |
There was a problem hiding this comment.
Initially added because with Rolldown, what is bundled with our components barrel file would slightly bring us over our CSS size-limit threshold. After testing it in our docs, Astro Docs, and a few other projects, I couldn't find any downsides and brings us way below the threshold so it ends up being a net positive.
There was a problem hiding this comment.
Very cool! Is there a reason not to use the simpler approach of adding "sideEffects": false to our package.json?
There was a problem hiding this comment.
Basically fear 😅
Using a plugin approach, we can say "mark this module and only this one as side-effect free so the lazy barrel optimization feature can be used on it". This makes me more confortable than doing that at the package level for all files without knowing all kind of other optimizations could be done based on that.
There was a problem hiding this comment.
I took the liberty of reorganizing some files in the integrations/ directory, as I was getting very confused over time, e.g. is asides.ts related to Unified or Sätteri? Now, files are prefixed with remark- or rehype- if they are Unified plugins (and vite- for Vite plugins).
delucis
left a comment
There was a problem hiding this comment.
This looks fantastic! I left some queries around the lazy barrel optimization, but I don’t think they need to block releasing this.
|
|
||
| _Community Starlight plugins and Astro integrations may also need to be manually updated to work with Astro v7. If you encounter any issues, please reach out to the plugin or integration author to see if it is a known issue or if an updated version is being worked on._ | ||
|
|
||
| ⚠️ **BREAKING CHANGE:** This release drops official support for Chromium-based browsers prior to version 111 (released 07 March 2023) and Safari-based browsers prior to version 16.4 (released 27 March 2023). 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+111%2C+Edge+%3E%3D+111%2C+Firefox+%3E%3D+121%2C+Safari+%3E%3D+16.4%2C+iOS+%3E%3D+16.4%2C+not+op_mini+all). |
There was a problem hiding this comment.
Interesting 👀
I’m generally a little sceptical of Baseline (there can sometimes be important cases where older browsers are still in use, so the two-year cut-off is sometimes a bit arbitrary). But it doesn’t really make sense for Starlight to override the Vite default would be my guess. Happy to go with this and if we get feedback that people are hitting compatibility issues we can reconsider.
| const starlightComponentsBarrelId = normalizeId( | ||
| fileURLToPath(new URL('../components.ts', import.meta.url)) | ||
| ); |
There was a problem hiding this comment.
Just to double check: is the id in the handler always the same resolved file path? I don’t want to block this PR on this detail, but it could be good to add a test to ensure this is working as expected on Windows/Unix given all the fun around paths.
There was a problem hiding this comment.
id in the handler will be resolved file paths matching our componentsBarrelIdFilter but we still need to normalize it and compare it against the resolved starlightComponentsBarrelId so we only apply the transform to our barrel file and nothing else.
There was a problem hiding this comment.
Ah yeah, I was not concerned about it applying to other stuff. I was more wondering whether there could be a scenario where the normalized file path here doesn’t match the ID Vite resolves to (so our transform wouldn’t apply and the optimization wouldn’t work).
There was a problem hiding this comment.
I see, I added a few tests that should cover path shenanigans (and I also tested on a Windows machine before and after the recent change).
There was a problem hiding this comment.
Very cool! Is there a reason not to use the simpler approach of adding "sideEffects": false to our package.json?
* main: [ci] release (withastro#3956) Astro 7 support (withastro#3951)
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.40.0` → `0.41.0`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.40.0/0.41.0) |  |  | --- ### Release Notes <details> <summary>withastro/starlight (@​astrojs/starlight)</summary> ### [`v0.41.0`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0410) [Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.40.0...@astrojs/starlight@0.41.0) ##### Minor Changes - [#​3951](withastro/starlight#3951) [`1202dd4`](withastro/starlight@1202dd4) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Adds support for Astro v7, drops support for Astro v6. ##### Upgrade Astro and dependencies⚠️ **BREAKING CHANGE:** Astro v6 is no longer supported. Make sure you [update Astro](https://docs.astro.build/en/guides/upgrade-to/v7/) and any other official integrations at the same time as updating Starlight: ```sh npx @​astrojs/upgrade ``` *Community Starlight plugins and Astro integrations may also need to be manually updated to work with Astro v7. If you encounter any issues, please reach out to the plugin or integration author to see if it is a known issue or if an updated version is being worked on.*⚠️ **BREAKING CHANGE:** This release drops official support for Chromium-based browsers prior to version 111 (released 07 March 2023) and Safari-based browsers prior to version 16.4 (released 27 March 2023). 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+111%2C+Edge+%3E%3D+111%2C+Firefox+%3E%3D+121%2C+Safari+%3E%3D+16.4%2C+iOS+%3E%3D+16.4%2C+not+op_mini+all). ##### Patch Changes - [#​3953](withastro/starlight#3953) [`a935d33`](withastro/starlight@a935d33) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Fixes Starlight Markdown processing being potentially applied to files that should not be processed. </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](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMzQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjIzNC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
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.40.0` → `^0.41.0`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.40.0/0.41.3) |  |  | | [sharp](https://sharp.pixelplumbing.com) ([source](https://github.com/lovell/sharp), [changelog](https://github.com/lovell/sharp/blob/main/docs/src/content/docs/changelog.md)) | [`0.35.2` → `0.35.3`](https://renovatebot.com/diffs/npm/sharp/0.35.2/0.35.3) |  |  | --- ### Release Notes <details> <summary>withastro/starlight (@​astrojs/starlight)</summary> ### [`v0.41.3`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0413) [Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.41.2...@astrojs/starlight@0.41.3) ##### Patch Changes - [#​3911](withastro/starlight#3911) [`1686ecc`](withastro/starlight@1686ecc) Thanks [@​timothyjordan](https://github.com/timothyjordan)! - Keeps keyboard focus inside the mobile menu while it is open, preventing focus moving to hidden interactive elements in page content. ### [`v0.41.2`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0412) [Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.41.1...@astrojs/starlight@0.41.2) ##### Patch Changes - [#​4008](withastro/starlight#4008) [`58a3520`](withastro/starlight@58a3520) Thanks [@​FrancoKaddour](https://github.com/FrancoKaddour)! - Fixes the table of contents overflowing the right edge of the viewport when a custom `--sl-content-width` value exceeds available space - [#​4015](withastro/starlight#4015) [`bdbfffc`](withastro/starlight@bdbfffc) Thanks [@​delucis](https://github.com/delucis)! - Fixes an issue where aside icons were rendered incorrectly in projects where Astro’s MDX integration had optimization disabled ### [`v0.41.1`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0411) [Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.41.0...@astrojs/starlight@0.41.1) ##### Patch Changes - [#​3967](withastro/starlight#3967) [`72e63dc`](withastro/starlight@72e63dc) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Adds 2 new icons: `link` and `link-alt`. - [#​3988](withastro/starlight#3988) [`ac55cfa`](withastro/starlight@ac55cfa) Thanks [@​delucis](https://github.com/delucis)! - Fixes a dependency resolution issue introduced in Starlight v0.41 - [#​3967](withastro/starlight#3967) [`72e63dc`](withastro/starlight@72e63dc) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Optimizes the icons of Markdown asides. ### [`v0.41.0`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0410) [Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.40.0...@astrojs/starlight@0.41.0) ##### Minor Changes - [#​3951](withastro/starlight#3951) [`1202dd4`](withastro/starlight@1202dd4) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Adds support for Astro v7, drops support for Astro v6. ##### Upgrade Astro and dependencies⚠️ **BREAKING CHANGE:** Astro v6 is no longer supported. Make sure you [update Astro](https://docs.astro.build/en/guides/upgrade-to/v7/) and any other official integrations at the same time as updating Starlight: ```sh npx @​astrojs/upgrade ``` *Community Starlight plugins and Astro integrations may also need to be manually updated to work with Astro v7. If you encounter any issues, please reach out to the plugin or integration author to see if it is a known issue or if an updated version is being worked on.*⚠️ **BREAKING CHANGE:** This release drops official support for Chromium-based browsers prior to version 111 (released 07 March 2023) and Safari-based browsers prior to version 16.4 (released 27 March 2023). 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+111%2C+Edge+%3E%3D+111%2C+Firefox+%3E%3D+121%2C+Safari+%3E%3D+16.4%2C+iOS+%3E%3D+16.4%2C+not+op_mini+all). ##### Patch Changes - [#​3953](withastro/starlight#3953) [`a935d33`](withastro/starlight@a935d33) Thanks [@​HiDeoo](https://github.com/HiDeoo)! - Fixes Starlight Markdown processing being potentially applied to files that should not be processed. </details> <details> <summary>lovell/sharp (sharp)</summary> ### [`v0.35.3`](https://github.com/lovell/sharp/releases/tag/v0.35.3) [Compare Source](lovell/sharp@v0.35.2...v0.35.3) - Tighten verification of `text` dimensions, TIFF tile dimensions and `extend` values. - Improve code bundler support by resolving path to libvips binary. - Increase default concurrency when use of `MALLOC_ARENA_MAX` is detected. - Emit warning about binaries provided by Electron for use on Linux. - Add `hasAlpha` property to output `info`. [#​4500](lovell/sharp#4500) - TypeScript: Return more precise `Buffer<ArrayBuffer>` from `toBuffer`. [#​4520](lovell/sharp#4520) [@​Andarist](https://github.com/Andarist) - Bound `clahe` width and height to avoid signed overflow. [#​4551](lovell/sharp#4551) [@​metsw24-max](https://github.com/metsw24-max) - Bound `trim` margin to avoid signed overflow. [#​4552](lovell/sharp#4552) [@​metsw24-max](https://github.com/metsw24-max) - Reject infinite values when validating numbers. [#​4553](lovell/sharp#4553) [@​metsw24-max](https://github.com/metsw24-max) - Bound extract region to libvips coordinate limit. [#​4555](lovell/sharp#4555) [@​metsw24-max](https://github.com/metsw24-max) - Verify background colour values are numbers. [#​4556](lovell/sharp#4556) [@​metsw24-max](https://github.com/metsw24-max) - Bound create and raw input dimensions to coordinate limit. [#​4558](lovell/sharp#4558) [@​metsw24-max](https://github.com/metsw24-max) - Tighten recomb and affine matrix verification. [#​4560](lovell/sharp#4560) [@​chatman-media](https://github.com/chatman-media) - Verify cache memory limit to avoid overflow. [#​4561](lovell/sharp#4561) [@​metsw24-max](https://github.com/metsw24-max) </details> --- ### Configuration 📅 **Schedule**: 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. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My44Mi4wIiwidXBkYXRlZEluVmVyIjoiNDMuODIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> --------- Co-authored-by: Paul Tibbetts <code@paultibbetts.uk> Reviewed-on: https://gitea.cloud.paultibbetts.uk/paul/dev/pulls/139 Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-committed-by: Renovate Bot <bot@renovateapp.com>

Description
This PR adds support for Astro 7.
Known issues
🟢 Many warnings (1 in dev, 6 in build) due to the use of
resolve.alias[].customResolvernow deprecated and probably related to the Astroastro:tsconfig-aliasvite plugin still using it.🟢 Warning at build time due to some plugins taking significant time during the build process which is due to the
pluginTimingsbuilt-in Rolldown check enabled by default. Feels weird in a release about speed to get warnings about some things being slow. Maybe we should disable this check by default?🟢 Type-checking issue in
packages/starlight/integrations/remark-asides.tsDirectiveAttributestype bruits/satteri#97🟢 Some duplicated heading IDs in the Sätteri databag
Remaining tasks
size-limitCSS size change (probably Vite 8/Rolldown related but need to see what and confirm the hypothesis)TODO(HiDeoo)comments.0.41.0).docs/src/content/docs/index.mdxto point to the correct version tag.