Skip to content

docs(platform): the React hook is one page, like the chat module - #346

Merged
wixysam merged 25 commits into
mainfrom
amitb/platform-react-one-page
Oct 22, 2026
Merged

wixysam merged 25 commits into
mainfrom
amitb/platform-react-one-page

Conversation

@amitbardos

Copy link
Copy Markdown
Contributor

Why

The @base44/platform/react reference was hard to read. It was four pages: useChat, ChatBackend, ChatItem and ChatQuestion. Each had more types appended to it, and an unlabelled "Methods" section (send, create, clearError) appeared in the middle of useChat. The chat module, by contrast, is one page with its types as definitions under it.

What

useChat is now one page, laid out like the chat module page:

  • Overview: the signature, then Parameters, Returns and Example.
  • Actions: send(), create(), clearError().
  • Backend calls: createApp(), openLiveSession(), sendMessage(), submitToolCallInput().
  • Type Definitions: ChatItem, ChatStep, ChatAnswer, ChatStatus, ChatConnection, ChatError, ChatApp, ToolCallAnswer.
  • Questions: ChatQuestion, then each kind with its methods nested under it (answer(), submit(), approve(), decline()) and its entry types.

ChatOptions has no section of its own, since Parameters already documents every option. The config for all this is appended-articles.json, page-sections.json and a new types-to-delete-after-processing.json in packages/platform.

Pipeline

Three generic pieces in the shared pipeline. The app SDK reference generates byte-identical, and so do the Platform SDK's other pages:

  • nestUnderGroupTypes: in a type definition group, a type's own methods arrive at the level of the types themselves. They now nest under their type, and the bare "Methods" label goes.
  • propertiesAsFields: a type's properties become fields up to its first method (name()), which keeps its heading. Before, a nested method would have been swallowed as a field.
  • fixInPageAnchors: a last pass that checks every in-page link against the page's headings and explicit ids.
    • A link to a type whose section was renamed (typesWithOwnMethods) follows the new heading, for example #chatbackend → #backend-calls.
    • A link to something the page no longer has keeps its text and loses the link, so it can't jump to nothing. An example is UseChatResult.status, which is now a field.

Testing

  • Unit tests for each piece in tests/unit/typedoc-mintlify.test.ts. Undoing any one of them fails a test.
  • vitest run tests/unit in packages/sdk: 387 passed.
  • Both references regenerated and compared page by page.
  • Checked in a local Mintlify preview. The React nav has one page, and every in-page link on useChat resolves.

🤖 Generated with Claude Code

useChat, ChatBackend, ChatItem and ChatQuestion were four pages, with the hook's own types
appended to each and an unlabelled Methods section in the middle of useChat. They are now one
useChat page in the layout of the chat module page: Overview, then "Actions" (send, create,
clearError), "Backend calls" (the four ChatBackend calls), "Type Definitions" and "Questions".
ChatOptions has no section of its own: Parameters already documents it.

The shared pipeline gets three generic pieces for this, with no effect on the app SDK
reference, which generates byte-identical:
- In a type definition group, a type's own methods nest under it instead of sitting at the
  level of the types, and the bare Methods label goes.
- A type's properties become fields up to its first method, which keeps its heading.
- A last pass points in-page links at headings and explicit anchors that exist: a type whose
  section was renamed is linked by its new heading, and a link to anything the page no longer
  has keeps its text without the link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.56-pr.346.ce5b5be

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.56-pr.346.ce5b5be"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.56-pr.346.ce5b5be"
  }
}

Preview published to npm registry — try new features instantly!

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available! (@base44/platform)


Install this PR's preview build with npm:

npm i @base44-preview/platform@0.5.0-pr.346.ce5b5be

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/platform:

npm i "@base44/platform@npm:@base44-preview/platform@0.5.0-pr.346.ce5b5be"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/platform": "npm:@base44-preview/platform@0.5.0-pr.346.ce5b5be"
  }
}

Preview published to npm registry — try new features instantly!

wixysam and others added 24 commits October 21, 2026 15:45
…d mentions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Platform SDK's useChat page goes under React instead of Clients, so a regeneration keeps the React group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A field typed with a union of string literals, such as useChat's status or a
purchase's status, only named the type, and its values sat in a separate
section, or nowhere when the type wasn't exposed. Post-processing now reads
each such union from TypeDoc's pages, adds its comment (after the summary
paragraph) to every field that uses it, and drops the union's own section.
A comment that doesn't name every value gets a line listing them. Unions that
document each value as a field, like the webhook error codes, are left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…them

ChatItem, ChatStep, ChatAnswer, ChatError, ChatApp, and ToolCallAnswer were already nested in full under the fields that use them, so their Type Definitions sections only repeated them. The page keeps one types section, Questions, which the step's question field now links to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Returned actions

useChat returns one object of state to render and functions to call. Its page
split them unevenly, with the state in a collapsed Returns accordion and the
functions in an Actions section opened by the wrong intro, and none of the
state in the page's table of contents.

page-sections.json `returnedState` now names a section for a returned type's
properties. The function's Returns gives way to that section, with one heading
per property that keeps what Returns showed for it, and the type's methods
follow in their own section. Each section opens with its @groupDescription.
The page keeps Parameters at the top level, and the Returns example moves to
the Overview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tself

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssion_id on the server

Create socket session's own docs say to keep session_id on your server, but the chat module and useChat told backends to pass the whole response through unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts intro type

On the useChat page, ChoiceEntry, SecretField, and ApprovalDetails each had a
section of their own though only one field uses each, and nothing linked
them. page-sections.json `inlineTypes` now moves such a type into the field
that uses it, as a Properties accordion. A typeDefinitionGroups entry's
`intro` type opens its section with no heading of its own, with each type its
signature names linked to its heading, so ChatQuestion introduces Questions
and links the three kinds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wixysam
wixysam merged commit 6bb787b into main Oct 22, 2026
8 of 9 checks passed
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.

3 participants