**This release rewrote the entire PyFyre framework completely to the point that it's not worth mentioning the changes. Instead, we will treat this as a completely new framework.**
This is how PyFyre looks now (simple counter app):
py
from browser import DOMEvent
from pyfyre import render, State
from pyfyre.nodes import Node, Widget, Text, Button
class App(Widget):
def __init__(self) -> None:
self.count = State[int](0)
super().__init__()
def build(self) -> list[Node]:
def increment(event: DOMEvent) -> None:
self.count.set_value(self.count.value + 1)
def decrement(event: DOMEvent) -> None:
self.count.set_value(self.count.value - 1)
return [
Button(onclick=decrement, children=lambda: [Text("-")]),
Text(self.count),
Button(onclick=increment, children=lambda: [Text("+")]),
]
render({"/": lambda: App()})
Features Summary
- Component-based framework
- Simple and efficient state management
- Single-page application
- Pythonic code with static typing
- Asynchronous programming out of the box
- Support for CPython packages created using pure Python
- Create web apps without using other languages like HTML and JavaScript
- Built-in styling without using a CSS file
- UI elements exception handling
- Custom PyFyre window events
- Static site generator (no JavaScript)
- Preset elements (reusable styled elements like loading and error messages)
Documentation
At the time of this release, the [documentation](https://pyfyre.gitbook.io/docs/) hasn't been updated yet. We will work on that soon.