django-wireview 0.2.1__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.
Files changed (50) hide show
  1. django_wireview-0.2.1/.gitignore +40 -0
  2. django_wireview-0.2.1/CHANGELOG.md +125 -0
  3. django_wireview-0.2.1/PKG-INFO +1199 -0
  4. django_wireview-0.2.1/README.md +1146 -0
  5. django_wireview-0.2.1/pyproject.toml +134 -0
  6. django_wireview-0.2.1/wireview/__init__.py +117 -0
  7. django_wireview-0.2.1/wireview/apps.py +34 -0
  8. django_wireview-0.2.1/wireview/async_result.py +149 -0
  9. django_wireview-0.2.1/wireview/auto_broadcast.py +172 -0
  10. django_wireview-0.2.1/wireview/component.py +11 -0
  11. django_wireview-0.2.1/wireview/consumer.py +601 -0
  12. django_wireview-0.2.1/wireview/core/__init__.py +6 -0
  13. django_wireview-0.2.1/wireview/core/component.py +1378 -0
  14. django_wireview-0.2.1/wireview/core/meta.py +615 -0
  15. django_wireview-0.2.1/wireview/core/rendered.py +365 -0
  16. django_wireview-0.2.1/wireview/core/state.py +54 -0
  17. django_wireview-0.2.1/wireview/core/transport.py +132 -0
  18. django_wireview-0.2.1/wireview/debug/__init__.py +96 -0
  19. django_wireview-0.2.1/wireview/debug/sync_detector.py +284 -0
  20. django_wireview-0.2.1/wireview/event_transpiler.py +230 -0
  21. django_wireview-0.2.1/wireview/features/__init__.py +8 -0
  22. django_wireview-0.2.1/wireview/features/presence.py +471 -0
  23. django_wireview-0.2.1/wireview/features/streams.py +49 -0
  24. django_wireview-0.2.1/wireview/features/uploads.py +558 -0
  25. django_wireview-0.2.1/wireview/function_component.py +345 -0
  26. django_wireview-0.2.1/wireview/js.py +489 -0
  27. django_wireview-0.2.1/wireview/live_component.py +245 -0
  28. django_wireview-0.2.1/wireview/log.py +12 -0
  29. django_wireview-0.2.1/wireview/management/__init__.py +0 -0
  30. django_wireview-0.2.1/wireview/management/commands/__init__.py +0 -0
  31. django_wireview-0.2.1/wireview/management/commands/wireview_lsp.py +376 -0
  32. django_wireview-0.2.1/wireview/management/commands/wireview_stubs.py +830 -0
  33. django_wireview-0.2.1/wireview/repository.py +309 -0
  34. django_wireview-0.2.1/wireview/schemas.py +49 -0
  35. django_wireview-0.2.1/wireview/serializer.py +27 -0
  36. django_wireview-0.2.1/wireview/settings.py +46 -0
  37. django_wireview-0.2.1/wireview/slots.py +319 -0
  38. django_wireview-0.2.1/wireview/static/wireview/rendered.mjs +147 -0
  39. django_wireview-0.2.1/wireview/static/wireview/types.d.ts +52 -0
  40. django_wireview-0.2.1/wireview/static/wireview/wireview-boost.js +249 -0
  41. django_wireview-0.2.1/wireview/static/wireview/wireview.js +3124 -0
  42. django_wireview-0.2.1/wireview/static/wireview/wireview.min.js +26 -0
  43. django_wireview-0.2.1/wireview/template_engine.py +332 -0
  44. django_wireview-0.2.1/wireview/templates/wireview_header.html +9 -0
  45. django_wireview-0.2.1/wireview/templatetags/__init__.py +0 -0
  46. django_wireview-0.2.1/wireview/templatetags/wireview.py +831 -0
  47. django_wireview-0.2.1/wireview/testing.py +358 -0
  48. django_wireview-0.2.1/wireview/urls.py +19 -0
  49. django_wireview-0.2.1/wireview/utils.py +198 -0
  50. django_wireview-0.2.1/wireview/views.py +238 -0
