Skip to content

🍕 Document the nodeGlobals / serverOnlyPackages config landed in #260 - #263

Merged
jjpaulino merged 1 commit into
masterfrom
jordan/document-node-globals-config
Sep 15, 2026
Merged

jjpaulino merged 1 commit into
masterfrom
jordan/document-node-globals-config

Conversation

@jjpaulino

Copy link
Copy Markdown
Member

TL;DR — for reviewers short on time

  • Outcome and scope: Docs-only. 🍕 Node globals: real diagnostics + opt-in fix, generalized server-boundary warning #260's end-of-build summary already references "CLAY-VITE.md § Node globals in browser bundles" for the bare-Buffer diagnostic — that section didn't exist. Adds it, covering why clay vite can't auto-polyfill the way Browserify did, the nodeGlobals/serverOnlyPackages config contracts, and the browser-native (btoa) exit path.
  • Risk: None. No .js file touched.
  • Validation: npm test (lint + all 456 tests) green — unaffected, as expected for a docs-only change.
  • If you only review one thing: CLAY-VITE.md L862–L888 — the nodeGlobals contract table and config example; the part someone configuring this will actually read.
  • Changes, in logical review order:
    1. CLAY-VITE.md L826–L860 — why this needs its own explanation, and the no-blanket-polyfill policy.
    2. CLAY-VITE.md L862–L888 — the nodeGlobals contract, its two modes, and the browser-native exit path.
    3. CLAY-VITE.md L890–L910serverOnlyPackages as the more general shape of the same leak.

Feature Info

Description

Closes a dangling doc reference left by #260 — the diagnostic's own console output pointed at a section that hadn't been written yet.

🤖 Generated with Claude Code

#260's console output (scanBareNodeGlobals's end-of-build summary) already
pointed readers at "CLAY-VITE.md § Node globals in browser bundles" -- that
section never actually existed. Adds it: the v5 insert-module-globals
history (so "why doesn't Vite just polyfill this" isn't re-litigated), the
no-blanket-polyfill policy, the bare-Buffer diagnostic, the nodeGlobals
contract and its two modes, the browser-native (btoa) exit path that
motivated this in the first place, and serverOnlyPackages as the more
general shape of the same leak.

Placed directly after "Kiln plugin PostCSS chain" under Section 8, matching
that section's own established depth and voice.

Docs only -- no .js file touched. npm test (lint + 456 tests) green.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 83.02%. remained the same — jordan/document-node-globals-config into master

@jjpaulino
jjpaulino merged commit 44622ff into master Sep 15, 2026
6 checks passed
@jjpaulino
jjpaulino deleted the jordan/document-node-globals-config branch September 15, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants