diff --git a/plan.md b/plan.md index 4090e7b..a89025d 100644 --- a/plan.md +++ b/plan.md @@ -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 ```