You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[ ] Verify production asset caching and HTML cache-busting after an example-only edit.
143
-
-[ ]Remove old hand-authored example catalog only after one successful production deployment.
144
-
-[ ] Remove temporary golden parity scaffolding after cleanup is complete.
143
+
-[ ]Keep the frozen golden fixture through at least one stable production release cycle and rollback window.
144
+
-[ ] Remove temporary golden parity scaffolding only in a dedicated cleanup PR after CI and production confidence are established.
145
145
-[ ] Update README contributor instructions to point contributors at Markdown examples, `make build`, and `make verify-examples`.
146
146
147
147
## Implementation milestones
@@ -151,7 +151,7 @@ This migration must not be implemented as one large switch-over.
151
151
1.**Tooling-only milestone** — add Markdown sources, canonical loader, build scripts, verifier, formatter, and golden parity checks while the live app still imports `src/examples.py`.
152
152
2.**Dual-read milestone** — allow tests to load both `src/examples.py` and Markdown examples; keep `src/examples.py` as the public catalog until parity is clean.
153
153
3.**App switch milestone** — switch `src/examples.py` to a thin compatibility layer over the Markdown loader only after local Worker startup, browser layout checks, and 100% golden parity pass.
154
-
4.**Cleanup milestone** — remove the old hand-authored catalog and golden fixture only after one successful deploy and smoke test on both `www.pythonbyexample.dev`and the `workers.dev` hostname.
154
+
4.**Cleanup milestone** — remove the old hand-authored catalog immediately after the app switch, but keep the golden fixture until a stable production release cycle, rollback window, and dedicated cleanup PR.
155
155
156
156
Each milestone should be independently reviewable and revertible.
Copy file name to clipboardExpand all lines: docs/lessons-learned.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,9 @@ This document records project lessons that should guide future changes to Python
34
34
- Avoid decorative labels that do not teach. Labels such as `Cell 1 · <<fragment-1>>` add noise unless the fragment name is meaningful to the learner.
35
35
- If a source fragment only prepares state and has no output, merge it with the next fragment that produces output. Every displayed cell should have evidence.
36
36
- Keep the complete editable program visible because it is the thing that actually runs.
37
+
- When storing examples as Markdown, keep the full editable program in `:::program` and teaching fragments in separate `:::cell` blocks. Do not concatenate cells to recreate the editor source.
38
+
- Fine-grained cells can restate definitions to stay executable. This is better than collapsing class, property, recursion, match, or type-hint examples into one large cell.
39
+
- Preserve a frozen golden catalog while migrating source formats. Full stdout parity is not enough; rendered teaching-cell structure must also match.
37
40
38
41
## Layout and mobile
39
42
@@ -47,16 +50,18 @@ This document records project lessons that should guide future changes to Python
47
50
- Unit tests are good for catalog integrity, rendering contracts, Dynamic Worker code generation, and cache-policy source checks.
48
51
- Browser tests are necessary for Shiki/CodeMirror layout behavior and visual regressions.
49
52
- SEO and cache-busting deserve a dedicated linter because errors are easy to reintroduce when adding pages or assets.
50
-
- Always run the full pre-push set before publishing:
53
+
- Always run the full pre-push set before publishing. Start `pywrangler dev --port 9696`, then run:
51
54
52
55
```bash
53
-
make fingerprint
54
-
make test
55
-
make seo-cache-lint
56
-
make browser-layout-test
57
-
make lint
56
+
make verify
57
+
scripts/check_example_migration_parity.py
58
+
scripts/format_examples.py --check
59
+
make verify-python-version VERSION=3.13
60
+
git diff --check
58
61
```
59
62
63
+
-`make check-generated` should fail if embedded example data, asset manifests, or cache headers are stale.
64
+
60
65
## Documentation and GitHub readiness
61
66
62
67
- Keep generated runtime directories out of Git: `.wrangler/`, `.venv/`, `.venv-workers/`, and `python_modules/`.
0 commit comments