Repository navigation
feat(flame): page-specific assets, stable mdx chunks, and deploy alignment - #378
Merged
Merged
Conversation
- split docs/home client bundles with per-route styles and manifest - map mdx slugs to stable hash-based virtual ids for bun and vite - keep lazy per-route mdx chunks without encoded slash filenames
- normalize Vite MDX chunk names to Bun-compatible docubook-mdx-page-* - pin Docker builder image to installed Flame version, build with --bun - serve generated 404.html and revalidate stable manifest/search JSON - cache only content-hashed JS, CSS, and chunk assets as immutable
Expose PageType and page assets through PageContext. Run plugin hooks for home and standalone 404 pages in build and dev, pass assetManifest to dev handlers, and deliver onEnd context with outDir. Simplify Bun server 404 fallback, align docs, and publish plugin types.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
4 of 5 tasks
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
Page-specific assets + stable MDX chunk names + deploy/plugin alignment for
@docubook/flame.Split the single
{ js, css }client bundle into per-page-family bundles (docs/home/notFound), stabilize MDX chunk filenames across Bun and Vite, run plugin hooks for home + standalone 404, and align Docker/nginx deploy output with the new manifest contract.Why
client.css/client.jsloaded docs-specific JS/CSS on home and 404, and vice versa.docubook-mdx-page-*), breaking cross-runtime asset parity.injectHead,injectBody,transformHtml,onEnd,handleRequest) only covered docs pages; home/404 bypassed plugins.What changed
1. Page-specific assets + stable MDX chunks (
37f66fb)AssetManifestinnode/types.ts:node/client.ts(docs) vs newnode/home-client.ts(landing).styles/base.css(shared) +styles/site.css(home/404) vs docs bundle;Theme.tsx,pages/index.tsx,pages/404.tsxupdated to use the right bundle.hydrate.node.ts/hydrate.ts) and Vite, keeping lazy per-route chunks without encoded-slash filenames.manifest.json,cache-key.ts,paths.ts,html.shared.ts/html.tsupdated for depth-aware asset URLs.DocsLayout.2. Deploy alignment across runtimes (
903eb48)docubook-mdx-page-*.deploy.shared.ts:@docubook/flameversion (FLAME_VERSION) instead of major-only tag, and builds withflame build --bun.nginx.conf:error_page 404 /404.html,location = /404.html,try_files $uri $uri.html $uri/ =404.manifest.json+search-index.json→ revalidate (no-cache); only content-hashedclient-*,home-client-*,docs-*,site-*,chunks/*,assets/*→immutable._headersfile for Cloudflare/Pages-style hosts.deployment.mdxupdated to match.3. Plugins migrated to page-specific assets (
6171ec4)PageContextnow requires:injectHead/injectBody/transformHtmlnow run for docs, home, and standalone 404 in bothbuild.tsandbuild.impl.ts(Node/Deno + Bun paths).onEnd(config, pages, context)— new 3rd arg:DevServerContextgainsassetManifest, refreshed after HMR rebuilds; passed to devhandleRequesthandlers.server.ts/server.impl.ts,server-routes.ts) simplified 404 fallback.plugin.tsre-exportsAssetEntry,AssetManifest,PageType;package.jsonpublishes plugin types.plugins.mdxrewritten: newPageContexttable,onEndexample with{ outDir, assetManifest }, warning not to parsemanifest.jsonas single{ js, css }and to treatjsas optional.Migration notes for plugin authors
ctx.assets/ctx.pageTypeinstead of assuming a global bundle:onEnd:manifest.jsonshape changed from{ js, css }→{ docs, home, notFound }. Look up bypageType.Affected packages
@docubook/flame— runtime, build, dev server, deploy, plugin API, docs (deployment.mdx,plugins.mdx).Validation
pnpm --filter @docubook/flame run test(updated:deploy.test.ts,hydrate.test.ts,html.test.ts,plugin.test.ts,plugin-integration.test.ts,security-pentest.test.ts,helpers.ts)pnpm --filter @docubook/flame run lintpnpm --filter @docubook/flame run compile:lib(Node/Deno path)flame build(Bun + Node),flame devhome/docs/404 plugin hooks,flame deploy --dockerDockerfile/nginx outputCommits
37f66fb—feat(flame): add page-specific assets and stable mdx chunk names903eb48—fix(flame): align deploy assets across runtimes6171ec4—feat(flame): migrate plugins to page-specific assetsFollow-up
@docubook/flamechange — runpnpm changesetbefore merge (linked packages are in beta prerelease mode).main← Head:feat/page-specific-assets. No linked issue.