Skip to content

Commit e3cc02d

Browse files
authored
bump frontend deps for 080 (#5496)
* bump frontend deps for 080 * what
1 parent e99dbe2 commit e3cc02d

10 files changed

Lines changed: 86 additions & 41 deletions

File tree

pyi_hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"reflex/components/react_player/react_player.pyi": "a9917f411d51cf3f291758c9e01844f2",
112112
"reflex/components/react_player/video.pyi": "ef4730235b7902fa30859083db8b36a3",
113113
"reflex/components/recharts/__init__.pyi": "ea5b61055f486497a1901429a9d7c9df",
114-
"reflex/components/recharts/cartesian.pyi": "d9558034d606669ef40f7212b5644539",
114+
"reflex/components/recharts/cartesian.pyi": "38f884467330e1c6e2e9e435ac4ac754",
115115
"reflex/components/recharts/charts.pyi": "58415e7aef3d4642494e1b86aea6589c",
116116
"reflex/components/recharts/general.pyi": "a12735989ef36152b2dab954604953c0",
117117
"reflex/components/recharts/polar.pyi": "ff9f90861ae950d6db9c1bc160303182",

reflex/components/moment/moment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Moment(NoSSRComponent):
3030
tag: str | None = "Moment"
3131
is_default = True
3232
library: str | None = "react-moment@1.1.3"
33-
lib_dependencies: list[str] = ["moment"]
33+
lib_dependencies: list[str] = ["moment@2.30.1"]
3434

3535
# How often the date update (how often time update / 0 to disable).
3636
interval: Var[int]

reflex/components/recharts/cartesian.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,6 @@ class Reference(Recharts):
659659
# If set a string or a number, default label will be drawn, and the option is content.
660660
label: Var[str | int]
661661

662-
# If set true, the line will be rendered in front of bars in BarChart, etc. Default: False
663-
is_front: Var[bool]
664-
665662

666663
class Segment(TypedDict):
667664
"""A segment in a ReferenceLine or ReferenceArea."""
@@ -783,9 +780,6 @@ class ReferenceArea(Recharts):
783780
# Defines how to draw the reference line if it falls partly outside the canvas. If set to 'discard', the reference line will not be drawn at all. If set to 'hidden', the reference line will be clipped to the canvas. If set to 'visible', the reference line will be drawn completely. If set to 'extendDomain', the domain of the overflown axis will be extended such that the reference line fits into the canvas. Default: "discard"
784781
if_overflow: Var[LiteralIfOverflow]
785782

786-
# If set true, the line will be rendered in front of bars in BarChart, etc. Default: False
787-
is_front: Var[bool]
788-
789783
# Valid children components
790784
_valid_children: ClassVar[list[str]] = ["Label"]
791785

reflex/components/recharts/recharts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class Recharts(Component):
99
"""A component that wraps a recharts lib."""
1010

11-
library = "recharts@2.15.3"
11+
library = "recharts@3.0.0"
1212

1313
def _get_style(self) -> dict:
1414
return {"wrapperStyle": self.style}
@@ -17,7 +17,7 @@ def _get_style(self) -> dict:
1717
class RechartsCharts(NoSSRComponent, MemoizationLeaf):
1818
"""A component that wraps a recharts lib."""
1919

20-
library = "recharts@2.15.3"
20+
library = "recharts@3.0.0"
2121

2222

2323
LiteralAnimationEasing = Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]

reflex/components/sonner/toast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def dict(self, *args: Any, **kwargs: Any) -> dict[str, Any]:
171171
class Toaster(Component):
172172
"""A Toaster Component for displaying toast notifications."""
173173

174-
library: str | None = "sonner@2.0.3"
174+
library: str | None = "sonner@2.0.5"
175175

176176
tag = "Toaster"
177177

reflex/constants/installer.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class Bun(SimpleNamespace):
1414
"""Bun constants."""
1515

1616
# The Bun version.
17-
VERSION = "1.2.16"
17+
VERSION = "1.2.17"
1818

1919
# Min Bun Version
20-
MIN_VERSION = "1.2.8"
20+
MIN_VERSION = "1.2.17"
2121

