WIP: Make API-only the default build and exclude site pages from the API bundle - #240
Draft
dlabaj wants to merge 1 commit into
Draft
WIP: Make API-only the default build and exclude site pages from the API bundle#240dlabaj wants to merge 1 commit into
dlabaj wants to merge 1 commit into
Conversation
Builds on main's PF_API_ONLY feature with two changes: 1. Flip the default: `build` now produces the API only; the full documentation site UI is opt-in via `build --site` (BUILD_SITE). The dev server always serves the full site. 2. Actually exclude the heavy site pages from the API-only build. The site UI pages move from src/pages to src/site-pages so they leave Astro's file-based routing and are no longer part of the SSR bundle. An `optional-site-pages` integration injects them only for full-site builds; for API-only builds it injects a lightweight api-landing.astro stub at `/` so the route still resolves without heavy modules. Adds architecture.md documenting the split, the build pipeline, and measured build cost. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
dlabaj
marked this pull request as draft
August 26, 2026 23:15
Deploying patternfly-doc-core with
|
| Latest commit: |
0a9b8fe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://881ff937.patternfly-doc-core.pages.dev |
| Branch Preview URL: | https://api-only-default.patternfly-doc-core.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on
main's existingPF_API_ONLYfeature and delivers the two follow-ups discussed:buildproduces the API only; the full documentation site UI is opt-in viabuild --site. The dev server (start) always serves the full site..astrodocs pages insrc/pagesand just returned[]fromgetStaticPaths, so their modules (and@patternfly/react-core,LiveExample, MDX rendering) were still SSR-bundled. They now live insrc/site-pages/, outside Astro's file-based routing, and are injected only for full-site builds.How it works
src/pages/**→src/site-pages/**(same depth, so relative imports are unchanged).optional-site-pagesintegration inastro.config.mjs:BUILD_SITE=true) → injects home + docs routesapi-landing.astrostub at/--api-onlyflag replaced by--site; default setsPF_API_ONLY=true,--sitesetsBUILD_SITE=true.404.astrostays insrc/pagesand keeps itsPF_API_ONLYmessaging.architecture.mddocuments the whole design.Scripts
npm run buildnpm run build:allbuild --site)Verification
/serves the stub landing, no section HTML, fullapi/+apiIndex.json/iconsIndex.json/props.jsonpresent. ~44s, ~6.7 GB peak.--sitebuild: real home +components/,patterns/,foundations-and-styles/. ~57s, ~7.2 GB peak.Breaking change
The
--api-onlyCLI flag is removed in favor of the inverted--siteflag (API-only is now the default). Anyone invokingbuild --api-onlyshould switch to plainbuild; anyone relying onbuildproducing the full site should switch tobuild --site/npm run build:all.🤖 Generated with Claude Code