Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-3903] bundle next link in window #4064

Merged
merged 1 commit into from
Oct 7, 2024
Merged
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
13 changes: 6 additions & 7 deletions reflex/components/dynamic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Components that are dynamically generated on the backend."""

from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Union

from reflex import constants
from reflex.utils import imports
Expand All @@ -26,14 +26,10 @@ def get_cdn_url(lib: str) -> str:
return f"https://cdn.jsdelivr.net/npm/{lib}" + "/+esm"


bundled_libraries = {
"react",
"@radix-ui/themes",
"@emotion/react",
}
bundled_libraries = {"react", "@radix-ui/themes", "@emotion/react", "next/link"}


def bundle_library(component: "Component"):
def bundle_library(component: Union["Component", str]):
"""Bundle a library with the component.

Args:
Expand All @@ -42,6 +38,9 @@ def bundle_library(component: "Component"):
Raises:
DynamicComponentMissingLibrary: Raised when a dynamic component is missing a library.
"""
if isinstance(component, str):
bundled_libraries.add(component)
return
if component.library is None:
raise DynamicComponentMissingLibrary("Component must have a library to bundle.")
bundled_libraries.add(format_library_name(component.library))
Expand Down
Loading