Skip to content

Releases: TheUkrainian1991/streamlit-elements-fluence

v3.0.0

Choose a tag to compare

@TheUkrainian1991 TheUkrainian1991 released this 03 Jul 11:49
ba0dc24

Release 3.0.0

streamlit-elements-fluence 3.0.0 is the fork's rewrite from the original branch onto Streamlit's Custom Components v2 protocol. The release removes the old iframe bridge, updates the frontend stack, refreshes the supported component set, and packages prebuilt frontend assets so normal Python installs do not need Node.js.

Highlights

  • Rebuilt the frontend on Streamlit CCv2 (st.components.v2) instead of the legacy streamlit-component-lib iframe bridge.
  • Moved the frontend from Next.js to a Vite/React/TypeScript build based on Streamlit's component-template v2 layout.
  • Mounted the component directly into the Streamlit app DOM with isolate_styles=False, so MUI and Nivo can follow Streamlit theme CSS variables.
  • Reworked Python callback dispatch around CCv2 trigger values (events) instead of the old widget-registration monkey patch.
  • Added frontend error boundaries and Python-side ElementsFrontendError messages with frame key, JavaScript message, stack, and component stack where available.
  • Added reproducible packaging and build commands through Makefile, pyproject.toml, and wheel-verified frontend assets.
  • Added smoke_test_app.py and focused unit coverage for serialization, callback dispatch, component registration, and CCv2 asset wiring.

Requirements

  • Python >=3.9
  • Streamlit >=1.55
  • Node.js and npm only when rebuilding the frontend from source

End users installing the wheel do not need Node.js or npm. Built JavaScript and CSS assets are included in the package under streamlit_elements_fluence/frontend/build/.

Install

pip install https://github.com/TheUkrainian1991/streamlit-elements-fluence/releases/archive/refs/tags/v3.0.0.tar.gz

For repository development:

make frontend   # npm ci + frontend build
make test       # pytest tests/ -q
make dist       # frontend + tests + python -m build
make clean      # remove build artifacts

make frontend uses npm ci, so the committed package-lock.json is the source of truth for frontend dependencies.

Breaking Changes From 2.x

  • The component no longer runs in an iframe. Code that depended on iframe behavior, iframe-specific CSS, or window.parent assumptions must be updated.
  • editor and media modules were removed. Monaco editor and ReactPlayer are no longer bundled.
  • mui.DataGridPro and st.session_state.mui_license were removed. Use mui.DataGrid from MUI X Community instead.
  • MUI X upgraded to v9. onRowSelectionModelChange now receives a selection model object, serialized to Python as {"type": "include"|"exclude", "ids": [...]}, not a bare list of IDs.
  • MUI's plain mui.Grid uses the v9 size prop, for example size={"xs": 12, "md": 6}. This does not affect dashboard.Grid.
  • SwipeableViews and other MUI Lab widgets no longer shipped by upstream MUI Lab were removed.
  • Nivo upgraded from 0.79 to 0.99. Some chart data/theme props changed upstream, including HeatMap data shape and global text styling under theme.text.
  • event.Hotkey is now page-global rather than scoped to the individual elements() frame.
  • Frontend render/evaluation errors now show an in-component error panel and are reported to Python as ElementsFrontendError.

Components And Dependencies

MUI

The release uses MUI v9 packages, including @mui/material, @mui/icons-material, @mui/lab, and @mui/x-data-grid. GridToolbar remains available alongside newer MUI X toolbar exports, but showToolbar=True is the preferred simple way to show the built-in DataGrid toolbar.

Dashboard Grid

dashboard.Grid and dashboard.Item keep the existing Python API. Internally, react-grid-layout is pinned to ^1.5.x because v2 removed the WidthProvider API this component uses.

Nivo

Existing chart modules were upgraded to Nivo 0.99, and this release adds these chart wrappers:

  • BoxPlot
  • Funnel
  • Icicle, IcicleHtml
  • Marimekko
  • Network, NetworkCanvas
  • ParallelCoordinates, ParallelCoordinatesCanvas
  • PolarBar
  • Tree, TreeCanvas
  • Voronoi

@nivo/parallel-coordinates@0.99.0 currently ships without TypeScript declaration files upstream. Runtime usage works, but frontend development has a targeted type suppression for that package.

Packaging Changes

  • Replaced legacy setup.py / setup.cfg packaging with pyproject.toml.
  • Added the package-local Streamlit component manifest at streamlit_elements_fluence/pyproject.toml.
  • Included built frontend assets and the component manifest in wheels and sdists.
  • Added MANIFEST.in coverage for frontend/build.
  • Version is now 3.0.0 in root metadata, package manifest, and streamlit_elements_fluence/version.py.

The CCv2 component registration name is:

streamlit-elements-fluence.streamlit_elements_fluence

Assets are served by Streamlit from:

/_stcore/bidi-components/streamlit-elements-fluence.streamlit_elements_fluence/<asset>

Examples And Smoke Testing

  • Example.py was updated from DataGridPro/license usage to community mui.DataGrid with showToolbar=True.
  • smoke_test_app.py exercises Python callbacks, lazy callback flushing, JavaScript callbacks, DataGrid selection, Nivo charts, dashboard drag/resize, error panels, theme following, and multi-frame callback isolation.

