Skip to content

Releases: reflex-dev/reflex

v0.4.2

26 Feb 20:05
b13a25c

Choose a tag to compare

New Features

Syncronize LocalStorage between tabs

Pass the new sync=True argument to rx.LocalStorage to enable changes on one tab to automatically update in other tabs.

  • feat: Synchronizing localStorage between tabs using browser events by @abulvenz in #2533

Improvements

Tuple type annotations are now respected index-wise

Substates are serialized individually

This allows apps with large state to only serialize and deserialize the parts of the state needed to handle a given event.

  • [REF-1885] Shard Substates when serializing to Redis by @masenf in #2574

Better Image Serialization

Improves mime type detection for more types of PIL Image objects.

Other Improvements

Bug Fixes

  • Fix SQLAlchemy list types by @benedikt-bartscher in #2668
  • [REF-2045] Implement reduce_ex for MutableProxy by @masenf in #2688
  • Fix for setting rx.theme(appearance="dark") (Note: dark mode does not work with rx.theme_panel)
    • Apply app theme color_mode/appearance as next-themes default by @masenf in #2654
  • rx.Upload can now contain children components that use State.

Accordion Issues

  • Fix Browser Warnings
  • Fix accordion not working with rx.foreach

Other Changes

New Contributors

v0.4.1

20 Feb 02:49
6384c62

Choose a tag to compare

Fix Windows Hot-reload

Improvements

Avoid Browser Error When Uploading

  • fix: File upload error after using rx.clear_selected_files by @abulvenz in #2666

Bug Fixes

  • [REF-1993] link: respect is_external prop and other attributes on A tag by @masenf in #2651

New Contributors

Full Changelog: v0.4.0...v0.4.1

v0.4.0

16 Feb 22:33
899e35e

Choose a tag to compare

See our blog post for more details on this release: https://reflex.dev/blog/2024-02-16-reflex-v0.4.0

Known Issues

Hot reload on windows does not seem to work (Under investigation)

Breaking Changes

Top-level Namespace is now Radix Components

See the latest Reflex documentation for complete information about the new components API.

Run reflex script keep-chakra to retain compatibility with 0.3.x apps.

This script will automatically update your app code to reference previous top-level namespace via rx.chakra.<x>

Some components are no longer available in the core library and must now be accessed via rx.chakra such as:

  • circular_progress
  • stat and stat_group
  • list (Use rx.unordered_list(list_style_type="none") instead)
  • pin_input
  • circle
  • button_group

Component Prop Changes

  • rx.progress no longer supports is_indeterminate
  • rx.slider: value is expected to be a list of numbers, one for each slider thumb. on_change will be called with a list of numbers, one for each slider thumb.
  • rx.vstack and rx.hstack no longer center content by default.
  • rx.icon uses Lucide tags (rx.chakra.icon for the previous tags)
  • spacing and size props accept radix scale, generally string integers, from "0" to "9".
    • To apply CSS units, use CSS props like gap, height, width, padding, etc.
  • type_, max_, and min_ props should be specified without the trailing underscore.

Radix Themes

Apply themes to the root rx.App component via the theme=rx.theme(...) prop. This will apply the theme to all radix components.

New Features

Upload Workflow Refactor

  • Set upload dir via environment variable REFLEX_UPLOADED_FILES_DIR, which defaults to ./uploaded_files.
  • Use rx.get_upload_dir() to access the upload directory from the backend.
  • Use rx.get_upload_url(filename) to get a link to the uploaded file in the frontend.

rx.download now accepts str or bytes for data argument

Allow users to download data directly from the backend without writing to an intermediate file.

All Changes

Read more

v0.3.10

06 Feb 00:38
f5f7dcc

Choose a tag to compare

New Features

Lucide Icons (rx.lucide.icon)

View all iconds available via rx.lucide.icon at https://lucide.dev/icons/.

In 0.4.0, these icons will become the default icon set exposed at rx.icon.

Customize Reflex Directory location

Set REFLEX_DIR environment variable to control where reflex will download and install supporting
tools like bun, fnm, and node.

Improvements

  • Tabs validate parent is proper tab container by @tankztz in #2463

Only expose /_upload when using Upload component

  • auto enable /_upload endpoint only if Upload component is used by @benedikt-bartscher in #2430
  • Move is_used to Upload component rather than UploadFilesProvider by @masenf in #2514

Better SQLAlchemy Interoperability

Faster .pyi Generation (internal)

Fast Compilation

Use multiprocessing to compile CPU-bound pages faster.

Bug Fixes

Radix

The team is currently stabilizing the new radix-ui integration in preparation for our forthcoming 0.4.0
release.

Other Changes

New Contributors

Full Changelog: v0.3.9...v0.3.10

v0.3.9

22 Jan 21:47
82ce265

Choose a tag to compare

New Features

Mixin Classes can now be used to augment State subclasses

Improvements

Bug fixes

Radix UI Preview

Other Changes

  • Update comments in template apps by @masenf in #2370
  • Get rid of compile in readme by @Alek99 in #2371
  • integration tests: disable windows builds for reflex-web by @masenf in #2417
  • Allow app harness tests to import State subclasses by @masenf in #2408

Full Changelog: v0.3.8...v0.3.9

v0.3.8

08 Jan 21:33
43a0867

Choose a tag to compare

Deprecations

app.compile() boilerplate is no longer required

New Features

rx.match construct

rx.match acts as a switch statement, mapping multiple values to components or props.

rx.button(
    State.mood,
    background_color=rx.match(
        State.mood,
        ("happy", "yellow"),
        ("sad", "blue"),
        ("angry", "red"),
        ("tickled", "pink"),
        "",  # last value provided is the default
    )
)

Add rx.time_picker component