@@ -0,0 +1,40 @@
1
+ .DS_Store
2
+ *.egg-info/
3
+ *.eggs/
4
+ *.log
5
+ *.map
6
+ *.min.js
7
+ *.sqlite3
8
+ .envrc
9
+ dist/
10
+ __pycache__/
11
+ .pytest_cache/
12
+ htmlcov/
13
+ node_modules/*
14
+ .coverage
15
+ site/
16
+ .vscode/
17
+ pyrightconfig.json
18
+ *.sublime-*
19
+
20
+ # Collected static files
21
+ tests/static/
22
+ .idea/
23
+
24
+ # IDE LSP metadata cache
25
+ .wireview/
26
+
27
+ # Auto-generated type stubs
28
+ *.pyi
29
+
30
+ # Claude Code personal overrides
31
+ .claude/settings.local.json
32
+
33
+ # Benchmarks (results are versioned; the sqlite scratch DB is not)
34
+ bench/.data/
35
+
36
+ # Redis snapshot, if a redis-server ever writes one into the working directory
37
+ dump.rdb
38
+
39
+ # Claude Code worktrees
40
+ .claude/worktrees/
@@ -0,0 +1,125 @@
1
+ # Changelog
2
+
3
+ All notable changes to django-wireview are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Git tags `v*` are the
5
+ version source of truth; `pyproject.toml` is bumped in the release commit.
6
+ Feature-level history is tracked by GAP number in `docs/FEATURE-GAP.md`.
7
+
8
+ The django-reactor era changelog (2.x) is preserved in
9
+ [docs/legacy/CHANGELOG-reactor.md](./docs/legacy/CHANGELOG-reactor.md).
10
+
11
+ ## [Unreleased]
12
+
13
+ ## [0.2.1] - 2026-09-08
14
+
15
+ ### Added
16
+
17
+ - Published on PyPI: `pip install django-wireview` works. The release workflow now builds through
18
+ `make ci-build` (which fails if the wheel is missing `wireview.min.js`), checks that the tag
19
+ matches `pyproject.toml`, and publishes the sdist and wheel with PyPI trusted publishing (OIDC,
20
+ environment `pypi`). No API token is stored anywhere. Releases up to v0.2.0 were GitHub-only
21
+
22
+ ## [0.2.0] - 2026-09-08
23
+
24
+ The release that makes the SQLite-plus-Windows deployment premise real: a channel
25
+ layer that needs no Redis, partial HTML diffs that actually fire, a transport seam,
26
+ and reproducible benchmarks on macOS, Linux and Windows to back the claims.
27
+
28
+ ### Added
29
+
30
+ - `make bench ARGS="--layer redis"` benchmarks channels_redis next to channels-nats, so the channel-layer
31
+ choice can be made on measurements (`docs/design/transport-abstraction.md` §5-3). The benchmark starts
32
+ the broker itself on a free port; `REDIS_URL` / `NATS_URL` point it at an existing one instead
33
+ - Windows benchmark lane and results: `make bench ARGS="--server uvicorn"` (also `uvicorn-wsproto`) picks the
34
+ ASGI server, `bench/windows/` runs the same benchmark inside a Parallels Windows guest, and
35
+ `bench/results/win11-parlab-*.json` hold the numbers next to the macOS control group `a993181-*.json`.
36
+ daphne dies at about 500 connections per process on Windows (`select()` limit); a single-process uvicorn
37
+ does not. `docs/DEPLOYMENT.md` gained the Windows single-server recipe (uvicorn × N behind Caddy,
38
+ channels-nats, SQLite WAL) and `docs/design/transport-abstraction.md` §5-2 the measurements
39
+ - NATS channel layer support in the test project and the benchmark: `tests/testproj/settings_nats.py`,
40
+ `tests/test_nats_layer.py` (cross-process broadcast reaches a consumer through channels-nats),
41
+ `make bench ARGS="--layer nats --processes N"` with a broadcast fan-out measurement
42
+ - `bench/`: reproducible benchmarks (`make bench`) for render payload sizes, per-event cost,
43
+ memory and WebSocket connection density, plus `make bench-compare BASE=<ref>` to benchmark a
44
+ past commit in a throwaway worktree and print a side-by-side table
45
+ - Comprehensions and blocks: `{% for %}` output is one dynamic slot holding the item template's
46
+ statics once and per-item dynamics, and `{% if %}` output is a nested block with its own
47
+ statics. Adding, removing or changing items and switching branches now produce partial diffs
48
+ instead of full renders (GAP-025). Client side lives in `wireview/static/wireview/rendered.mjs`
49
+ and is unit-tested with `npm test`
50
+ - `wireview.core.transport`: `Outbound` and `Broker` interfaces with Channels implementations.
51
+ Every channel-layer call now goes through them, so another connection layer only has to
52
+ implement the two interfaces (GAP-026)
53
+ - `Rendered.to_dict()` / `from_dict()` so render snapshots can live outside the process
54
+ - `docs/implementation/wire-protocol.md` (message shapes in all four directions) and
55
+ `docs/design/transport-abstraction.md` (measurements, options, remaining steps)
56
+ - `on_mount` hooks and `attach_hook()` / `detach_hook()` for lifecycle interception (GAP-021)
57
+ - `.claude/settings.json` with a permission allowlist and a PostToolUse hook that runs `ruff format` on edited Python files
58
+
59
+ ### Changed
60
+
61
+ - NATS is now the layer this project targets. `make test-e2e` runs the browser suite on
62
+ channels-nats and `tests/e2e.sh` starts a throwaway nats-server for it, so no broker has to be
63
+ running first;
64
+ `WIREVIEW_TEST_LAYER` (memory by default, nats or redis) picks the layer for the
65
+ test project, and README and `docs/DEPLOYMENT.md` recommend it first. CI runs the E2E suite on
66
+ NATS too, and channels-nats is a dev dependency now that it is on PyPI. channels_redis stays
67
+ fully supported
68
+ - The event transpiler cache is a small pure-Python LRU instead of `lru-dict`, so wireview installs
69
+ without a C compiler on platforms that have no `lru-dict` wheel (Windows ARM64). The dependency is gone
70
+ - `WireviewMeta` accepts a `broker=` argument; `channel_layer=` still works and builds a
71
+ `ChannelsBroker`. Tests that patched `get_channel_layer` should patch
72
+ `wireview.core.transport.get_channel_layer` instead
73
+ - `data-state` now carries a compact, zlib-compressed `Signer.sign_object` payload
74
+ (`wireview.core.state`). The legacy `Signer().sign(json)` format is still accepted on join
75
+ - Rewrote `CLAUDE.md` as a compact agent guide (repository map, commands, conventions, gotchas) that links to `docs/` instead of duplicating API docs
76
+ - `make lint` now runs `ruff format --check` and djlint, and CI's lint job reuses it
77
+ - Release workflow attaches only the wheel (sdist removed)
78
+ - Package version unified to the latest tag (`pyproject.toml`, `package.json`)
79
+ - README and tutorials state the actual Python requirement (>=3.12)
80
+
81
+ ### Fixed
82
+
83
+ - The published wheel and sdist now contain `wireview.min.js`. hatchling honours `.gitignore`,
84
+ which ignores `*.min.js` as a build artifact, so every release up to v0.1.1 shipped a package
85
+ whose `{% wireview_header %}` pointed at a file that was not there and no JavaScript loaded.
86
+ `make ci-build` now fails if the wheel is missing it
87
+ - HTTP renders no longer leak diff markers into attributes (`value="<!--$0-->…"`); markers are
88
+ stripped for non-live renders
89
+ - Variables inside `{% if %}` branches were never marked, so any change inside a conditional
90
+ was a full render; branches are now wrapped like the rest of the template
91
+ - Empty variable output is now marked too, so a value toggling between "" and text no longer
92
+ shifts every following index into a full render
93
+ - Partial HTML diffs never fired for live components: `{% tag_header %}` embedded the freshly
94
+ signed `data-state` in the static parts, so the fingerprint changed on every render and every
95
+ event shipped a full render. The signed state is now a dynamic part (GAP-024)
96
+ - `Component._lifecycle_hooks` type annotation so `pyright` passes
97
+ - djlint formatting of the livecomp and slots test templates
98
+ - Duplicate test component class names (`ChildComponent`, `SimpleComponent`) that triggered registration warnings on every test run
99
+
100
+ ### Removed
101
+
102
+ - Stale `MANIFEST.in` (referenced `reactor/` paths; hatchling is the build backend) and placeholder `docs/index.md`
103
+
104
+ ## [0.1.1] - 2025-12-09
105
+
106
+ ### Added
107
+
108
+ - Wheel build in the release workflow
109
+
110
+ ## [0.1.0] - 2025-12-09
111
+
112
+ First tagged release of django-wireview, the Pydantic v2 / Django Channels
113
+ successor to django-reactor. Highlights over reactor: Streams, Presence, chunked
114
+ and external file uploads, AsyncResult and `assign_async`, `JS()` client
115
+ commands, JavaScript Hooks, Slots, Function Components, LiveComponent,
116
+ `temporary_assigns`, `params_changed`, flash messages, `push_title`, form
117
+ auto-recovery, viewport bindings, optimistic UI attributes, type stub
118
+ generation, and `mount()` testing utilities. See `docs/FEATURE-GAP.md` for the
119
+ Phoenix LiveView parity table.
120
+
121
+ [Unreleased]: https://github.com/itda-work/django-wireview/compare/v0.2.1...HEAD
122
+ [0.2.1]: https://github.com/itda-work/django-wireview/compare/v0.2.0...v0.2.1
123
+ [0.2.0]: https://github.com/itda-work/django-wireview/compare/v0.1.1...v0.2.0
124
+ [0.1.1]: https://github.com/itda-work/django-wireview/compare/v0.1.0...v0.1.1
125
+ [0.1.0]: https://github.com/itda-work/django-wireview/releases/tag/v0.1.0