pulse-framework 0.1.38a7__tar.gz → 0.1.38a8__tar.gz
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_framework-0.1.38a7 → pulse_framework-0.1.38a8}/PKG-INFO +1 -1
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/pyproject.toml +1 -1
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/cmd.py +9 -1
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/state.py +21 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/README.md +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/__init__.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/app.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/channel.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/__init__.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/dependencies.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/folder_lock.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/helpers.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/models.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/packages.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/processes.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/secrets.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cli/uvicorn_log_config.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/__init__.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/codegen.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/imports.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/js.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/templates/__init__.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/templates/layout.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/templates/route.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/templates/routes_ts.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/utils.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/components/__init__.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/components/for_.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/components/if_.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/components/react_router.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/context.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/cookies.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/css.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/decorators.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/env.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/form.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/helpers.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/hooks/__init__.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/hooks/core.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/hooks/effects.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/hooks/runtime.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/hooks/setup.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/hooks/stable.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/hooks/states.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/html/__init__.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/html/elements.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/html/events.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/html/props.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/html/svg.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/html/tags.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/html/tags.pyi +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/messages.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/middleware.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/plugin.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/proxy.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/py.typed +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/query.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/react_component.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/reactive.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/reactive_extensions.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/render_session.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/renderer.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/request.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/routing.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/serializer.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/types/__init__.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/types/event_handler.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/user_session.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/vdom.py +0 -0
- {pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/version.py +0 -0
|
@@ -249,7 +249,15 @@ def generate(
|
|
|
249
249
|
app = app_ctx.app
|
|
250
250
|
console.log(f"📋 Found {len(app.routes.flat_tree)} routes")
|
|
251
251
|
|
|
252
|
-
|
|
252
|
+
# In CI or prod mode, server_address must be provided
|
|
253
|
+
if (ci or prod) and not app.server_address:
|
|
254
|
+
typer.echo(
|
|
255
|
+
"❌ server_address must be provided when generating in CI or production mode. "
|
|
256
|
+
+ "Set it in your App constructor or via the PULSE_SERVER_ADDRESS environment variable."
|
|
257
|
+
)
|
|
258
|
+
raise typer.Exit(1)
|
|
259
|
+
|
|
260
|
+
addr = app.server_address or "http://localhost:8000"
|
|
253
261
|
app.run_codegen(addr)
|
|
254
262
|
|
|
255
263
|
if len(app.routes.flat_tree) > 0:
|
|
@@ -206,6 +206,15 @@ class State(ABC, metaclass=StateMeta):
|
|
|
206
206
|
```
|
|
207
207
|
|
|
208
208
|
Properties will automatically trigger re-renders when changed.
|
|
209
|
+
|
|
210
|
+
Override `on_dispose()` to run cleanup code when the state is disposed:
|
|
211
|
+
```python
|
|
212
|
+
class MyState(ps.State):
|
|
213
|
+
def on_dispose(self):
|
|
214
|
+
# Clean up timers, connections, etc.
|
|
215
|
+
self.timer.cancel()
|
|
216
|
+
self.connection.close()
|
|
217
|
+
```
|
|
209
218
|
"""
|
|
210
219
|
|
|
211
220
|
@override
|
|
@@ -310,7 +319,19 @@ class State(ABC, metaclass=StateMeta):
|
|
|
310
319
|
# if isinstance(value,QueryProperty):
|
|
311
320
|
# value.
|
|
312
321
|
|
|
322
|
+
def on_dispose(self) -> None:
|
|
323
|
+
"""
|
|
324
|
+
Override this method to run cleanup code when the state is disposed.
|
|
325
|
+
|
|
326
|
+
This is called automatically when `dispose()` is called, before effects are disposed.
|
|
327
|
+
Use this to clean up timers, connections, or other resources.
|
|
328
|
+
"""
|
|
329
|
+
pass
|
|
330
|
+
|
|
313
331
|
def dispose(self):
|
|
332
|
+
# Call user-defined cleanup hook first
|
|
333
|
+
self.on_dispose()
|
|
334
|
+
|
|
314
335
|
disposed = set()
|
|
315
336
|
for value in self.__dict__.values():
|
|
316
337
|
if isinstance(value, Effect):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/templates/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pulse_framework-0.1.38a7 → pulse_framework-0.1.38a8}/src/pulse/codegen/templates/routes_ts.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|