Skip to content

Clean up some Astro and Docs stuff#42355

Open
mdo wants to merge 1 commit intov6-devfrom
v6-astro-cleanup
Open

Clean up some Astro and Docs stuff#42355
mdo wants to merge 1 commit intov6-devfrom
v6-astro-cleanup

Conversation

@mdo
Copy link
Copy Markdown
Member

@mdo mdo commented Apr 23, 2026

  • Enabled prettier-plugin-astro in site/.prettierrc.json so docs-prettier-check actually checks .astro files, then ran --write across the site to catch drift it had been silently missing.
  • Wrapped the adjacent <Stylesheet /> / <ScssProd.default /> in Head.astro in a JSX fragment so the newly-enabled Astro Prettier plugin parses it cleanly.
  • Deleted the dead site/src/assets/snippets.js (nothing imported it) and removed its entry from eslint.config.js.
  • Added a @bootstrap path alias (tsconfig + Vite resolve.alias) pointing at dist/js/bootstrap.bundle.js, and replaced every ../../../../dist/js/bootstrap.bundle.js import with it — 7 files: site/src/assets/partials/snippets.js, site/src/assets/partials/toc.js, site/src/libs/clipboard.ts, site/src/components/shortcodes/Code.astro, ButtonPlayground.astro, MenuPlacementPlayground.astro, NavbarPlacementPlayground.astro. Keeps every docs script importing from a single module instance (no duplicated component registries).
  • Harmonized the "internal docs helper, don't reuse this" banner comment across application.js, search.js, partials/sidebar.js, partials/sticky.js, partials/toc.js, partials/snippets.js, and stackblitz.js.
  • Dropped the unused @assets/* tsconfig path alias.
  • Removed the unused layout prop from Stylesheet.astro (and the two callers in Head.astro / ExamplesLayout.astro).
  • Added an explanatory comment next to the is:inline color-modes.js references in Head.astro and ExamplesLayout.astro documenting why it stays outside the Vite pipeline (needs to render-block pre-paint to avoid a flash of the wrong theme).
  • Looked at collapsing DocsScripts.astro into Scripts.astro but Astro bundles <script> per component file, so inlining it under a {layout === 'docs' && ...} guard either breaks bundling or always-loads the StackBlitz SDK — kept it split and added a comment explaining why.
  • Exported SidebarGroup / SidebarItem / SidebarSubItem types inferred from the Zod sidebar schema in libs/data.ts, and swapped the any casts in DocsSidebar.astro + DocsLayout.astro for the real types. Added a null guard on item.title in DocsSidebar.astro since the schema field is optional.
  • Consolidated stripMarkdown / processMarkdownToHtml in libs/utils.ts onto a single remark + remark-html pipeline, dropping the direct mdast-util-from-markdown / mdast-util-to-string imports in the process.
  • Removed the @oddbird/css-anchor-positioning polyfill <script> from Head.astro and uninstalled the devDep — nothing in v6-dev actually declares anchor-name (that work lives on the unmerged feature/popover-api-anchor-positioning branch), so the polyfill was a no-op on every page. Easy to add back when that branch lands.

@mdo mdo requested a review from julien-deramond April 23, 2026 18:17
@mdo mdo requested a review from a team as a code owner April 23, 2026 18:17
@mdo mdo added the docs label Apr 23, 2026
@mdo mdo added this to v6.0.0 Apr 23, 2026
@mdo mdo added the v6 label Apr 23, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in v6.0.0 Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

1 participant