From e45b76c01e1e9abf832e88b34a86b539125e1d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Fri, 15 Nov 2024 12:43:55 -0800 Subject: [PATCH 1/3] fix noSSRComponent imports (#4386) --- reflex/components/component.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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 = ( From dc347d10b3bcb8caec9dc8247a17bbd2b4f179de Mon Sep 17 00:00:00 2001 From: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Date: Sat, 16 Nov 2024 01:27:05 +0100 Subject: [PATCH 2/3] fix: Failed to CreateArtifact (#4339) --- .github/workflows/integration_app_harness.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 34c11fdf108395fcacbe2488655969fef5c7958c Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Mon, 18 Nov 2024 10:31:11 -0800 Subject: [PATCH 3/3] require typing_extensions >= 4.6.0 (#4373) * require typing_extensions >= 4.6.0 TypeAliasType was added in 4.6 https://github.com/python/typing_extensions/blob/main/CHANGELOG.md#release-460-may-22-2023 * update lock file, even though nothing has changed --- poetry.lock | 2 +- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 8199c975a..55ce64a09 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3050,4 +3050,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "937f0cadb1a4566117dad8d0be6018ad1a8fe9aeb19c499d2a010d36ef391ee1" +content-hash = "8975c9e30cd8e1d1968f2344218ea4fa0548462edff4bee4046513882b7bad25" diff --git a/pyproject.toml b/pyproject.toml index 20bf81d92..f251b0ba8 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"