1.5 KiB
1.5 KiB
framerock
getting started
Install:
bun add 'git+https://git.daemons.my/dab/framerock.git'
Create your-app-entrypoint.js:
import { async_run } from 'framerock'
await async_run({
jsbuild_app_frontend: async function () {return `
FRAMEROCK_UTILS.setup_transport({
on_open: () => FRAMEROCK_UTILS.transport_send_bytes(new TextEncoder().encode('Hello from client!')),
on_message: (event) => document.body.appendChild(document.createTextNode('Client received message: ' + new TextDecoder().decode(event.data)))
})
`},
handle_transport_bytes: function (message, { client_id, transport_send_bytes }) {
console.log(['Server received message:', client_id, new TextDecoder().decode(message)])
transport_send_bytes(new TextEncoder().encode('Hello from server!'))
}
})
Run server:
bun run your-app-entrypoint.js
changelog
- Version 1.1.0
- added
func_register_teardown, madejsbuild_app_frontendoptional
- added
- Version 1.0.1
- added
handle_fetch_fallback
- added
- Version 1.0.0
page_titlenow defaults to "framerock app"client_idnow available insidehandle_transport_bytes(added property toutilsobject)- ⚠️ BACKWARD-INCOMPATIBLE CHANGES ⚠️
handle_transport_bytesmovedutilsto be the final argument in function call (can be optionally consumed now)
built with framerock
- theatrics, JS Actor System with first-class support for AI Agents and Assistants