Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 261b7f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
xyos
force-pushed
the
docs/readme-size
branch
3 times, most recently
from
November 13, 2026 20:26
e845b25 to
1df6207
Compare
xyos
marked this pull request as ready for review
November 13, 2026 20:37
xyos
force-pushed
the
docs/readme-size
branch
from
November 17, 2026 16:35
1df6207 to
784a6c5
Compare
xyos
force-pushed
the
docs/readme-size
branch
from
November 17, 2026 16:40
784a6c5 to
04f536b
Compare
The guide README spends 9.4 KB on migrating apps scaffolded by create-blocks-app 0.1.0 to 0.4.0 from aws-blocks/scripts wrappers, which current templates no longer generate. The section's bullets move verbatim into a root-level MIGRATING-FROM-SCRIPTS.md, added to files so it ships in the package and in docs/. The README keeps the heading (deep-linked from the create-blocks-app README), the two migrate commands, when migrate refuses to run, what it never deletes, what happens when a wrapper cannot be deleted, its exit codes, the two scripts that behave differently afterwards, and a pointer. Validation: packages/blocks build; readme-links and docs-pointers tests 2/2; the bundled docs/ copy is byte-identical to the source.
The README's Model Configuration section spent 14 KB on preset tables,
guardrails, health checks, API keys, Bedrock account access and Mantle.
Those subsections move verbatim into MODELS.md, which package.json files
already listed but which did not exist. The README keeps the model option
table and examples, links each moved section, and keeps the facts a reader
needs before deploying: the global-profile data-residency caveat, the
one-time Anthropic and Marketplace steps, that a health check does not
prove invoke access, and Mantle's local and deployed permissions, apiKey
precedence and Chat Completions-only model support.
The useChat React example repeated the createChat one; it now links to it
and keeps the useChat-only facts (lint false positive, the resume adapter,
the { id, name, reason } interrupt shape, Next.js). Two stale statements
are fixed: the README recommended the deprecated useChat for
subscribe-before-send ordering (index.hooks.ts marks it deprecated in
favour of createChat), and the InvalidModelConfig row omitted trustable
with interrupt (agent.ts) and guardrail on a non-bedrock provider
(model-factory.ts).
The useChat samples' subscribe adapter, `return channel.subscribe(sub)`,
did not compile under strict: sub is ChatChunkHandler |
ChatSubscribeOptions, and neither RealtimeChannel.subscribe overload takes
the union. All three samples now narrow with typeof sub === 'function'
and still forward sub unchanged.
Validation: every README/MODELS.md link and anchor resolves; every line
of the moved subsections is present verbatim in MODELS.md, except the
one retargeted Local Development link. The React useChat snippet, the
End-to-End frontend and the deprecated-hook sample type-check with tsc
--strict against the built @aws-blocks/bb-agent client and the Agent
types (api typed from the backend methods); the React snippet fails when
api is removed, and the End-to-End sample fails with the old adapter line.
…R.md The 12 KB guide to writing a door with defineFrontDoor is for door authors, not for apps that pick a built-in door, and nothing in the repository links into it. It moves verbatim into a root-level CUSTOM-FRONT-DOOR.md, added to files so it ships in the package and in the umbrella's docs/. The README keeps the heading, a summary of what the file covers, a link from the front-door table, and what AWS Blocks checks and enforces for such a door: an http:// url with an API fails a production synth (PlainHttpFrontDoorError) unless the door sets allowPlainHttp: true, the wiring check's synth errors and warnings (ServeStaticAsset, ProxySameOriginApi, FrontDoorRuleUnwired, FrontDoorBehaviorLimit, MissingFrontDoorUrlError), that features such as waf are not checked, the 10 KB CloudFront Function limit, serverResponse: 'buffered', and the 403 on request bodies through a Function URL with origin access control. Validation: every moved line is present verbatim; npm pack --dry-run lists CUSTOM-FRONT-DOOR.md.
The "Production (frontend hosted separately)" CORS section contradicted the "allowedOrigins entries" section above it and the code. It said every entry is a regex, that an invalid regex falls back to a literal match, and that https://app.example.com also matches https://appXexample.com. In cors.ts a plain origin is matched exactly and case-insensitively (isLiteralOrigin), an invalid entry fails synth (validateCorsOriginEntry) and is dropped and logged at runtime (parseCorsPatterns). The section now states that and links to the rules; its example and regex table are unchanged and still valid. The Pipeline section's pointer, which named no target, now links to the pipeline README. Validation: against the built dist/cors.js, the four table entries pass validateCorsOriginEntry, a plain https://app.example.com does not match https://appXexample.com, an unescaped-dot regex is rejected, and a top-level | alternation stays anchored.
xyos
force-pushed
the
docs/readme-size
branch
from
November 17, 2026 20:37
04f536b to
261b7f7
Compare
This was referenced Nov 18, 2026
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.
Problem
The largest block READMEs are each about 75–140 KB: core 140 KB, hosting 90 KB, bb-agent 85 KB, bb-auth 78 KB, and the
@aws-blocks/blocksguide 49 KB. A reader who opens one pays for all of it, even though parts of it serve a narrower audience. Three sections are self-contained material of that kind:package.jsonalready lists aMODELS.mdinfiles, but the file does not exist.defineFrontDoor, not for apps that pick a built-in door.aws-blocks/scripts" spends 9.4 KB on apps scaffolded by create-blocks-app 0.1.0 to 0.4.0. Current templates no longer generate those wrappers.While measuring them, four statements turned out to contradict the code, and one code sample did not compile:
allowedOriginsentry is a regex, that an invalid regex falls back to a literal match, and thathttps://app.example.comalso matcheshttps://appXexample.com. The section above it andcors.tssay otherwise.useChatfor subscribe-before-send ordering.InvalidModelConfigrow omits two cases that throw it.useChatsamples forwardsubwithreturn channel.subscribe(sub), which failstsc --strict.subisChatChunkHandler | ChatSubscribeOptions, and neitherRealtimeChannel.subscribeoverload accepts the union.Issue #, if available:
Changes
One commit per README; each has its own changeset (patch).
blocks (guide): the migration bullets move verbatim into a new root-level
MIGRATING-FROM-SCRIPTS.md, added tofiles. The README keeps the heading (the create-blocks-app README deep-links it), the twocdk-blocks migratecommands and a pointer to the file. It also keeps, verbatim, what a user needs to run migrate safely: when it refuses to run and--force/--dry-run, that a customized wrapper is never deleted, whendeploy/destroyare kept, what happens when a wrapper cannot be deleted, the exit codes, and the two scripts that behave differently afterwards. 49,079 → 42,249 bytes.bb-agent: the seven Model Configuration subsections move verbatim into
MODELS.md. Their headings go up one level, and one link back to the README's Local Development is retargeted. The README keeps themodeloption table and the deployed/local/fallback examples. It also keeps, verbatim, the facts needed before deploying: the global-profile data-residency caveat; the one-time Anthropic and AWS Marketplace steps, theAccessDeniedExceptiondelay, opt-in Regions, and global vs regional profiles; that a health check doesn't prove invoke access; and Mantle's local and deployed permissions,apiKeyprecedence and Chat Completions-only model support. TheuseChatReact example repeated thecreateChatone. It now links to that example and keeps the guardeduseChat(...)construction and the facts that differ foruseChat: the react-hooks lint false positive, theresumeadapter, the{ id, name, reason }interrupt shape and the Next.js note. The two stale statements are fixed; theInvalidModelConfigrow keeps main'ssessionScope: 'shared'sentence. The threeuseChatsamples'subscribeadapter now narrows first (typeof sub === 'function' ? channel.subscribe(sub) : channel.subscribe(sub)), with no cast, and still forwardssubunchanged. 84,604 → 74,315 bytes.hosting: "Bring your own front door" moves verbatim into
CUSTOM-FRONT-DOOR.md, added tofiles. The README keeps the heading, a summary of what the file covers, a link from the front-door table, and what AWS Blocks checks and enforces for such a door:http://urlwith an API fails a production synth (PlainHttpFrontDoorError) and warns in a sandbox, unless the door setsallowPlainHttp: true;ServeStaticAsset,ProxySameOriginApi,FrontDoorRuleUnwired,FrontDoorBehaviorLimit,MissingFrontDoorUrlError, andwiringCheck: false);wafare not checked;serverResponse: 'buffered';90,027 → 81,116 bytes. Look hardest here: feat(hosting): let a front door route at the app (routing: 'app') #1245 adds a subsection inside this section, so this commit is self-contained and can be dropped if you'd rather wait for feat(hosting): let a front door route at the app (routing: 'app') #1245.
core: the production CORS subsection now says that a plain origin is matched exactly and that an invalid entry fails synth. It links to the
allowedOriginsrules above it. Its example and regex table are unchanged, and the table's patterns are still valid. The Pipeline pointer links to the pipeline README. 140,634 → 140,381 bytes.Across the four READMEs: −26,283 bytes. The three new topic files add 33,411 bytes, so the total shipped docs grow slightly. What changes is how much a reader of each README has to get through. Every moved line is present verbatim in its new file, and every new file ships in its package and, through
gen-block-docs.mjs, in@aws-blocks/blocks/docs/.The bb-auth commit of the earlier head is dropped: it said that on AWS the password-reset marker is read with an eventually consistent
GetItem. Since #1453,KVStore.get()is strongly consistent by default (ConsistentReadunlessconsistentRead: false,bb-kv-store/src/index.aws.ts), andSessions.isRevokedreads the marker with no options, so the README's "from the next request on … on AWS" is true as it stands. This PR no longer touches the bb-auth README.Related PRs
Merged since the previous head, now in its base (
maindabb3f22f):packages/bb-distributed-table. This PR never edited that package. It made the bb-auth commit wrong (see above), so that commit is gone. Its edits to the bb-agent README (DistributedTable→KVStorein "What it provisions" and "Scaling & cost") and to the guide are outside the moved sections and are kept as main has them.generateClient: false,devConfiggaininggenerateClient?: false) and added a bullet for a wrapper that can't be deleted (exit 1).MIGRATING-FROM-SCRIPTS.mdcarries main's current text of the whole section, and the README keeps that new bullet verbatim with the other exit-code facts.sessionScope: 'shared'sentence in theInvalidModelConfigrow is kept alongside this PR's two added cases.http://URL check (verified inhosting_construct.ts).withAuth; neither touches the Pipeline line or the production CORS subsection, andcors.tsis unchanged.PRODUCTION.mdearlier. The three topic files here follow that pattern: whole sections move verbatim into a root-level file, the file is added tofiles, and the README keeps a pointer.Open:
packages/blocks/package.jsonwith this PR. The two edit different sections (guide: its Reference bullets vs this PR's migration section; core: itswithAuthvs this PR's Pipeline and production CORS;packages/blocks/package.json: separatefileslines). Its rebased head86fd2ab7dmerges clean with this one (see the combined check below).e864ce6fb+ this PR261b7f752+ docs: describe the installed version in the shipped docs, not how it changed #1504a4edab846onmaindabb3f22f): the three PRs merge together cleanly. On the combination, the build passes, and so do the docs test files (shipped doc code samples, docs pointers,IMPORTS.md, README links),check:imports,sync-docs:check,check:apiandlint:deps. Thecreate-blocks-apptests, the suite behind CI shard 3, pass 391/391. No relative link or#anchorbreaks that isn't already broken onmain.--output json(moved), the wrapper-deletion bullet and the exit codes (kept in the README and present inMIGRATING-FROM-SCRIPTS.md). Whichever lands second applies those edits to both copies.blocks.devmigrate bullet. Whichever lands second applies it inMIGRATING-FROM-SCRIPTS.md.#bedrock-presets. Whichever lands second puts that subsection inMODELS.mdand points the link at./MODELS.md#bedrock-presets.CUSTOM-FRONT-DOOR.md. Its"DESIGN.md"line inpackages/hosting/package.jsonfilessits next to this PR's"CUSTOM-FRONT-DOOR.md", so the second to land needs a one-line merge there.#bedrock-presetslink this PR points atMODELS.md.package.jsondependency andfiles-adjacent edits chore: declare sideEffects per package #44, feat(bb-sms-client): add SmsClient building block for SMS and mobile push #49, feat(observability): add OpenTelemetry building blocks (OtelMetrics / OtelLogger / OtelTracer) #50, feat(bb-event-bus): add EventBridge-backed pub/sub event bus block #64, feat(bb-agent): AgentCore Runtime #164, feat(bb-agent): migrate streaming execution to AgentCore Runtime (1/5) #250, feat(bb-auth-jwt): provider-agnostic bearer-JWT auth Building Block #297, chore(deps): bump ulid from 2.4.0 to 3.0.2 #406, fix(bb-lambda-compute): Report bbName/bbVersion in telemetry #611, fix(blocks): keep vendor/ intact on vendorize --force; keep bin and @types when vendorizing #1216, chore(deps): bump the npm_and_yarn group across 2 directories with 2 updates #1295, chore(deps-dev): bump the dev-dependencies group across 1 directory with 8 updates #1306, chore(deps): bump local-pkg from 0.5.1 to 2.0.0 #1307, test(hosting): run the unit tests in one process #1370, chore(deps-dev): bump the dev-dependencies group across 1 directory with 13 updates #1379, fix(create-blocks-app,hosting): print Hosting's own warning about an unsupported next when adding AWS Blocks to a project #1508, chore(deps): bump the production-dependencies group across 1 directory with 18 updates #1530, chore(deps): bump the aws-sdk group across 1 directory with 30 updates #1531) edit other lines, and none changes behaviour this PR describes.Validation
Head
261b7f752, rebased onmaindabb3f22f(after #1596), Node 22.23.1. The rebase fromdfc4a306bwas clean: none of the six newmaincommits touches a file this PR changes, and the moved sections still matchmainline for line. The local checks below ran on earlier heads with the same docs tree. The pre-push checks below ran onemaincommit earlier (ddae81525) and before theuseChatadapter fix. Themaincommit in between changes onlynative/swift/Demo/typescript-demo/package.json, and the fix changes only three lines ofpackages/bb-agent/README.mdand its changeset.Before pushing:
npm ci: pass; no lockfile churn.npm run build: every workspace builds. Locally, the last step (admin-ui'snext build) stops with Next.js 16.4.2's upgrade notice for a known Next.js security advisory, which Next shows only outside CI; re-runningnpm run build -w @aws-blocks/admin-uipasses.npm run lint:deps: pass (664 files).npm run check:api: all API reports up to date.npm run sync-docs:check: catalog up to date.packages/blocksnpm test: 566 tests, 555 pass, 3 skipped, 8 fail. That includesreadme-linksanddocs-pointers(pass) andconditional-exports(pass). The 8 failures are all in "signals sent to the CLI while a child runs". 7 logEMFILE: too many open files, watch …/dist/cli/runners/dev-server.js, because this machine had no inotify instance left. The eighth ("records how its dev server runner ended") fails an assertion with noEMFILEline; its cause is unconfirmed. CI runs these tests on its own runners. This PR adds no tests.After pushing, on this head (local):
npm test: 13,680 tests, 13,641 pass, 25 fail, 10 skipped, 4 cancelled.create-blocks-appauth-oidctemplate tests from CI shard 3 (fix(create-blocks-app): align auth-oidc template with template checks #1596).EMFILE: too many open files, watch: this machine had no inotify instance left, and a barefs.watch('.')throwsEMFILEhere.cdk-blocks devsignal tests. 7 log the sameEMFILE. The eighth ("records how its dev server runner ended") fails an assertion with noEMFILEline; its cause is unconfirmed.watchHostingValues()("watcher did not regenerate with the new config key"). It logs noEMFILE, and the secret typegen falls back to polling whenfs.watchfails, so its cause is unconfirmed.Local Unit Testsshards 1 and 2 pass on this head.npm run test:e2e:local: 539 tests, 0 pass, 10 fail, 524 cancelled, 5 skipped. The comprehensive app's dev server exits with code 1 right after "Generating client code", before it is ready. The log shows no other error, so the cause is unconfirmed. CI'sLocal E2Ejob passes on this head.CI on this head: all green, 24 pass, 21 skipped, 0 fail (
gh pr checks --watchexit 0).Local Unit Tests (shard 3)passes now that the merge commit includes #1596.Also checked on this head:
The moved sections were diffed again against current
main.MIGRATING-FROM-SCRIPTS.mdandCUSTOM-FRONT-DOOR.mdcarrymain's current section text byte for byte under a one-line intro. Every line of the seven bb-agent subsections is inMODELS.md, except the retargeted Local Development link.Every relative link and
#anchorin the four READMEs, the bb-auth README and the three topic files resolves. OutsideMODELS.md, nothing links to the headings that moved.The
packages/blocksbuild writesdocs/MIGRATING-FROM-SCRIPTS.md,docs/bb-agent/MODELS.mdanddocs/hosting/CUSTOM-FRONT-DOOR.md, byte-identical to the sources.npm pack --dry-runlists each topic file in its own package.The CORS statements were checked against the built
packages/core/dist/cors.js:validateCorsOriginEntry;https://app.example.comis matched exactly and case-insensitively, and doesn't matchhttps://appXexample.com;.is rejected;|alternation stays anchored.The new hosting bullet was checked in
hosting_construct.ts: a custom door whose URL ishttp://, with an API, throwsPlainHttpFrontDoorErroroutside a sandbox, warns with@aws-blocks/hosting:PlainHttpAllowedInProductionunderallowPlainHttp: true, and warns with@aws-blocks/hosting:PlainHttpFrontDoorin a sandbox.The
useChatsamples were type-checked withtsc --strictagainst the built@aws-blocks/bb-agent/clientand theAgenttypes.apiwas typed from the backend methods. The React snippet, the End-to-End frontend and the deprecated-hook sample all pass. The React snippet fails whenapiis removed. The End-to-End sample fails with the old adapter line (TS2769). An earlier version of this description claimed the React snippet type-checked; that check was too loose, and this one replaces it.The README edits after the first pre-push run touch only
packages/bb-agent/README.md(the adapter lines) and its changeset. Those three lines are inside code fences, so no link or anchor check reads them. The docs suites passed on this head in the three-way combined check and in CI.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.