Manual browser checks are still recommended for drag/resize behavior, DataGrid popovers, dark-theme switching, JavaScript alerts, and chart rendering because the automated environment did not include browser automation.

Validation Performed

The rewrite was verified with:

  • Frontend typecheck and Vite production build.
  • Python unit tests: 11 passed after the final fix wave.
  • Editable reinstall of streamlit-elements-fluence==3.0.0.
  • make dist, producing wheel and sdist artifacts.
  • Fresh-venv install of the built wheel with streamlit==1.55.0.
  • Headless Streamlit boot checks for smoke_test_app.py and Example.py.
  • HTTP 200 checks for the app shell, health endpoint, CCv2 entry chunk, CSS asset, MUI DataGrid chunk, and selected Nivo chunks.

Known Follow-Ups

  • Complete the manual browser checklist in smoke_test_app.py before treating interactive behavior as fully signed off.
  • The emitted CSS asset is currently named index-_hash_.css; it is served correctly through the index-*.css glob, but the literal name is a cache-busting cosmetic issue.
  • Example.py still contains a pre-existing malformed InnerHTML snippet. It does not block the CCv2 release but should be cleaned up separately.

v1.0.0-beta1

v1.0.0-beta1 Pre-release
Pre-release

Choose a tag to compare

@TheUkrainian1991 TheUkrainian1991 released this 11 Mar 12:00

streamlit-elements-fluence Release Notes

Summary

This release updates streamlit-elements-fluence to work with Streamlit 1.55.0 and modernizes both the Python backend and frontend dependencies. It includes import-path fixes, callback/rendering improvements, better frontend error reporting, theme handling improvements, and refreshed frontend libraries including MUI, MUI X, Nivo, and streamlit-component-lib.

Compatibility

  • Confirmed working with: streamlit 1.55.0
  • Python requirement: >= 3.8
  • Streamlit requirement: >= 1.37.0

Important warnings

Warning: Custom theming in .streamlit/config.toml can cause a component error on RGB colours (use HEX instead).

Warning: Button callbacks using JSCallback are still temperamental.


Highlights

  • Restored compatibility with newer Streamlit versions.
  • Fixed multiple broken import paths after package renaming.
  • Improved callback handling and frontend-to-backend error reporting.
  • Updated major frontend dependencies:
    • MUI: 5.5 → 5.16
    • MUI X: 5.x → 6.x
    • Nivo: 0.79 → 0.99
    • streamlit-component-lib: 1.4 → 2.0
  • Frontend build verified with Node 18.
  • Added smoke tests covering chart and button rendering.

Changes Made

Python fixes

streamlit_elements_fluence/core/callback.py

  • Fixed import path:
    • streamlit_elements → streamlit_elements_fluence
  • Removed unused components import.
  • Improved frontend error handling:
    • Stores structured frontend errors in session state instead of raising immediately during callback dispatch.
    • Normalizes error payloads with:
      • source
      • name
      • message
      • optional stack
  • Added a formatter for more consistent backend error messages.

streamlit_elements_fluence/core/render.py

  • Fixed import path.
  • Declared the component once at module level.
  • Added license and on_change parameters.

streamlit_elements_fluence/core/frame.py

  • Fixed 4 import paths.
  • Restored the JSCallback serialization branch.
  • Added license to the render_component() call.
  • Simplified on_change handling by removing an unnecessary guard.
  • Consumes stored frontend errors after render and raises ElementsFrontendError with formatted details.

streamlit_elements_fluence/core/element.py

  • Fixed callback prop mapping:
    • Preserves onClick props.
    • Keeps on_change as an alias mapped to React onChange.

Config updates

setup.cfg

  • Updated python_requires to >= 3.8
  • Updated Streamlit dependency to >= 1.37.0

Frontend changes

streamlit_elements_fluence/frontend/package.json

  • Updated frontend dependency versions:
    • MUI: 5.5 → 5.16
    • MUI X: 5.x → 6.x
    • Nivo: 0.79 → 0.99
    • streamlit-component-lib: 1.4 → 2.0
  • Fixed the macOS sed issue in the del-source-maps script.
  • Frontend built successfully with Node 18.

Frontend/runtime improvements

streamlit_elements_fluence/frontend/components/ElementsApp.tsx

  • Added structured frontend error reporting.
  • JS eval errors and React ErrorBoundary errors are now serialized with richer metadata:
    • source
    • name
    • message
    • stack
  • Updated licensing-related import to use:
    • @mui/x-license-pro

streamlit_elements_fluence/frontend/components/ElementsTheme.tsx

  • Improved theme robustness:
    • Supports both flat theme config and mode-scoped theme config such as:
      • theme.light
      • theme.dark
  • Uses safer type guards and fallback defaults.
  • Includes a fallback font path.
  • Refactored theme creation to use useMemo.

streamlit_elements_fluence/frontend/components/modules/charts/Nivo.tsx

  • Removed duplicate BoxPlot element declaration.

