From 490c6eff34ab408c4f55777b7b0caa16787dd3d4 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Fri, 19 Jan 2024 02:13:08 +0100 Subject: Refactor virtual module system for layout components (#1383) Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com> --- .changeset/chatty-drinks-act.md | 9 ++ packages/starlight/components/Footer.astro | 4 +- packages/starlight/components/Header.astro | 12 +- .../starlight/components/MobileMenuFooter.astro | 4 +- packages/starlight/components/Page.astro | 32 +++-- packages/starlight/components/PageFrame.astro | 2 +- packages/starlight/components/PageSidebar.astro | 7 +- packages/starlight/components/Sidebar.astro | 2 +- .../starlight/integrations/virtual-user-config.ts | 11 +- packages/starlight/virtual.d.ts | 149 ++++++++++++++++----- 10 files changed, 163 insertions(+), 69 deletions(-) create mode 100644 .changeset/chatty-drinks-act.md diff --git a/.changeset/chatty-drinks-act.md b/.changeset/chatty-drinks-act.md new file mode 100644 index 00000000..4ec5a604 --- /dev/null +++ b/.changeset/chatty-drinks-act.md @@ -0,0 +1,9 @@ +--- +'@astrojs/starlight': minor +--- + +Refactors Starlight’s internal virtual module system for components to avoid circular references + +This is a change to an internal API. +If you were importing the internal `virtual:starlight/components` module, this no longer exists. +Update your imports to use the individual virtual modules now available for each component, for example `virtual:starlight/components/EditLink`. diff --git a/packages/starlight/components/Footer.astro b/packages/starlight/components/Footer.astro index f5936f01..a63eeb8d 100644 --- a/packages/starlight/components/Footer.astro +++ b/packages/starlight/components/Footer.astro @@ -1,7 +1,9 @@ --- import type { Props } from '../props'; -import { EditLink, LastUpdated, Pagination } from 'virtual:starlight/components'; +import EditLink from 'virtual:starlight/components/EditLink'; +import LastUpdated from 'virtual:starlight/components/LastUpdated'; +import Pagination from 'virtual:starlight/components/Pagination'; ---