feat(realtime): add realtime command and handler scaffolding#555
Draft
ImriKochWix wants to merge 9 commits into
Draft
feat(realtime): add realtime command and handler scaffolding#555ImriKochWix wants to merge 9 commits into
ImriKochWix wants to merge 9 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.1-pr.555.c9c117aPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.1-pr.555.c9c117a"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.1-pr.555.c9c117a"
}
}
Preview published to npm registry — try new features instantly! |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
new.ts used project.root but readAllRealtimeHandlers uses dirname(configPath), causing handlers to be created at realtime/ instead of base44/realtime/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
'base44' is the CLI package name and has no exported types. @base44/sdk now exports RealtimeHandler and Conn for type-checking, and the bundler rewrites the import to the CF shim at deploy time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- base44 types generate now includes realtime handlers in types.d.ts - RealtimeHandlerNameRegistry: auto-registers handler names (no manual declare needed) - RealtimeHandlerRegistry: compiled from schema.jsonc inbound/outbound JSON schemas - Add schema.jsonc support to realtime-handler resource reader - Update test fixture with ChatRoom schema and assertions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Detect @base44/sdk vs @base44-preview/sdk from project's package.json
so declare module targets the correct package name
- Add export {} to generated types.d.ts to ensure module context,
preventing ambient module from shadowing the SDK package types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused RealtimeHandlerConfig type alias - Replace [^]* regex with [\s\S]* (Biome noEmptyCharacterClassInRegex) - Auto-format long lines per Biome formatter rules Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The dedicated endpoint calls ensure_cfw_backend and uses force_per_function so the bundler runs applyRealtimeCompat instead of the per-app path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Note
Description
This PR introduces a new realtime handler resource type to the Base44 CLI, letting developers create, manage, and deploy realtime (WebSocket-style) handlers from the terminal. Handlers live in a
base44/realtime/directory, are scaffolded with a typedRealtimeHandlerbase class, and deploy via a dedicatedrealtime-handlersAPI endpoint. Realtime handlers are wired into the unifieddeployandtypes generateflows, and TypeScript types (including inbound/outbound message schemas) are auto-generated from each handler'sschema.jsonc.Related Issue
None
Type of Change
Changes Made
realtime-handlercore resource (core/resources/realtime-handler/): schema, config discovery (readAllRealtimeHandlers), API client (deploySingleRealtimeHandler→PUT /realtime-handlers/{name}), sequential deploy logic, and aResource<RealtimeHandler>implementation.base44 realtimecommand group withnew <HandlerName>(scaffolds a typedRealtimeHandlersubclass underbase44/realtime/) anddeploy [names...](deploys selected or all handlers with per-handler status reporting).hasResourcesToDeploy, and pushed indeployAll.realtimeDir(defaultrealtime) to the config schema,ProjectData, and the config reader (including plugin/zero-config paths that default to empty arrays).RealtimeHandlerNameRegistryandRealtimeHandlerRegistry(typedinbound/outboundmessage shapes compiled from each handler'sschema.jsonc); added SDK package-name detection (@base44/sdkvs@base44-preview/sdk) and anexport {}module marker so thedeclare moduleaugments rather than replaces the SDK package.types generatespec and added aChatRoomrealtime handler fixture (entry.ts+schema.jsonc).Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
A new resource type was added without a corresponding topic guide in
docs/; consider documenting the realtime handler resource and thebase44 realtimecommand group to keepdocs/in sync with the architecture.🤖 Generated by Claude | 2026-06-30 13:15 UTC | c9c117a