diff --git a/.github/workflows/integration_app_harness.yml b/.github/workflows/integration_app_harness.yml index ee9394b7e..6ac5fe6ab 100644 --- a/.github/workflows/integration_app_harness.yml +++ b/.github/workflows/integration_app_harness.yml @@ -50,7 +50,7 @@ jobs: - run: poetry run uv pip install pyvirtualdisplay pillow pytest-split - name: Run app harness tests env: - SCREENSHOT_DIR: /tmp/screenshots + SCREENSHOT_DIR: /tmp/screenshots/${{ matrix.state_manager }}/${{ matrix.python-version }}/${{ matrix.split_index }} REDIS_URL: ${{ matrix.state_manager == 'redis' && 'redis://localhost:6379' || '' }} run: | poetry run playwright install --with-deps diff --git a/poetry.lock b/poetry.lock index b9f72eb0a..3c6bf28ee 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2542,13 +2542,13 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.41.2" +version = "0.41.3" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.41.2-py3-none-any.whl", hash = "sha256:fbc189474b4731cf30fcef52f18a8d070e3f3b46c6a04c97579e85e6ffca942d"}, - {file = "starlette-0.41.2.tar.gz", hash = "sha256:9834fd799d1a87fd346deb76158668cfa0b0d56f85caefe8268e2d97c3468b62"}, + {file = "starlette-0.41.3-py3-none-any.whl", hash = "sha256:44cedb2b7c77a9de33a8b74b2b90e9f50d11fcf25d8270ea525ad71a25374ff7"}, + {file = "starlette-0.41.3.tar.gz", hash = "sha256:0e4ab3d16522a255be6b28260b938eae2482f98ce5cc934cb08dce8dc3ba5835"}, ] [package.dependencies] @@ -3033,4 +3033,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "cbd3aec9a795dcb26019fd4bc7f9ef31194054858ba55bfe1467f65c3dbaaf1a" +content-hash = "99d5de7cfecc9293f052d5e84a3c37d7ba93acf5cfb1f83b3ba203826fa0781d" diff --git a/pyproject.toml b/pyproject.toml index 29acb8dfb..7639c06f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ twine = ">=4.0.0,<6.0" tomlkit = ">=0.12.4,<1.0" lazy_loader = ">=0.4" reflex-chakra = ">=0.6.0" +typing_extensions = ">=4.6.0" [tool.poetry.group.dev.dependencies] pytest = ">=7.1.2,<9.0" diff --git a/reflex/components/component.py b/reflex/components/component.py index face5d557..4b850ba7d 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -1904,6 +1904,11 @@ memo = custom_component class NoSSRComponent(Component): """A dynamic component that is not rendered on the server.""" + def _get_import_name(self) -> None | str: + if not self.library: + return None + return f"${self.library}" if self.library.startswith("/") else self.library + def _get_imports(self) -> ParsedImportDict: """Get the imports for the component. @@ -1917,8 +1922,9 @@ class NoSSRComponent(Component): _imports = super()._get_imports() # Do NOT import the main library/tag statically. - if self.library is not None: - _imports[self.library] = [ + import_name = self._get_import_name() + if import_name is not None: + _imports[import_name] = [ imports.ImportVar( tag=None, render=False, @@ -1936,10 +1942,10 @@ class NoSSRComponent(Component): opts_fragment = ", { ssr: false });" # extract the correct import name from library name - if self.library is None: + base_import_name = self._get_import_name() + if base_import_name is None: raise ValueError("Undefined library for NoSSRComponent") - - import_name = format.format_library_name(self.library) + import_name = format.format_library_name(base_import_name) library_import = f"const {self.alias if self.alias else self.tag} = dynamic(() => import('{import_name}')" mod_import = (