Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
daea539
feat: update to `beta.3`
HiDeoo Jun 11, 2026
a4dccbe
feat: remove badge and icon trailing whitespace workaround
HiDeoo Jun 11, 2026
0459d9b
test: update anchor headings test
HiDeoo Jun 11, 2026
5624478
docs: remove outdated banner
HiDeoo Jun 11, 2026
76bafd6
docs: add upgrade banner
HiDeoo Jun 11, 2026
73271ee
chore: tweak some comments
HiDeoo Jun 11, 2026
f94b906
chore: update various packages
HiDeoo Jun 15, 2026
0df3f22
feat: experiment with lazy barrel optimization
HiDeoo Jun 15, 2026
85cf5ac
Merge branch 'main' into hd/feat-astro-7
HiDeoo Jun 15, 2026
b88da64
chore: add changeset
HiDeoo Jun 15, 2026
49f42aa
chore: update browserlist query
HiDeoo Jun 15, 2026
e73b902
chore: format changeset
HiDeoo Jun 15, 2026
f6cd257
feat: update `@astrojs/node@11.0.0-beta.2`
HiDeoo Jun 16, 2026
2d2f52b
refactor: `virtual-user-config` → `vite-virtual-modules`
HiDeoo Jun 16, 2026
df24995
feat: use satteri by default
HiDeoo Jun 16, 2026
40d8456
feat: disable link validation
HiDeoo Jun 16, 2026
6dbc2ab
refactor: `integration/` directory cleanup
HiDeoo Jun 16, 2026
7587dff
Merge branch 'main' into hd/feat-astro-7
HiDeoo Jun 22, 2026
0107788
feat: update to `beta.6`
HiDeoo Jun 22, 2026
7af9692
fix: remove outdated todo
HiDeoo Jun 22, 2026
b991bbf
feat: update to stable astro packages
HiDeoo Jun 23, 2026
7553fb2
feat: bump starlight required veresion in `@astrojs/starlight-markdoc`
HiDeoo Jun 23, 2026
cb29dc8
chore: cleanup `minimumReleaseAgeExclude`
HiDeoo Jun 23, 2026
12f6aa6
feat: update `astro@7.0.2`
HiDeoo Jun 23, 2026
73626e1
fix: more explicit `componentsBarrelIdFilter`
HiDeoo Jun 23, 2026
423f7d2
test: `vitePluginStarlightLazyBarrelOptimization`
HiDeoo Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/fancy-swans-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'@astrojs/starlight': minor
---

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).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

11 changes: 11 additions & 0 deletions .changeset/hot-eggs-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@astrojs/starlight-markdoc': minor
---

⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now 0.41.0

Please use the `@astrojs/upgrade` command to upgrade your project:

