MyGit

v0.2.5

reflex-dev/reflex

版本发布时间: 2023-08-22 06:10:50

reflex-dev/reflex最新发布版本:v0.3.3(2023-11-16 03:29:40)

💪 Thanks to our amazing users and contributors!! 🙌 🐍

Breaking Changes

Chained event handlers from return / yield must always be referenced from the State class, NOT the instance

class State(rx.State):
    def handlerA(self):
        ...

    def handlerB(self):
        return self.handlerA()  # ❌ Will raise TypeError now!

    def handlerC(self):
        return State.handlerA()  # ✅ Always reference chained handlers by class

The exception will look like TypeError: Your handler State.handlerB must only return/yield: None, Events or other EventHandlers referenced by their class (not using self) and will occur when the handler is called, not at compile time.

Removal of Config knobs

New Features

Support f-string formatting of State vars

Frontend rendering functions can now make use of f"built in {State.value}" style formatting, instead of + concatenation.

Node.js is automatically installed on Windows (non-WSL)

Using the cross-platform fnm tool to facilitate automatic installation of node runtime on native windows platform, where previously a manual install was needed.

POSIX support for fnm to replace nvm is coming soon.

Display system and environment information with --loglevel debug

For easier bug reporting and investigations, all relevant platform info, config, and tools used by Reflex will be logged in debug mode.

rx.selected_files Var exposes files selected by the rx.upload component

This new Var can be rendered as a frontend component:

rx.foreach(
    rx.selected_files,
    rx.text,
)

Improvements

Frontend performance boost

Refactoring the main frontend event loop reduces event handling and rendering time by 3x.

Refactored Config class

Simplify configuration knobs and recognize all configuration values set as environment variables.

rx.form now works with more form components

Including rx.pin_input, rx.number_input, and rx.range_slider

More flexible container serialization inside State classes

Use “trailingSlash” mode to better support static site hosting

When exporting a site via reflex export, an index.html file will be created inside a directory for each static route, which makes hosting via s3, github pages, netlify, and others simpler by not requiring a “try_files” rule or rewrites.

docker-example is simplified and extended

The main Dockerfile is simpler and there is now a compose.yaml and Caddy.Dockerfile which can be used to deploy a reflex app with automatic TLS support.

Other Improvements

Bug Fixes

Other Changes

New Contributors

Full Changelog: https://github.com/reflex-dev/reflex/compare/v0.2.4...v0.2.5

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-08-22发行的版本