Skip to content

v0.2.5

Compare
Choose a tag to compare
@masenf masenf released this 21 Aug 22:10
· 809 commits to main since this release
e017f31

πŸ’ͺ Thanks to our amazing users and contributors!! πŸ™Œ 🐍

Known Regressions

  • non-sqlite database access is not working #1661

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

  • admin_dash - configure the admin dashboard via rx.App instead
  • backend_transports - all connections will use websocket
  • cors_credentials
  • db_config - use db_url instead
  • env - specify the run environment via CLI flags to reflex run --env dev|prod
  • env_path - reading environment variables from a file is no longer supported (suggest use of docker-compose or simply source the env file before running reflex)
  • override_os_envs - os environment variables will always take precedence
  • polling_max_http_buffer_size - all connections will use websocket

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

  • set is now supported as a Var type
  • Recursive serialization now allows for list, tuple, and set of PIL image, plotly plots, and pandas dataframes.

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

  • Expose debounce_timeout prop on rx.input and rx.text_area for tuning fully-controlled input behavior on large sites.
  • Ignore *.db and files in default .gitignore template
  • NoSSRComponent supports components using either named or default exports.

Bug Fixes

  • Flex wrap and direction props accept list of values, for use at different responsive breakpoints.
  • Can specify on_load when defining a custom 404 page.
  • Raise useful exception when a user-defined State var shadows an internal name.
  • BUN_PATH is respected again (regression from 0.2.3)
  • Var operations like to_string, and, and or return a new Var with the correct type_ set.
  • Passing a dict as a prop where the values contain double quotes is no longer an error. (Fix rx.html component where content contains double quotes)

Other Changes

New Contributors

Full Changelog: v0.2.4...v0.2.5