Commit Graph

1348 Commits

Author SHA1 Message Date
filtered
ecb69a4f1d Update README to reflect repo status (#662)
Rewrites or restructures most of the former README, so that it is
relevant to this fork instead of the original.

- Maintains original contributors, and places original
projects/description under an expanders
- Removes all references to the editor
- Removes information about the removed built-in nodes
- Updates code samples
- Reformats various sections
2025-03-02 03:35:16 +11:00
filtered
7b4bea8e62 Remove deprecated code - webGL (#660)
Removes long-deprecated WebGL code.
2025-03-01 16:33:17 +00:00
filtered
31d3168201 0.8.100 (#661)
Automated version bump to 0.8.100
2025-03-02 03:24:41 +11:00
filtered
ec34498264 Fix compiler warning - incorrect schema order (#658)
Resolves warning about `types` export being loaded last.
2025-03-01 15:18:42 +00:00
Chenlei Hu
1e7897930c [CI] Update frontend install method (#659)
Sync https://github.com/Comfy-Org/ComfyUI_frontend/pull/2783
2025-03-01 10:18:14 -05:00
filtered
177a5a0d54 [CodeHealth] Remove wheel listener & event wrapper (#656)
- Replaces the long-deprecated `mousewheel` and `DOMMouseScroll` event
listeners with `wheel` listener
  - Verified no change in Chromium behaviour (desktop, mouse)
- Removes redundant pointer listener wrapper
- Fixes types
2025-03-01 13:18:15 +00:00
Miguel C
5721b1c27c [Refactor] Fix step calculation in Knob Widget (#651)
Removes a stray console.log and fixes the step calculation.
2025-03-01 23:36:55 +11:00
filtered
c473130499 [TS] Use strict mode in LGraphCanvas (#654)
- Prefer creating HTML elements in JS and `append()` over innerHTML &
`querySelector()`
- Removes redundant code
- Adds/fixes TS types
2025-03-01 11:52:42 +00:00
filtered
bad923a7f0 [Refactor] Remove deprecated mousewheel events (#652)
Prefer "wheel" event (added around Chrome v31).
2025-03-01 11:34:23 +00:00
filtered
5f95dd1853 [CI] Update frontend test to new vitest scripts (#653)
- Ref: https://github.com/Comfy-Org/ComfyUI_frontend/pull/2779/
2025-03-01 11:17:16 +00:00
filtered
b36bf3d4a2 [CodeHealth] Apply modern standards to LGraphCanvas (#650)
- Prefer template string
- Prefer explicit throw to undefined TypeError
- Remove unnecessary `this` assignment
2025-02-28 22:08:23 +00:00
filtered
c4faaf4210 [TS] Fix ContextMenu types (#649)
- No runtime changes
- Drastically improves ContextMenu type accuracy / safety
- Allows TS strict conversion
2025-02-28 14:52:07 +00:00
filtered
b877312336 [Refactor] Fix TS types, remove redundant code (#648)
Minor clean up and graph null deref checks.

Minor runtime change: due to optional chaining, it is possible a
downstream consumer is catching this extremely rare behaviour on purpose
and handling it.
2025-02-28 11:13:23 +00:00
filtered
4365873039 [Refactor] Prefer NullGraphError & standardisation (#647)
- Best effort code search for convert explicit `null` to `undefined`
- Prefer explicit throw over `TypeError`
- Prefer template strings
2025-02-28 20:16:34 +11:00
filtered
b4688e18f9 [Refactor] Prefer includes over indexOf -1 (#646)
Enables ESLint auto-fix rule.
2025-02-28 08:53:29 +00:00
filtered
7b19abf83a [TS] Use strict mode in Canvas: initializers (#645)
- Code search verified no consumers expecting explicit null on callbacks
(best effort)
- Removes redundant code
2025-02-28 08:48:53 +00:00
Chenlei Hu
955d20d8ea 0.8.99 (#644)
Automated version bump to 0.8.99
2025-02-27 16:27:06 -05:00
Chenlei Hu
c66ca2ae66 Remove magic 10% scale on numeric widget step (#643)
There are external code still dependent on the fact that
Widget.options.step is scaled 10x, so the 10x-ed value is still kept
there, while we use the new unscaled step2 within our code now.

Ref:
https://cs.comfy.org/search?q=context:global+%22step+/+10%22&patternType=keyword&sm=0
2025-02-27 16:23:53 -05:00
filtered
0a09ecc7ac [TS] Use strict mode in LGraphNode (#642)
- Adds minor type coercions to resolve type errors
- Deprecates unused public APIs
- 7a0336e3ad7239b7bb588bbbe7912322257e9ae2 works around a bug in the tsc
strict plugin
- Adds ts-ignore that must be removed later
  * [ ] #578
2025-02-27 19:03:42 +00:00
filtered
fab386275c [Refactor] Clean up LGraphNode ahead of TS strict (#641)
Preparation for TS strict conversion. Simplifies code & improves
readability.
2025-02-27 17:55:11 +00:00
filtered
38dd7b7089 [Refactor] Prefer for..of to incremental for loops (#640)
- Converts incremental for loops to for..of loops
- Improves readability
2025-02-27 16:28:10 +00:00
filtered
be8dc6867e [Refactor] Prefer event listeners to callback props (#637)
N.B.: `onerror` replacement is not a `window` or `Element` instance.
2025-02-27 14:50:39 +00:00
filtered
97bf9de83a [Refactor] Standardise code style - modern JS (#636)
Uses unicorn rules to auto-refactor code.  All verified.
2025-02-27 13:13:32 +00:00
filtered
6737828a2b Lint module entry point (#635)
- Adds module entry point tests
- Manually resolved lint rules for module entry point imports / exports
(autofix could not resolve without causing issues)
2025-02-27 12:02:03 +00:00
filtered
984bd8696c [Dev] Reverse unicorn lint config - on by default (#633)
Sets unicorn linter recommended rules on by default, with individual
rules disabled.

- Issue to track removal of these rules: #629
2025-02-27 10:50:10 +00:00
filtered
2d9c811aa9 [Cleanup] Remove downstream type (#632)
Removes group node type. Now exists downstream where it is used.
2025-02-27 10:38:24 +00:00
filtered
0d8e0fce17 [Refactor] Fix assignment of this to const (#631)
Refactors using arrows funcs or storing the once-off requirement as an
action, removing the need to dereference this inside the function.
2025-02-27 10:32:53 +00:00
filtered
2104f2a8a9 [Refactor] Prefer textContent over innerText (#630)
Only setters are used, so getter differences aren't involved. This may
result in a runtime change to consumers passing a Node that isn't
actually a HTMLElement.
2025-02-27 10:11:07 +00:00
filtered
1e8938ceff Add unicorn lint rules - DOM built-in functions (#628)
- Prefer append(), remove(), replaceAll()
- Wrap nested ternaries in parenthesis
2025-02-27 09:18:25 +00:00
filtered
6f51767451 Add ESLint unicorn plugin (#627)
Rules disabled by default to allow incremental integration.
2025-02-27 08:41:51 +00:00
Chenlei Hu
9c8cc571e2 0.8.98 (#626)
Automated version bump to 0.8.98
2025-02-26 19:58:05 -05:00
Chenlei Hu
e8c238b70e Update serialisation.ts (#624)
Update ISerialisedNodeInputSlot.widget type. Overwrite original widget
prop type.
2025-02-26 16:40:36 -05:00
Miguel C
fbcc396880 Knob (#600)
Resolved issues with history due to merges, opened a new pull request.
A more visual widget that the usual number/slider. Differentiates itself
from the functionality of a slider by not setting the value on click,
only stepping, emulating an actual knob.

- Left/Right takes 1 step at a time
- Up/Down moves 1% or 1 step, whichever is larger
- Move + Shift moves by 10% or 1 step, whichever is larger

This also includes a fixes to some size logic.
- [x] ~~Still missing being able to drag the knob itself, as the
clicking of the widget is not recognized if it's outside of where a
normal height widget would be.~~

![knob-node](https://github.com/user-attachments/assets/9d0ce70d-a220-49d0-987f-8dcef2b1d299)
2025-02-26 15:07:32 -05:00
Chenlei Hu
963e4b0904 [Type] Mark name as required prop for IBaseWidget (#623) 2025-02-26 15:03:31 -05:00
Chenlei Hu
d20aab757c Serialize NodeInputSlot.widget (#622)
Serialize linked widget on node input slot properly according to current
save format in
76818b54e6/src/extensions/core/widgetInputs.ts
2025-02-26 14:15:31 -05:00
filtered
c166a34fd8 Add ESLint rules to enforce existing lib style (#621)
Adds a few rules that enforce consistency across the repo.

Only change is one top-level const arrow function is now a function
definition.
2025-02-26 18:12:26 +00:00
Miguel C
7e6b64f216 Fix widget sizing logic in LGraphCanvas and LGraphNode (#609)
This fixes an issue with widget heights not coinciding with actual
computed heights.
<img
src="https://github.com/user-attachments/assets/50b4b86c-8de8-4844-9a17-6f18d32e7f5e"
height="128" alt="old">old
<img
src="https://github.com/user-attachments/assets/c34e432a-6941-469e-99cd-df15c0a527de"
height="256" alt="new">new
2025-02-26 10:56:30 -05:00
Chenlei Hu
939e9c0a2f Update devtools ref (#620)
Sync https://github.com/Comfy-Org/ComfyUI_frontend/pull/2733
2025-02-26 10:56:19 -05:00
filtered
0e9b8b03b7 Enforce curly braces in multi-line if statements (#619)
Removes formatters' ability to print code that goes to a new line, but
uses no braces to delineate.

It becomes more difficult to follow when using JS-style indents (two
spaces).

No effort required - braces added by auto-fixer.
2025-02-26 15:08:23 +00:00
filtered
a43109d58a [TS] Use strict mode in ContextMenu (#618)
- Adds minor type coercions to resolve type errors
- Uses the same type-coercion behaviour of the target DOM object
properties
- Resolves a long-standing type issue in context menu interfaces
(converts to generic - `unknown` by default)
- Fixes several incorrect types
- Adds ts-ignore that must be removed later
2025-02-26 14:29:45 +00:00
filtered
3040924d76 [TS] Use strict mode in CanvasPointer, measure, and polyfills (#617)
- Adds runtime type guard
- Adds ts-ignore that must be removed later
  * [ ] #578
2025-02-26 13:05:40 +00:00
filtered
0b59c00597 [API] Remove deprecated: DragAndScale mouse (#615)
Removed unused public methods (unmaintained, non-functional):
- bindEvents
- onMouse

`onredraw` is in use by extension authors.

This file now passes TS strict checks.
2025-02-26 11:59:12 +00:00
filtered
6224d2dc06 [Cleanup] Update ESLint rules with stricter auto-fixes (#614)
Stylistic plugin falls short in a few areas when it comes to consistent
lists and chaining. Replaced some key rules with antfu's personal
variants.

`eslint` can now be run repo-wide without params.
2025-02-26 11:12:03 +00:00
filtered
867b9ed316 [nit] Add consistent method chaining linter (#613)
Enforces that chained accessed should **either** all be on one line, or
all on individual lines (same as imports).
2025-02-26 10:11:11 +00:00
filtered
5cdd0581fa Add import / export sort rules (#612)
- Adds ESLint package
- Applies import/export rules to all files
- Uses newline delineated grouping, with type-only imports first
2025-02-26 09:21:33 +00:00
filtered
9ded97d189 [Doc] Add JSDoc linter & general comment clean up (#611)
- Prefer comments above lines over end-of-line comments
  - Makes auto-formatting easier
  - Subjective, but it is generally easier to read in JS
- Standardises JSdoc format
- Auto-fixes for many issues (applies on save w/ESLint extension)
2025-02-26 08:54:18 +00:00
filtered
d849fcd00c [Dev] Make it easier to toggle strict mode (#610)
nit: Allows uncomment instead of typing true every time.
2025-02-26 06:16:56 +00:00
Chenlei Hu
7fab99b362 0.8.97 (#608)
Automated version bump to 0.8.97
2025-02-25 21:26:49 -05:00
Chenlei Hu
953ae434ea Type serialized NodeSlot (#605) 2025-02-25 19:38:14 -05:00
Chenlei Hu
dbe016b934 Move widget prop to INodeInputSlot (#606)
Ref: https://github.com/Comfy-Org/ComfyUI_frontend/pull/2728
2025-02-25 19:37:40 -05:00