mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-03 04:31:58 +00:00
## Summary Audits and updates litegraph documentation files that came from the old litegraph.js repo merged via git subtree (per #8341 discussion). ## Changes - **Delete** `CONTRIBUTING.md` - completely outdated, referenced original jagenjo/litegraph.js from 2020 - **Fix** `API.md` - remove Subgraph from "Removed public interfaces" (actively used in 25+ files) - **Update** `README.md` - replace standalone releasing instructions with note about embedded subtree workflow - **Fix** `AGENTS.md` and `__fixtures__/README.md` - correct import path typos (`./fixtures/` → `./__fixtures__/`) Fixes #8347 cc @DrJKL <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Documentation * Updated release information to clarify that the library is embedded via git subtree and managed through the parent repository's release process * Removed contribution guidelines documentation file * Updated API documentation by removing Subgraph from the list of removed public interfaces * Updated documentation examples to align with current project structure <!-- end of auto-generated comment: release notes by coderabbit.ai --> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8588-docs-audit-and-update-litegraph-documentation-2fc6d73d365081fca335c78ce8493d3e) by [Unito](https://www.unito.io)
1.3 KiB
1.3 KiB
Litegraph Guidelines
Code Philosophy
- Write concise, legible, and easily maintainable code
- Avoid repetition where possible, but not at expense of legibility
- Prefer running single tests, not the whole suite, for performance
Code Style
- Prefer single line
ifsyntax for concise expressions - Take advantage of
TypedArraysubarraywhen appropriate - The
sizeandposproperties ofRectangleshare the same array buffer - Prefer returning
undefinedovernull - Type assertions are a last resort (acceptable for legacy code interop)
Circular Dependencies in Tests
CRITICAL: Always import from the barrel export for subgraph code:
// ✅ Correct - barrel import
import { LGraph, Subgraph, SubgraphNode } from '@/lib/litegraph/src/litegraph'
// ❌ Wrong - causes circular dependency
import { LGraph } from '@/lib/litegraph/src/LGraph'
Root cause: LGraph ↔ Subgraph circular dependency (Subgraph extends LGraph, LGraph creates Subgraph instances).
Test Helpers
import {
createTestSubgraph,
createTestSubgraphNode
} from './__fixtures__/subgraphHelpers'
function createTestSetup() {
const subgraph = createTestSubgraph()
const subgraphNode = createTestSubgraphNode(subgraph)
return { subgraph, subgraphNode }
}