2222
# URL to bun install script.
2323
INSTALL_URL = "https://raw.githubusercontent.com/reflex-dev/reflex/main/scripts/bun_install.sh"
@@ -63,7 +63,7 @@ class Node(SimpleNamespace):
6363
"""Node/ NPM constants."""
6464

6565
# The minimum required node version.
66-
MIN_VERSION = "20.0.0"
66+
MIN_VERSION = "20.19.0"
6767

6868
# Path of the node config file.
6969
CONFIG_PATH = ".npmrc"
@@ -123,7 +123,7 @@ def DEPENDENCIES(cls) -> dict[str, str]:
123123
A dictionary of dependencies with their versions.
124124
"""
125125
return {
126-
"axios": "1.9.0",
126+
"axios": "1.10.0",
127127
"json5": "2.2.3",
128128
"react-router": cls._react_router_version,
129129
"react-router-dom": cls._react_router_version,
@@ -132,19 +132,19 @@ def DEPENDENCIES(cls) -> dict[str, str]:
132132
"react": cls._react_version,
133133
"react-helmet": "6.1.0",
134134
"react-dom": cls._react_version,
135-
"isbot": "5.1.26",
135+
"isbot": "5.1.28",
136136
"socket.io-client": "4.8.1",
137137
"universal-cookie": "7.2.2",
138138
}
139139

140140
DEV_DEPENDENCIES = {
141141
"@emotion/react": "11.14.0",
142142
"autoprefixer": "10.4.21",
143-
"postcss": "8.5.4",
144-
"postcss-import": "16.1.0",
143+
"postcss": "8.5.6",
144+
"postcss-import": "16.1.1",
145145
"@react-router/dev": _react_router_version,
146146
"@react-router/fs-routes": _react_router_version,
147-
"rolldown-vite": "6.3.19",
147+
"rolldown-vite": "7.0.1",
148148
}
149149
OVERRIDES = {
150150
# This should always match the `react` version in DEPENDENCIES for recharts compatibility.

reflex/plugins/shared_tailwind.py

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Tailwind CSS configuration types for Reflex plugins."""
22

33
import dataclasses
4+
from copy import deepcopy
45
from typing import Any, Literal, TypedDict
56

67
from typing_extensions import NotRequired
@@ -40,6 +41,28 @@
4041
)
4142

4243

44+
def remove_version_from_plugin(plugin: TailwindPluginConfig) -> TailwindPluginConfig:
45+
"""Remove the version from a plugin name.
46+
47+
Args:
48+
plugin: The plugin to remove the version from.
49+
50+
Returns:
51+
The plugin without the version.
52+
"""
53+
from reflex.utils.format import format_library_name
54+
55+
if isinstance(plugin, str):
56+
return format_library_name(plugin)
57+
58+
if plugin_import := plugin.get("import"):
59+
plugin_import["from"] = format_library_name(plugin_import["from"])
60+
61+
plugin["name"] = format_library_name(plugin["name"])
62+
63+
return plugin
64+
65+
4366
class TailwindConfig(TypedDict):
4467
"""Tailwind CSS configuration options.
4568
@@ -131,11 +154,27 @@ class TailwindPlugin(PluginBase):
131154
config: TailwindConfig = dataclasses.field(
132155
default_factory=lambda: TailwindConfig(
133156
plugins=[
134-
"@tailwindcss/typography",
157+
"@tailwindcss/typography@0.5.16",
135158
],
136159
)
137160
)
138161

162+
def get_frontend_development_dependencies(self, **context) -> list[str]:
163+
"""Get the packages required by the plugin.
164+
165+
Args:
166+
**context: The context for the plugin.
167+
168+
Returns:
169+
A list of packages required by the plugin.
170+
"""
171+
config = self.get_config()
172+
173+
return [
174+
plugin if isinstance(plugin, str) else plugin.get("name")
175+
for plugin in config.get("plugins", [])
176+
] + config.get("presets", [])
177+
139178
def get_config(self) -> TailwindConfig:
140179
"""Get the Tailwind CSS configuration.
141180
@@ -156,3 +195,21 @@ def get_config(self) -> TailwindConfig:
156195
return rxconfig_config
157196