Improvements

  • add size prop to the number input by @dodeca-6-tope in #2311
  • Add darkMode for Tailwind config by @romain-bury in #2312
  • Add reflex init app name validator, prevent import failure during reflex run by @Jishnu-Nandhiath in #2336
  • Support Bare SQLAlchemy DeclarativeBase models access via State

Bug Fixes

  • REF-1476/Create .web only after template selection by @ElijahAhianyo in #2288
  • Chakra input component type_ prop literal by @ElijahAhianyo in #2292
  • Bug fix: Export should only excludes assets folder if it's in the top level by @martinxu9 in #2308
  • fix tailwind for stateful components imported from utils by @Lendemor in #2328
  • Fix browser warning when rendering lists via rx.markdown
    • Avoid passing props to lists and list items by @masenf in #2326
  • fix editable property of columns being ignored in data_editor by @Lendemor in #2338
  • Allow tailwind to be completely disabled
    • [REF-1365] Radix + Tailwind Compatibility (and allow tailwind to be completely disabled) by @masenf in #2246
  • Handle VarData roundtrip when encoded value contains newline by @masenf in #2350

Radix UI Preview

Other

New Contributors

Full Changelog: v0.3.7...v0.3.8

v0.3.7

14 Dec 23:55
caedda5

Choose a tag to compare

New Features

  • add next/image and next-video in next namespace by @Lendemor in #2223

Improvements

  • Support SQLAlchemy v2
    • [REF-24] support SQLModel 0.0.14 + SQLAlchemy 2 by @masenf in #2283
  • Support redis: and rediss: uri for REDIS_URI (and allow authentication)
  • capture exceptions thrown by any process in run_concurrently_context by @jackie-pc in #2296

Bug Fixes

Radix (WiP)

Other Changes

New Contributors

Full Changelog: v0.3.6...v0.3.7

v0.3.6

06 Dec 21:41
46d0388

Choose a tag to compare

This release fixes an issue with v0.3.5 in using base HTML components with state.

What's Changed

Full Changelog: v0.3.5...v0.3.6

v0.3.5

06 Dec 16:00
94f657c

Choose a tag to compare

Known Issues

Using rx.el.* namespace tags with State vars is not currently working (#2264)

Breaking Changes

  • Component._get_app_wrap_components is now a staticmethod for performance reasons.

Deprecations

Deprecated features will not be removed until reflex-0.4.0.

Improvements

Performance

This release includes numerous performance improvements during both compile phase and at runtime.

Backend

  • [REF-1035] Track ComputedVar dependency per class by @masenf in #2067
    • Reduce memory and deserialization time for every app user.
  • [REF-201] Separate on_load handler from initial hydration by @masenf in #1847
    • Avoid expensive hydration of entire state when navigating between pages (with @ElijahAhianyo)

Frontend

Each substate in an app can now be accessed independently. Components which depend on any state are automatically pulled out of the main page component and defined within separate "memoized" components that only update when the substates they directly depend upon have changed.

This improves re-render time on some reflex-web pages by 20x πŸš€

  • [REF-889] useContext per substate by @masenf in #2149
  • [REF-144] Add context in each component to prevent rerenders by @masenf in #2198
  • Memoize markdown component_map by @masenf in #2219
  • Support hooks in custom components (state, addEvents) by @masenf in #2234
  • [reflex-web tweaks] Do not memoize children of InputGroup by @masenf in #2230
  • [REF-1349] RechartsCharts and ResponsiveContainer must be memo leaf by @masenf in #2240
  • Generalize MemoizationLeaf Component mixin (and apply to Cond and NextHead) by @masenf in #2247
  • [REF-1352] Markdown component_map hash improvements by @masenf in #2241

Compiler

  • _valid_children and _invalid_children accessible from class by @Lendemor in #2192
    • [fixup] _valid_children and _invalid_children pyi_generator and graphing components by @masenf in #2194
  • Speed up reflex CLI imports by @picklelo in #2185
  • Use singleton app provider to speed up compiles by @picklelo in #2172

Allow Multiple Subclasses of rx.State

Any module can now create substates without importing from a base state defined in the App.

Third-party components may define and use their own substates.

(Note: Working event handlers for substates defined within nested functions are still TODO.)

Improved Basic HTML Elements

The rx.el namespace provides access to basic HTML tags, such as a, div, and p, which can be used to build the frontend instead of using Chakra components. This can be useful when styling the app via tailwind.

As Reflex moves to using radix-ui components, this cleans up the API because many radix components directly inherit from basic HTML elements.

  • HTML Refactor by @Alek99 in #2164
  • [REF-1158] Move chakra-only deps to chakra lib by @masenf in #2171
    • If no chakra components are used, then chakra deps are not installed for the app.
    • [fixup] [reflex-web tweaks] chakra Icon is a ChakraComponent (use sx for style) by @masenf in #2231

Allow PIL images to be serialized in alternate formats

Setting the image.format attribute on a PIL Image.Image object controls what format the image is serialized as when sending to the frontend via data URI.

Add/Subtract time delta with rx.moment

Dependency Bumps

Other Improvements

Bugfixes

Fix _hover, _focus and other leading underscore props

Others

  • fix name for import var when is default and add tests by @Lendemor in #2214
  • code_block responds to color mode by default by @masenf in #2228

Data Editor

Internal

New Contributors

Full Changelog: v0.3.4...v0.3.5

v0.3.4

17 Nov 21:11
0870658

Choose a tag to compare

This release re-exposes top level names under the reflex namespace that were erroneously removed in v0.3.3

New Features

  • [REF-723+] Upload with progress and cancellation by @masenf in #1899

What's Changed

Full Changelog: v0.3.3...v0.3.4