```sh
npx @astrojs/upgrade
```
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ To add a language, you will need its BCP-47 tag and a label. See [“Adding a ne

- Components that require client-side JavaScript or CSS should use JavaScript/CSS features that are well-supported by browsers.

You can find a list of supported browsers and their versions using this [browserslist query](https://browsersl.ist/#q=%3E+0.5%25%2C+not+dead%2C+Chrome+%3E%3D+105%2C+Edge+%3E%3D+105%2C+Firefox+%3E%3D+121%2C+Safari+%3E%3D+15.4%2C+iOS+%3E%3D+15.4%2C+not+op_mini+all). To check whether or not a feature is supported, you can visit the [Can I use](https://caniuse.com) website and search for the feature.
You can find a list of 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). To check whether or not a feature is supported, you can visit the [Can I use](https://caniuse.com) website and search for the feature.

[discord]: https://astro.build/chat
[issues]: https://github.com/withastro/starlight/issues
Expand Down
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build": "astro build",
"preview": "astro preview",
"typecheck": "tsc --noEmit",
"linkcheck": "CHECK_LINKS=true pnpm build",
"linkcheck": "echo \"Skipping link validation: starlight-links-validator is not compatible with Sätteri yet.\"",
"astro": "astro",
"lunaria:build": "lunaria build",
"grammars": "node grammars/generate.mjs"
Expand All @@ -21,14 +21,14 @@
"@astrojs/starlight": "workspace:*",
"@lunariajs/core": "^0.1.1",
"@types/culori": "^4.0.1",
"astro": "^6.4.5",
"astro": "^7.0.0",
"culori": "^4.0.2",
"sharp": "^0.34.5"
},
"devDependencies": {
"@playwright/test": "^1.59.1",
"axe-playwright": "^2.2.2",
"sitemapper": "^4.1.5",
"starlight-links-validator": "^0.23.0"
"starlight-links-validator": "^0.24.1"
}
}
6 changes: 6 additions & 0 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ description: Starlight helps you build beautiful, high-performance documentation
template: splash
editUrl: false
lastUpdated: false
banner:
content: |
Updating to Astro 7?
<a href="https://github.com/withastro/starlight/releases/tag/%40astrojs/starlight%400.41.0">
Learn how to upgrade
</a>
hero:
title: Make your docs shine with Starlight
tagline: Everything you need to build a stellar documentation website. Fast, accessible, and easy-to-use.
Expand Down
6 changes: 0 additions & 6 deletions docs/src/content/docs/pt-pt/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ description: Starlight ajuda-te a construir websites de documentação belos e r
template: splash
editUrl: false
lastUpdated: false
banner:
content: |
Atualização para o Astro 5?
<a href="https://github.com/withastro/starlight/releases/tag/%40astrojs/starlight%400.30.0">
Aprenda como fazer
</a>
hero:
title: Faça a sua documentação brilhar com Starlight
tagline: Tudo o que precisa para construir um site de documentação brilhante. Rápido, acessível e fácil de usar.
Expand Down
6 changes: 0 additions & 6 deletions docs/src/content/docs/uk/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ description: Starlight допомагає створювати якісну й
template: splash
editUrl: false
lastUpdated: false
banner:
content: |
Оновлюєтесь до Astro 5?
<a href="https://github.com/withastro/starlight/releases/tag/%40astrojs/starlight%400.30.0">
Дізнайтеся, як оновити
</a>
hero:
title: Осяйте вашу документацію зі Starlight
tagline: Усе, що треба для створення блискучого сайту з документацією. Швидко, доступно та без зайвих складнощів.
Expand Down
6 changes: 0 additions & 6 deletions docs/src/content/docs/zh-cn/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ description: Starlight 帮助你使用 Astro 构建漂亮、高性能的文档
template: splash
editUrl: false
lastUpdated: false
banner:
content: |
更新到 Astro 5?
<a href="https://github.com/withastro/starlight/releases/tag/%40astrojs/starlight%400.30.0">
了解如何升级
</a>
hero:
title: Starlight <br/> 使你的文档闪耀夺目
tagline: 快速、易用、易于访问 —— 构建卓越文档网站所需的一切。
Expand Down
2 changes: 1 addition & 1 deletion examples/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@astrojs/starlight": "^0.40.0",
"astro": "^6.4.5",
"astro": "^7.0.0",
"sharp": "^0.34.5"
}
}
4 changes: 2 additions & 2 deletions examples/markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/markdoc": "^1.0.4",
"@astrojs/markdoc": "^2.0.0",
"@astrojs/starlight": "^0.40.0",
"@astrojs/starlight-markdoc": "^0.6.0",
"astro": "^6.4.5",
"astro": "^7.0.0",
"sharp": "^0.34.5"
}
}
2 changes: 1 addition & 1 deletion examples/tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@astrojs/starlight": "^0.40.0",
"@astrojs/starlight-tailwind": "^5.0.0",
"@tailwindcss/vite": "^4.2.4",
"astro": "^6.4.5",
"astro": "^7.0.0",
"sharp": "^0.34.5",
"tailwindcss": "^4.2.4"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@changesets/cli": "^2.31.0",
"@eslint/js": "^10.0.1",
"@size-limit/file": "^12.1.0",
"astro": "^6.4.5",
"astro": "^7.0.0",
"eslint": "^10.3.0",
"eslint-config-prettier": "^10.1.8",
"globals": "^17.6.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"./components": "./components.ts"
},
"devDependencies": {
"@astrojs/markdoc": "^1.0.4",
"@astrojs/markdoc": "^2.0.0",
"@astrojs/starlight": "workspace:*",
"vitest": "^4.1.5"
},
"peerDependencies": {
"@astrojs/markdoc": "^1.0.0",
"@astrojs/starlight": ">=0.38.0"
"@astrojs/markdoc": "^2.0.0",
"@astrojs/starlight": ">=0.41.0"
},
"publishConfig": {
"provenance": true
Expand Down
47 changes: 9 additions & 38 deletions packages/starlight/__e2e__/basics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,39 +344,6 @@ test.describe('components', () => {
});
});

