pulse-framework 0.1.57__py3-none-any.whl → 0.1.58__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pulse/react_component.py CHANGED
@@ -35,7 +35,11 @@ def react_component(
35
35
 
36
36
  @overload
37
37
  def react_component(
38
- expr_or_name: str, src: str, *, lazy: bool = False
38
+ expr_or_name: str,
39
+ src: str,
40
+ *,
41
+ lazy: bool = False,
42
+ is_default: bool = False,
39
43
  ) -> Callable[[Callable[P, Any]], Callable[P, Element]]: ...
40
44
 
41
45
 
@@ -44,6 +48,7 @@ def react_component(
44
48
  src: str | None = None,
45
49
  *,
46
50
  lazy: bool = False,
51
+ is_default: bool = False,
47
52
  ) -> Callable[[Callable[P, Any]], Callable[P, Element]]:
48
53
  """Decorator for typed React component bindings."""
49
54
  if isinstance(expr_or_name, Expr):
@@ -51,11 +56,16 @@ def react_component(
51
56
  raise TypeError("react_component expects (expr) or (name, src)")
52
57
  if lazy:
53
58
  raise TypeError("react_component lazy only supported with (name, src)")
59
+ if is_default:
60
+ raise TypeError(
61
+ "react_component is_default only supported with (name, src)"
62
+ )
54
63
  component = ReactComponent(expr_or_name)
55
64
  elif isinstance(expr_or_name, str):
56
65
  if src is None:
57
66
  raise TypeError("react_component expects (name, src)")
58
- component = ReactComponent(Import(expr_or_name, src, lazy=lazy))
67
+ kind = "default" if is_default else None
68
+ component = ReactComponent(Import(expr_or_name, src, kind=kind, lazy=lazy))
59
69
  else:
60
70
  raise TypeError("react_component expects an Expr or (name, src)")
61
71
 
@@ -161,6 +161,7 @@ class Import(Expr):
161
161
 
162
162
  # Side-effect import: import "./styles.css"
163
163
  Import("", "./styles.css", kind="side_effect")
164
+ Import("./styles.css")
164
165
 
165
166
  # Type-only import: import type { Props } from "./types"
166
167
  Props = Import("Props", "./types", is_type=True)
@@ -194,7 +195,7 @@ class Import(Expr):
194
195
  def __init__(
195
196
  self,
196
197
  name: str,
197
- src: str,
198
+ src: str | None = None,
198
199
  *,
199
200
  kind: ImportKind | None = None,
200
201
  is_type: bool = False,
@@ -203,6 +204,14 @@ class Import(Expr):
203
204
  before: tuple[str, ...] | list[str] = (),
204
205
  _caller_depth: int = 2,
205
206
  ) -> None:
207
+ if src is None:
208
+ if kind not in (None, "side_effect"):
209
+ raise TypeError(
210
+ "Import single-argument form is reserved for side effect imports"
211
+ )
212
+ src = name
213
+ name = ""
214
+ kind = "side_effect"
206
215
  # Validate: lazy imports cannot be type-only
207
216
  if lazy and is_type:
208
217
  raise TranspileError("Import cannot be both lazy and type-only")
@@ -1,16 +1,18 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pulse-framework
3
- Version: 0.1.57
3
+ Version: 0.1.58
4
4
  Summary: Pulse - Full-stack framework for building real-time React applications in Python
5
5
  Requires-Dist: websockets>=12.0
6
- Requires-Dist: fastapi>=0.104.0
6
+ Requires-Dist: fastapi>=0.128.0
7
7
  Requires-Dist: uvicorn>=0.24.0
8
8
  Requires-Dist: mako>=1.3.10
9
9
  Requires-Dist: typer>=0.16.0
10
- Requires-Dist: python-socketio>=5.13.0
10
+ Requires-Dist: python-socketio>=5.16.0
11
11
  Requires-Dist: rich>=13.7.1
12
12
  Requires-Dist: python-multipart>=0.0.20
13
13
  Requires-Dist: python-dateutil>=2.9.0.post0
14
+ Requires-Dist: starlette>=0.50.0,<0.51.0
15
+ Requires-Dist: urllib3>=2.6.3
14
16
  Requires-Dist: watchfiles>=1.1.0
15
17
  Requires-Dist: httpx>=0.28.1
16
18
  Requires-Python: >=3.11
@@ -86,7 +86,7 @@ pulse/queries/mutation.py,sha256=fhEpOZ7CuHImH4Y02QapYdTJrwe6K52-keb0d67wmms,827
86
86
  pulse/queries/protocol.py,sha256=R8n238Ex9DbYIAVKB83a8FAPtnCiPNhWar-F01K2fTo,3345
87
87
  pulse/queries/query.py,sha256=GTZY6xvan4mC3GgLbkRnzo6lSvfRhriN2UznyjyiEWE,38682
88
88
  pulse/queries/store.py,sha256=Ct7a-h1-Cq07zEfe9vw-LM85Fm7jIJx7CLAIlsiznlU,3444
89
- pulse/react_component.py,sha256=4Zd2H9XJ2fVxVzznW5xMpcnPqx33S-c9V5KgPKjjtmo,1845
89
+ pulse/react_component.py,sha256=ub29y26fx9F1JxYrvfjkQP9wAMKAX0SbZAZkGgap724,2064
90
90
  pulse/reactive.py,sha256=FxxpH7NBtQr7G89iCVN7y1EG21f23GcRi1M-XIxcRQA,31280
91
91
  pulse/reactive_extensions.py,sha256=yQ1PpdAh4kMvll7R15T72FOg8NFdG_HGBsGc63dawYk,33754
92
92
  pulse/render_session.py,sha256=Sek343ViDdS2r8IhLUTyZvzrb10kXTr4zDMNig2TwnA,21371
@@ -104,7 +104,7 @@ pulse/transpiler/emit_context.py,sha256=GyK6VdsBSTVIewQRhBagaV0hlqLTlPZ1i8EAZGi8
104
104
  pulse/transpiler/errors.py,sha256=LSBjLBnMglbl2D94p9JR4y-3jDefk6iHSlUVBaBOTu4,2823
105
105
  pulse/transpiler/function.py,sha256=Pf5eoyzKHpn3d2EvCCYtARMnn_ixpAl7IZmY1fhmDIk,17036
106
106
  pulse/transpiler/id.py,sha256=CdgA1NndBpZjv0Hp4XiYbKn7wi-x4zWsFSjEiViKxVk,434
107
- pulse/transpiler/imports.py,sha256=2pxKZzjmMyAMgkfs_gBc01mxbAv8euyW8FTBBy5GaNw,9420
107
+ pulse/transpiler/imports.py,sha256=DKrF-Wn0VkvEoJt7YZw4eOCf2kxbI9kqc3HwYcZGoik,9667
108
108
  pulse/transpiler/js_module.py,sha256=EWX8ZZ248H6kMQs9u6zsve3SPLy4lzf9F1cNEDdY1bA,11193
109
109
  pulse/transpiler/modules/__init__.py,sha256=JGi3CuZoF4sug4dNhQg3MFhpEQqnXec4xRJM2cHNP3c,1184
110
110
  pulse/transpiler/modules/asyncio.py,sha256=kWMuFU2vZbqutCM_EXJMvy5SdlB66XiT0czs8lELj_o,1584
@@ -121,7 +121,7 @@ pulse/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
121
  pulse/types/event_handler.py,sha256=psQCydj-WEtBcFU5JU4mDwvyzkW8V2O0g_VFRU2EOHI,1618
122
122
  pulse/user_session.py,sha256=nsnsMgqq2xGJZLpbHRMHUHcLrElMP8WcA4gjGMrcoBk,10208
123
123
  pulse/version.py,sha256=711vaM1jVIQPgkisGgKZqwmw019qZIsc_QTae75K2pg,1895
124
- pulse_framework-0.1.57.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
125
- pulse_framework-0.1.57.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
126
- pulse_framework-0.1.57.dist-info/METADATA,sha256=tKr4UwsRMj5mTqjqiNfnORRjrVG5A8TIAiMpw8YWzXI,8229
127
- pulse_framework-0.1.57.dist-info/RECORD,,
124
+ pulse_framework-0.1.58.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
125
+ pulse_framework-0.1.58.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
126
+ pulse_framework-0.1.58.dist-info/METADATA,sha256=qDQAGM7VEqb_nqq4VVUDPwMBXxAWjlMPeaPSZtScBDs,8300
127
+ pulse_framework-0.1.58.dist-info/RECORD,,