Feature impact

  • The MUI and Nivo upgrades bring access to newer charts and components.
  • Theme handling is more resilient, though .streamlit/config.toml custom theming may still break the component.

Tests

Added a smoke test app and runner:

  • tests/apps/chart_button_smoke_app.py
  • tests/run_chart_button_smoke.py

Smoke test validates

  • No Streamlit/component exceptions on run.
  • A component instance is rendered.
  • Serialized payload includes expected:
    • MUI button render calls
    • Nivo bar chart render calls

Upgrade notes

This release is mainly a compatibility and stability update for newer Streamlit versions, with some overdue frontend dependency refreshes. The most meaningful backend improvements are around:

  • callback reliability
  • error visibility
  • import-path cleanup after renaming

The main caveats remain:

  • custom theming can still break rendering
  • JSCallback-based button callbacks are not fully reliable

For most users, the key takeaway is:

This version brings streamlit-elements-fluence forward to modern Streamlit, modern MUI, and newer charting libraries, while also making debugging frontend issues much easier.

v0.1.6

Choose a tag to compare

@TheUkrainian1991 TheUkrainian1991 released this 12 Mar 13:09

This release maintains the react build of v0.1.4 from the original streamlit-elements-fluence repository

Confirmed working on streamlit 1.39.0 - 1.55.0

Why this release exists

Streamlit 1.39.0 removed the internal register_widget function that 0.1.4 monkey-patched to wire up Python callbacks. This broke all Python-side event handling (e.g. button clicks, DataGrid row selection) while JS-only features (chart downloads, formatters) continued to work.

The 0.1.6 archive reuses the original 0.1.4 frontend build (no rebuild) and applies only Python-side changes.

What changed

Changes as discovered in streamlit-elements/issues/35#issuecomment-3429692287

setup.cfg

  • python_requires bumped from >= 3.6 to >= 3.8
  • streamlit minimum bumped from >= 1.4.0 to >= 1.37.0
  • Version source changed from attr: streamlit_elements_fluence.__version__ to attr: streamlit_elements_fluence.version.__version__ (avoids heavy imports at build time)

core/callback.py — replaced monkey-patching with native on_change

  • Removed the _patch_register_widget function and the startup monkey-patch of components.register_widget
  • Removed imports: from streamlit.components.v1 import components and from streamlit_elements_fluence.core.exceptions import ElementsFrontendError
  • ElementsCallbackManager.__slots__ gained _frontend_error_key
  • dispatch() rewritten:
    • Reads widget data via session_state.get(self._key, "{}") instead of session_state[self._key]
    • Wrapped JSON parsing in try/except (json.JSONDecodeError, TypeError) for defensive handling
    • Frontend errors are stored in session_state (via _frontend_error_key) instead of raising immediately — this lets frame.py surface them after render
    • Sorted items now filtered with if isinstance(v, dict) to skip non-callback entries
  • Added consume_frontend_error() method to pop stored frontend errors
  • Added module-level helpers: _normalize_frontend_error() and format_frontend_error()
  • ElementsCallbackData.__getattr__ now raises AttributeError (was KeyError)

core/render.py — added on_change and license parameters

  • declare_component result stored in _component (private)
  • Exposed via new render_component() function accepting on_change and license keyword arguments
  • Previously render_component was the raw component callable with no on_change support

core/frame.py — wired up the new callback path

  • render_component() call now passes on_change=frame._callback_manager.dispatch
  • Added import of ElementsFrontendError and format_frontend_error
  • After render, consumes any stored frontend error and raises ElementsFrontendError if present
  • serialize(): moved JSCallback check before the Callable check (in 0.1.4 it was after, which meant JSCallback objects could be intercepted by the Callable branch first — this was a latent bug)
  • Added str arrow-function passthrough: elif isinstance(obj, str) and '=>' in obj: return obj
  • new_element() now accepts an optional on_change keyword argument
  • ElementsFrame.__slots__ gained _items

Compatibility

Streamlit version 0.1.4 0.1.6
< 1.37.0 Works Not supported
1.37.0 – 1.38.x Works Works
>= 1.39.0 Broken (callbacks fail) Works

How the archive was created

1. Extracted dist/streamlit-elements-fluence-0.1.4.tar.gz
2. Replaced only the Python files listed above (no frontend rebuild)
3. Recompressed as streamlit-elements-fluence-0.1.6.tar.gz
4. Installed with: pip install dist/streamlit-elements-fluence-0.1.6.tar.gz

v0.1.5

Choose a tag to compare

@TheUkrainian1991 TheUkrainian1991 released this 25 Oct 14:53

This release works on streamlit 1.34.0-1.38.0

Main change

In callbacks.py changed
from streamlit.components.v1 import components
to from streamlit.components.v1 import custom_component as components

What isn't changed

This update did not rebuild the react javascript.
All I did was extract the original 0.1.4.tar.gz from https://pypi.org/project/streamlit-elements-fluence/, edited the callback.py/version and repackaged

To install

pip install https://github.com/TheUkrainian1991/streamlit-elements-fluence/releases/download/v0.1.5/streamlit-elements-fluence-0.1.5.tar.gz