From 6e7ac0852e5535dcfce7acf2a201d6925a613308 Mon Sep 17 00:00:00 2001 From: Benedikt Bartscher Date: Thu, 10 Sep 2026 22:22:52 +0200 Subject: [PATCH 1/2] fix(components): drop dead datadisplay lazy exports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `reflex_components_core.datadisplay` still lazy-attached `code` and `dataeditor` submodules, but those shipped out to the standalone reflex-components-code and reflex-components-dataeditor packages, so nothing under `reflex_components_core/datadisplay/` provides them: >>> import reflex_components_core.datadisplay as dd >>> dd.code_block ModuleNotFoundError: No module named 'reflex_components_core.datadisplay.code' The generated stub inherited the same dead entries and imported `.code` and `.dataeditor`, which pyright reports as unresolved imports. The names users reach for keep working: `rx.code_block` / `rx.data_editor` resolve against the new packages, and `reflex.components.datadisplay.code` is redirected there by the import hook in `reflex/components/__init__.py` — both covered by the new tests. --- .../+datadisplay-stale-lazy-exports.bugfix.md | 1 + .../datadisplay/__init__.py | 9 +++---- pyi_hashes.json | 2 +- .../datadisplay/__init__.py | 0 .../datadisplay/test_init.py | 24 +++++++++++++++++++ 5 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 packages/reflex-components-core/news/+datadisplay-stale-lazy-exports.bugfix.md create mode 100644 tests/units/reflex_components_core/datadisplay/__init__.py create mode 100644 tests/units/reflex_components_core/datadisplay/test_init.py diff --git a/packages/reflex-components-core/news/+datadisplay-stale-lazy-exports.bugfix.md b/packages/reflex-components-core/news/+datadisplay-stale-lazy-exports.bugfix.md new file mode 100644 index 00000000000..4f36968187d --- /dev/null +++ b/packages/reflex-components-core/news/+datadisplay-stale-lazy-exports.bugfix.md @@ -0,0 +1 @@ +`reflex_components_core.datadisplay` no longer advertises `code_block`, `data_editor` and friends: those moved to the standalone `reflex-components-code` and `reflex-components-dataeditor` packages, so accessing them here raised `ModuleNotFoundError`. Reach them as before via `rx.code_block` / `rx.data_editor`, or `reflex.components.datadisplay.code`. diff --git a/packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.py b/packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.py index ed58e667da1..db100c484fa 100644 --- a/packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.py +++ b/packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.py @@ -4,13 +4,10 @@ from reflex_base.utils import lazy_loader +# `code` and `dataeditor` used to live here; they now ship as the standalone +# reflex-components-code and reflex-components-dataeditor packages, which +# `reflex.components.datadisplay` maps onto. _SUBMOD_ATTRS: dict[str, list[str]] = { - "code": [ - "CodeBlock", - "code_block", - "LiteralCodeLanguage", - ], - "dataeditor": ["data_editor", "data_editor_theme", "DataEditorTheme"], "logo": ["logo"], } diff --git a/pyi_hashes.json b/pyi_hashes.json index 65f8c8ae669..6f29ed803b1 100644 --- a/pyi_hashes.json +++ b/pyi_hashes.json @@ -22,7 +22,7 @@ "packages/reflex-components-core/src/reflex_components_core/core/sticky.pyi": "a910d65f42f620531c959677d22977cb", "packages/reflex-components-core/src/reflex_components_core/core/upload.pyi": "d903297d188fe6fe56a824127e0db925", "packages/reflex-components-core/src/reflex_components_core/core/window_events.pyi": "3e39f7b3282570da5d2d3ac503d1f278", - "packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.pyi": "f46edcf2c5bd4b80894b4d0f623e059b", + "packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.pyi": "fd3cea1f1a221ed3404c28ec4fec7b3c", "packages/reflex-components-core/src/reflex_components_core/el/__init__.pyi": "ca9bfe7ba432aa47d982a144ef374126", "packages/reflex-components-core/src/reflex_components_core/el/element.pyi": "930b020d7c933ab0e29ba7971ba1abd2", "packages/reflex-components-core/src/reflex_components_core/el/elements/__init__.pyi": "ded6fc0acc37c9260da5cfd5f4309079", diff --git a/tests/units/reflex_components_core/datadisplay/__init__.py b/tests/units/reflex_components_core/datadisplay/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/units/reflex_components_core/datadisplay/test_init.py b/tests/units/reflex_components_core/datadisplay/test_init.py new file mode 100644 index 00000000000..5d4fa5446ac --- /dev/null +++ b/tests/units/reflex_components_core/datadisplay/test_init.py @@ -0,0 +1,24 @@ +"""Tests for the lazily loaded reflex_components_core.datadisplay namespace.""" + +import importlib + +import pytest +import reflex_components_core.datadisplay as datadisplay + + +@pytest.mark.parametrize("name", datadisplay.__all__) +def test_lazy_attribute_resolves(name: str): + """Every exported name must actually be importable.""" + assert getattr(datadisplay, name) is not None + + +@pytest.mark.parametrize( + ("module", "name"), + [ + ("reflex.components.datadisplay.code", "code_block"), + ("reflex.components.datadisplay.dataeditor", "data_editor"), + ], +) +def test_split_out_components_still_reachable(module: str, name: str): + """The components that moved out keep working through reflex.components.""" + assert getattr(importlib.import_module(module), name) is not None From 79c846c9521d74dfc6bea0d97da81604a3a96986 Mon Sep 17 00:00:00 2001 From: Benedikt Bartscher Date: Sun, 13 Sep 2026 00:23:12 +0200 Subject: [PATCH 2/2] docs(components): describe the datadisplay namespace without change narration --- .../src/reflex_components_core/datadisplay/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.py b/packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.py index db100c484fa..cfbcf83ad7e 100644 --- a/packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.py +++ b/packages/reflex-components-core/src/reflex_components_core/datadisplay/__init__.py @@ -4,9 +4,9 @@ from reflex_base.utils import lazy_loader -# `code` and `dataeditor` used to live here; they now ship as the standalone -# reflex-components-code and reflex-components-dataeditor packages, which -# `reflex.components.datadisplay` maps onto. +# `code_block` and `data_editor` ship as the standalone reflex-components-code +# and reflex-components-dataeditor packages, which `reflex.components.datadisplay` +# maps onto. _SUBMOD_ATTRS: dict[str, list[str]] = { "logo": ["logo"], }