158197
return self.config
198+
199+
def get_unversioned_config(self) -> TailwindConfig:
200+
"""Get the Tailwind CSS configuration without version-specific adjustments.
201+
202+
Returns:
203+
The Tailwind CSS configuration without version-specific adjustments.
204+
"""
205+
from reflex.utils.format import format_library_name
206+
207+
config = deepcopy(self.get_config())
208+
if presets := config.get("presets"):
209+
# Somehow, having an empty list of presets breaks Tailwind.
210+
# So we only set the presets if there are any.
211+
config["presets"] = [format_library_name(preset) for preset in presets]
212+
config["plugins"] = [
213+
remove_version_from_plugin(plugin) for plugin in config.get("plugins", [])
214+
]
215+
return config

reflex/plugins/tailwind_v3.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,17 @@ def get_frontend_development_dependencies(self, **context) -> list[str]:
151151
A list of packages required by the plugin.
152152
"""
153153
return [
154-
plugin if isinstance(plugin, str) else plugin.get("name")
155-
for plugin in self.get_config().get("plugins", [])
156-
] + [Constants.VERSION]
154+
*super().get_frontend_development_dependencies(**context),
155+
Constants.VERSION,
156+
]
157157

158158
def pre_compile(self, **context):
159159
"""Pre-compile the plugin.
160160
161161
Args:
162162
context: The context for the plugin.
163163
"""
164-
context["add_save_task"](compile_config, self.get_config())
164+
context["add_save_task"](compile_config, self.get_unversioned_config())
165165
context["add_save_task"](compile_root_style)
166166
context["add_modify_task"](Dirs.POSTCSS_JS, add_tailwind_to_postcss_config)
167167
context["add_modify_task"](

reflex/plugins/tailwind_v4.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Constants(SimpleNamespace):
1717
"""Tailwind constants."""
1818

1919
# The Tailwindcss version
20-
VERSION = "tailwindcss@4.1.8"
20+
VERSION = "tailwindcss@4.1.10"
2121
# The Tailwind config.
2222
CONFIG = "tailwind.config.js"
2323
# Default Tailwind content paths
@@ -154,17 +154,18 @@ def get_frontend_development_dependencies(self, **context) -> list[str]:
154154
A list of packages required by the plugin.
155155
"""
156156
return [
157-
plugin if isinstance(plugin, str) else plugin.get("name")
158-
for plugin in self.get_config().get("plugins", [])
159-
] + [Constants.VERSION, "@tailwindcss/postcss@4.1.7"]
157+
*super().get_frontend_development_dependencies(**context),
158+
Constants.VERSION,
159+
"@tailwindcss/postcss@4.1.10",
160+
]
160161

161162
def pre_compile(self, **context):
162163
"""Pre-compile the plugin.
163164
164165
Args:
165166
context: The context for the plugin.
166167
"""
167-
context["add_save_task"](compile_config, self.get_config())
168+
context["add_save_task"](compile_config, self.get_unversioned_config())
168169
context["add_save_task"](compile_root_style)
169170
context["add_modify_task"](Dirs.POSTCSS_JS, add_tailwind_to_postcss_config)
170171
context["add_modify_task"](

reflex/utils/imports.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,12 @@ def parse_imports(
5252
Returns:
5353
The parsed import dict.
5454
"""
55-
56-
def _make_list(
57-
value: ImmutableImportTypes,
58-
) -> list[str | ImportVar] | list[ImportVar]:
59-
if isinstance(value, (str, ImportVar)):
60-
return [value]
61-
return list(value)
62-
6355
return {
64-
package: [
65-
ImportVar(tag=tag) if isinstance(tag, str) else tag
66-
for tag in _make_list(maybe_tags)
67-
]
56+
package: [maybe_tags]
57+
if isinstance(maybe_tags, ImportVar)
58+
else [ImportVar(tag=maybe_tags)]
59+
if isinstance(maybe_tags, str)
60+
else [ImportVar(tag=tag) if isinstance(tag, str) else tag for tag in maybe_tags]
6861
for package, maybe_tags in imports.items()
6962
}
7063

0 commit comments

Comments
 (0)