Repository navigation
Releases: TheUkrainian1991/streamlit-elements-fluence
Release list
v3.0.0
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 legacystreamlit-component-libiframe 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
ElementsFrontendErrormessages 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.pyand 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.gzFor repository development:
make frontend # npm ci + frontend build
make test # pytest tests/ -q
make dist # frontend + tests + python -m build
make clean # remove build artifactsmake 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.parentassumptions must be updated. editorandmediamodules were removed. Monaco editor and ReactPlayer are no longer bundled.mui.DataGridProandst.session_state.mui_licensewere removed. Usemui.DataGridfrom MUI X Community instead.- MUI X upgraded to v9.
onRowSelectionModelChangenow receives a selection model object, serialized to Python as{"type": "include"|"exclude", "ids": [...]}, not a bare list of IDs. - MUI's plain
mui.Griduses the v9sizeprop, for examplesize={"xs": 12, "md": 6}. This does not affectdashboard.Grid. SwipeableViewsand 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.Hotkeyis now page-global rather than scoped to the individualelements()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:
BoxPlotFunnelIcicle,IcicleHtmlMarimekkoNetwork,NetworkCanvasParallelCoordinates,ParallelCoordinatesCanvasPolarBarTree,TreeCanvasVoronoi
@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.cfgpackaging withpyproject.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.incoverage forfrontend/build. - Version is now
3.0.0in root metadata, package manifest, andstreamlit_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.pywas updated fromDataGridPro/license usage to communitymui.DataGridwithshowToolbar=True.smoke_test_app.pyexercises 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 passedafter 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.pyandExample.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.pybefore treating interactive behavior as fully signed off. - The emitted CSS asset is currently named
index-_hash_.css; it is served correctly through theindex-*.cssglob, but the literal name is a cache-busting cosmetic issue. Example.pystill contains a pre-existing malformedInnerHTMLsnippet. It does not block the CCv2 release but should be cleaned up separately.
v1.0.0-beta1
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.tomlcan cause a component error on RGB colours (use HEX instead).
Warning: Button callbacks using
JSCallbackare 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
- MUI:
- 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
componentsimport. - Improved frontend error handling:
- Stores structured frontend errors in session state instead of raising immediately during callback dispatch.
- Normalizes error payloads with:
sourcenamemessage- 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
licenseandon_changeparameters.
streamlit_elements_fluence/core/frame.py
- Fixed 4 import paths.
- Restored the
JSCallbackserialization branch. - Added
licenseto therender_component()call. - Simplified
on_changehandling by removing an unnecessary guard. - Consumes stored frontend errors after render and raises
ElementsFrontendErrorwith formatted details.
streamlit_elements_fluence/core/element.py
- Fixed callback prop mapping:
- Preserves
onClickprops. - Keeps
on_changeas an alias mapped to ReactonChange.
- Preserves
Config updates
setup.cfg
- Updated
python_requiresto>= 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
- MUI:
- Fixed the macOS
sedissue in thedel-source-mapsscript. - 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
ErrorBoundaryerrors are now serialized with richer metadata:sourcenamemessagestack
- 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.lighttheme.dark
- Supports both flat theme config and mode-scoped theme config such as:
- 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
BoxPlotelement declaration.
Feature impact
- The MUI and Nivo upgrades bring access to newer charts and components.
- Theme handling is more resilient, though
.streamlit/config.tomlcustom theming may still break the component.
Tests
Added a smoke test app and runner:
tests/apps/chart_button_smoke_app.pytests/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-fluenceforward to modern Streamlit, modern MUI, and newer charting libraries, while also making debugging frontend issues much easier.
v0.1.6
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_requiresbumped from>= 3.6to>= 3.8streamlitminimum bumped from>= 1.4.0to>= 1.37.0- Version source changed from
attr: streamlit_elements_fluence.__version__toattr: 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_widgetfunction and the startup monkey-patch ofcomponents.register_widget - Removed imports:
from streamlit.components.v1 import componentsandfrom streamlit_elements_fluence.core.exceptions import ElementsFrontendError ElementsCallbackManager.__slots__gained_frontend_error_keydispatch()rewritten:- Reads widget data via
session_state.get(self._key, "{}")instead ofsession_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 letsframe.pysurface them after render - Sorted items now filtered with
if isinstance(v, dict)to skip non-callback entries
- Reads widget data via
- Added
consume_frontend_error()method to pop stored frontend errors - Added module-level helpers:
_normalize_frontend_error()andformat_frontend_error() ElementsCallbackData.__getattr__now raisesAttributeError(wasKeyError)
core/render.py — added on_change and license parameters
declare_componentresult stored in_component(private)- Exposed via new
render_component()function acceptingon_changeandlicensekeyword arguments - Previously
render_componentwas the raw component callable with noon_changesupport
core/frame.py — wired up the new callback path
render_component()call now passeson_change=frame._callback_manager.dispatch- Added import of
ElementsFrontendErrorandformat_frontend_error - After render, consumes any stored frontend error and raises
ElementsFrontendErrorif present serialize(): movedJSCallbackcheck before theCallablecheck (in 0.1.4 it was after, which meantJSCallbackobjects could be intercepted by theCallablebranch first — this was a latent bug)- Added
strarrow-function passthrough:elif isinstance(obj, str) and '=>' in obj: return obj new_element()now accepts an optionalon_changekeyword argumentElementsFrame.__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
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