Plan: require class encapsulation for stateful components

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 00:02:01 +00:00
parent 7c2c9d9382
commit f1d38931e2

View File

@@ -116,6 +116,15 @@ collisions with host app styles. The host can override via CSS custom properties
```
## Code Structure
All stateful components must be classes, not bare module-level variables. The
current `app.mjs` has scanner state (`running`, `last_decoded_text`, `fps`,
etc.) scattered as module globals — this needs to be encapsulated in
`Barcode_Scanner` before the library refactor proceeds. Module scope is only
for constants and exports.
## Lifecycle
```