Create Blazing-Fast SPA's using Ryact, a component-based framework built on Python

May 17, 2021 at 18:28

Well, it's built using rapydscript, which is almost syntactically indistinguishable from python. Ryact uses an id-based identification system and dom-diffing to change the state of components. Performance-wise it's pretty good as well; I tested my app on Lighthouse and I got scores from 90-100 on the performance section.

Here is the default boilerplate for ryact. This simply results in a webpage with the words "hello ryact..." in blue.

from ryact.baseclasses import cre, css, Base #MyApp is a stateless component(it does not change, so therefore it doesn't inherit the setState method) class MyApp(Base): def render(self): return cre( "h1", { "style": css({ "margin": "20px", "color": "blue", "font-family": "sans-serif" }), "innerText": "Hello ryact! Rapydscript is great, but ryact makes it better!" }) def run_app(): document.getElementById("root").appendChild(MyApp().render())