MyGit

v0.3.0

reflex-dev/reflex

版本发布时间: 2023-10-28 05:43:19

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

Breaking Changes

Drop Python 3.7 Support

Victory charts are completely removed in this release.

Graph and chart functionailty has been replaced by Recharts, see the docs for more examples.

Removal of Deprecated Browser Storage API

rx.Var Fields are Renamed

Most users are not interacting the Var class directly, but if you are, the following fields have been renamed:

This allows rx.Base and rx.Model classes using these field names to be accessed through State vars.

Prop Values are Validated

Each component prop now defines values as typing.Literal, which has two effects:

The following code will now raise ValueError

rx.button("Foo", color_scheme="silly")
ValueError: prop value for color_scheme of the `Button` component should be one of the following: none,gray,red,orange,yellow,green,teal,blue,cyan,purple,pink,whiteAlpha,blackAlpha,linkedin,facebook,messenger,whatsapp,twitter,telegram. Got 'silly' instead

If you need to pass an unrecognized prop value, you can wrap it in an rx.Var.

rx.button("Foo", color_scheme=rx.Var.create("silly"))

New Features

New Base Template

When running reflex init in a new directory, a multi-page template will be deployed instead of the Welcome to Reflex page. This provides a better starting point for more complex apps.

Use reflex init --template blank to generate a new app with the previous template.

New Component: rx.data_editor

Based on the Glide Data Grid, the new rx.data_editor component supports in place editing of data tables and is more feature rich than the existing rx.data_table component.

See the docs for more examples and details.

(Note: pandas dataframe is not currently supported, but will be coming soon)

State.router

The State.router property provides access to the current page's router data in a way that can be accessed from both the frontend and the backend.

Previous State.get_current_page(), State.get_query_params(), and others are now deprecated.

New component: rx.moment

Simple date/time formatting on the frontend, and provides an event trigger that can be fired peridically from the frontend.

Reflex Hosting Preview

This release includes support for the new Reflex Hosting service, currently in closed testing, please reach out on Discord for more information.

Demo App

Running reflex demo will now open a demo app based on the new base template showing some reflex features.

(Currently using a remotely hosted version of the app, but subsequent release will run the demo app locally.)

Radix Themes Preview

Reflex is moving away from Chakra-UI component to Radix-UI. And some of the new components are available in this release for testing in the reflex.components.radix.themes module. More details to follow.

Improvements

Automatic API_URL

Most users will not have to explicitly set API_URL unless their frontend and backend are running on different hosts or via a load balancer.

When the default API_URL of http://localhost:{backend_port} is used, and the frontend is not being accessed on localhost, assume that the backend and frontend are on the same host.

Support for Static Sites

Do not display the connection error banner or attempt to connect to the backend if the app does not use State.

Improve reflex export

Access Relationship Attributes on rx.Model

Autogenerate missing requirements.txt

An app must have a requirements.txt to be deployed via the hosting service, so Reflex will create one based on top-level packages in the environment where it is running.

Support callback in rx.call_script

When running arbitrary script, it is now possible to pass the result back to an Event Handler. See the updated docs for more examples.

Miscellaneous

Bug Fixes

README translations

Other Changes

New Contributors

Full Changelog: https://github.com/reflex-dev/reflex/compare/v0.2.9...v0.3.0

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

查看:2023-10-28发行的版本