test.describe('whitespaces', () => {
/**
* Components including styles include a trailing whitespace which can be problematic when used
* inline, e.g.:
*
* ```mdx
* Badge (<Badge text="test" />)
* ```
*
* The example above would render as:
*
* ```
* Badge (test )
* ```
*
* Having a component being responsible for its own spacing is not ideal and should be avoided
* especially when used inline.
* To work around this issue, such components can be wrapped in a fragment.
*
* @see https://github.com/withastro/compiler/issues/1003
*/
test('does not include components having trailing whitespaces when used inline', async ({
page,
getProdServer,
}) => {
const starlight = await getProdServer();
await starlight.goto('/whitespaces');

expect(await page.getByTestId('badge').textContent()).toContain('Badge (Note)');
expect(await page.getByTestId('icon').textContent()).toContain('Icon ()');
});
});

test.describe('anchor headings', () => {
test('renders the same content for Markdown headings and Astro component', async ({
getProdServer,
Expand All @@ -385,14 +352,18 @@ test.describe('components', () => {
const starlight = await getProdServer();

await starlight.goto('/anchor-heading');
const markdownContent = page.locator('.sl-markdown-content');
const markdownHtml = await markdownContent.innerHTML();
const markdownHeadings = await page
.locator('.sl-markdown-content .sl-heading-wrapper')
.evaluateAll((headings) => headings.map((heading) => heading.outerHTML));

await starlight.goto('/anchor-heading-component');
const componentContent = page.locator('.sl-markdown-content');
const componentHtml = await componentContent.innerHTML();
const componentHeadings = await page
.locator('.sl-markdown-content .sl-heading-wrapper')
.evaluateAll((headings) => headings.map((heading) => heading.outerHTML));

expect(markdownHtml).toEqual(componentHtml);
// The Astro's Rust compiler may add insignificant whitespace between siblings so we compare
// heading wrappers individually rather than the entire content.
expect(markdownHeadings).toEqual(componentHeadings);
});

test('does not render headings anchor links for individual Markdown pages and entries not part of the `docs` collection', async ({
Expand Down
2 changes: 1 addition & 1 deletion packages/starlight/__e2e__/fixtures/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/starlight": "workspace:*",
"astro": "^6.4.5"
"astro": "^7.0.0"
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/starlight": "workspace:*",
"astro": "^6.4.5"
"astro": "^7.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/starlight/__e2e__/fixtures/git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/starlight": "workspace:*",
"astro": "^6.4.5"
"astro": "^7.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"private": true,
"dependencies": {
"@astrojs/starlight": "workspace:*",
"astro": "^6.4.5"
"astro": "^7.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/starlight/__e2e__/fixtures/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@astrojs/node": "^10.1.0",
"@astrojs/node": "^11.0.0",
"@astrojs/starlight": "workspace:*",
"astro": "^6.4.5"
"astro": "^7.0.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createMarkdownProcessor } from '@astrojs/markdown-remark';
import { createSatteriMarkdownProcessor } from '@astrojs/markdown-satteri';
import type { MdastPluginDefinition } from 'satteri';
import { describe, expect, test, vi } from 'vitest';
import { remarkDirectivesRestoration } from '../../integrations/asides';
import { remarkDirectivesRestoration } from '../../integrations/remark-asides';
import { satteriDirectivesRestoration, starlightSatteriPlugins } from '../../integrations/satteri';
import { starlightRemarkPlugins } from '../../integrations/remark-rehype';
import type { StarlightUserConfig } from '../../utils/user-config';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, test } from 'vitest';
import {
getMarkdownProcessorPaths,
shouldTransformPath,
} from '../../integrations/markdown-process';
} from '../../integrations/markdown-processor';
import { createPluginTestOptions } from '../test-utils';

const root = new URL('file:///path/to/project/');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { unified } from '@astrojs/markdown-remark';
import { satteri } from '@astrojs/markdown-satteri';
import { describe, expect, test, vi } from 'vitest';
import { remarkDirectivesRestoration } from '../../integrations/asides';
import { remarkDirectivesRestoration } from '../../integrations/remark-asides';
import {
applyStarlightMarkdownPlugins,
registerDirectivesRestoration,
} from '../../integrations/markdown-plugins';
import * as satteriIntegration from '../../integrations/satteri';
import * as unifiedIntegration from '../../integrations/remark-rehype';
import { createPluginTestOptions } from '../test-utils';

type Processor = Parameters<typeof applyStarlightMarkdownPlugins>[0];
Expand All @@ -21,7 +21,7 @@ describe('applyStarlightMarkdownPlugins', () => {
applyStarlightMarkdownPlugins(
processor,
await createPluginTestOptions(),
satteriIntegration,
unifiedIntegration,
logger
);

Expand All @@ -38,7 +38,7 @@ describe('applyStarlightMarkdownPlugins', () => {
applyStarlightMarkdownPlugins(
processor,
await createPluginTestOptions(),
satteriIntegration,
unifiedIntegration,
logger
);

Expand All @@ -53,7 +53,7 @@ describe('applyStarlightMarkdownPlugins', () => {
applyStarlightMarkdownPlugins(
unsupportedProcessor,
await createPluginTestOptions(),
satteriIntegration,
unifiedIntegration,
logger
);

Expand All @@ -65,15 +65,15 @@ describe('applyStarlightMarkdownPlugins', () => {
describe('registerDirectivesRestoration', () => {
test('registers the mdast restoration plugin on a Sätteri processor', () => {
const processor = satteri();
registerDirectivesRestoration(processor, satteriIntegration);
registerDirectivesRestoration(processor, unifiedIntegration);
expect(processor.options.mdastPlugins.map((plugin) => plugin.name)).toContain(
'starlight-directives-restoration'
);
});

test('registers the remark restoration plugin on a unified processor', () => {
const processor = unified();
registerDirectivesRestoration(processor, satteriIntegration);
registerDirectivesRestoration(processor, unifiedIntegration);
expect(processor.options.remarkPlugins).toContain(remarkDirectivesRestoration);
});
});
2 changes: 1 addition & 1 deletion packages/starlight/__tests__/markdown-processor/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createMarkdownProcessor, type MarkdownRenderer } from '@astrojs/markdown-remark';
import { createSatteriMarkdownProcessor } from '@astrojs/markdown-satteri';
import { beforeAll, describe } from 'vitest';
import { remarkDirectivesRestoration } from '../../integrations/asides';
import { remarkDirectivesRestoration } from '../../integrations/remark-asides';
import { starlightRehypePlugins, starlightRemarkPlugins } from '../../integrations/remark-rehype';
import { satteriDirectivesRestoration, starlightSatteriPlugins } from '../../integrations/satteri';
import type { StarlightUserConfig } from '../../utils/user-config';
Expand Down
Loading
Loading