Skip to content

glotlabs/poly-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poly

Overview

Poly is a proof of concept web framework for building interactive web applications with Rust. It's loosely inspired by The Elm Architecture.

How it works

It compiles to WebAssembly and exposes functions like init, update, view, subscriptions, etc. to JavaScript. poly-js is a runtime layer that hooks into to these functions and updates the DOM, sets up event listeners, etc.

init

Returns the initial model as json.

view

The view function returns the page html as a string to JS.

update

Is called when an event listener, interval etc is triggered from js. The model is passed as passed as an argument and the new model is returned. It also returns a list of effects as json, i.e. focus element.

subscriptions

Subscriptions are event listeners, intervals, etc. These are returned as json as a declarative list.

Server-side rendering?

Yes, since it compiles to wasm the same functions mentioned above can also be called from the server. Should work with any wasm backend, and works with Cloudflare Pages as an example.

Docs?

Sorry

Built with poly

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages