Replace the prior release tree with the current plugin, frontend, tests, and documentation. Document retired node IDs and the public Gitea update source.
1.1 KiB
1.1 KiB
Frontend extension rules
These instructions apply to web/.
- ComfyUI auto-loads every JavaScript file below this directory through
WEB_DIRECTORY = "./web". A new file is a runtime feature, not passive documentation. - Keep extensions idempotent: avoid duplicate buttons, listeners, styles, timers, and monkey patches after frontend reloads.
- Reuse ComfyUI's
appandapimodules through the existing relative import convention. - Keep DOM IDs and extension names globally unique with the
o1keyprefix. - Treat values received from workflows, API responses, filenames, and prompts as untrusted. Prefer
textContent; sanitize before usinginnerHTML. - Preserve old workflows through narrowly targeted rules in
js/migrateWorkflow.js. A migration must be safe to run repeatedly. - Do not introduce a bundler or external CDN dependency without an explicit architecture decision.
- When changing
js/o1keyImageGenerator.js, runnode ../tests/test_o1key_image_generator_frontend.mjs. - Document new panels, server routes, or workflow migrations in
../docs/architecture.mdand../docs/development.md.