No description
  • JavaScript 100%
Find a file
2026-02-21 22:02:00 +00:00
backend Version 1.4.0 (see README for changelog) 2026-02-21 22:02:00 +00:00
frontend Version 1.4.0 (see README for changelog) 2026-02-21 22:02:00 +00:00
package.json Version 1.4.0 (see README for changelog) 2026-02-21 22:02:00 +00:00
README.md Version 1.4.0 (see README for changelog) 2026-02-21 22:02:00 +00:00

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.4.0
    • added handle_fetch_async_fallback to async_run params, added (optional) url_suffix to setup_transport params
  • Version 1.3.0
    • added handle_request_validate to async_run params (if undefined, no validation is performed)
  • Version 1.2.2
    • added idleTimeout to config
  • Version 1.2.1
    • bugfix: check for window without causing error
  • Version 1.2.0
    • modified frontend/index.js such that script can now be used in SharedWorker and HTTPS contexts
  • Version 1.1.0
    • added func_register_teardown, made jsbuild_app_frontend optional
  • Version 1.0.1
    • added handle_fetch_fallback
  • Version 1.0.0
    • page_title now defaults to "framerock app"
    • client_id now available inside handle_transport_bytes (added property to utils object)
    • ⚠️ BACKWARD-INCOMPATIBLE CHANGES ⚠️
      • handle_transport_bytes moved utils to 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