Conversation
9d44bd9 to
7126785
Compare
There was a problem hiding this comment.
I understand why this file is being removed in this PR given the current state of v6. However, we were already facing an issue prior to this change: StackBlitz no longer works when a component requires JavaScript (e.g. Tooltips).
I'm fine merging this PR as is, but it raises a broader question: do we still want to support the StackBlitz feature? I’ve noticed that on most component pages, the button isn’t even present anymore.
In other words, should I open a follow-up PR to restore StackBlitz support, or remove it entirely from the docs?
There was a problem hiding this comment.
Due to the noise generated by the Prettier modifications, I cannot guarantee that I have caught every detail. Regarding the JavaScript loading changes, modifications in site/src/assets/partials/snippets.js and related files appear to function correctly in the following three environments:
- Locally, using
npm run start(tested with tooltips and popovers). - Using the sequence
npm run release ; npm run docs ; cd _site ; http-server(tested with tooltips, popovers, and toasts). - On the Netlify deployment (tested with tooltips, popovers, and toasts).
Before merging, there's this question over here @mdo so I can know how to handle Stackblitz: #42355 (comment)
prettier-plugin-astroinsite/.prettierrc.jsonsodocs-prettier-checkactually checks.astrofiles, then ran--writeacross the site to catch drift it had been silently missing.<Stylesheet />/<ScssProd.default />inHead.astroin a JSX fragment so the newly-enabled Astro Prettier plugin parses it cleanly.site/src/assets/snippets.js(nothing imported it) and removed its entry fromeslint.config.js.@bootstrappath alias (tsconfig + Viteresolve.alias) pointing atdist/js/bootstrap.bundle.js, and replaced every../../../../dist/js/bootstrap.bundle.jsimport 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).application.js,search.js,partials/sidebar.js,partials/sticky.js,partials/toc.js,partials/snippets.js, andstackblitz.js.@assets/*tsconfig path alias.layoutprop fromStylesheet.astro(and the two callers inHead.astro/ExamplesLayout.astro).is:inlinecolor-modes.jsreferences inHead.astroandExamplesLayout.astrodocumenting why it stays outside the Vite pipeline (needs to render-block pre-paint to avoid a flash of the wrong theme).DocsScripts.astrointoScripts.astrobut 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.SidebarGroup/SidebarItem/SidebarSubItemtypes inferred from the Zod sidebar schema inlibs/data.ts, and swapped theanycasts inDocsSidebar.astro+DocsLayout.astrofor the real types. Added a null guard onitem.titleinDocsSidebar.astrosince the schema field is optional.stripMarkdown/processMarkdownToHtmlinlibs/utils.tsonto a singleremark+remark-htmlpipeline, dropping the directmdast-util-from-markdown/mdast-util-to-stringimports in the process.@oddbird/css-anchor-positioningpolyfill<script>fromHead.astroand uninstalled the devDep — nothing inv6-devactually declaresanchor-name(that work lives on the unmergedfeature/popover-api-anchor-positioningbranch), so the polyfill was a no-op on every page. Easy to add back when that branch lands.