Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@

from reflex_base.utils import lazy_loader

# `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]] = {
"code": [
"CodeBlock",
"code_block",
"LiteralCodeLanguage",
],
"dataeditor": ["data_editor", "data_editor_theme", "DataEditorTheme"],
"logo": ["logo"],
}

Expand Down
2 changes: 1 addition & 1 deletion pyi_hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Empty file.
24 changes: 24 additions & 0 deletions tests/units/reflex_components_core/datadisplay/test_init.py
Original file line number Diff line number Diff line change
@@ -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
Loading