- `LLink.resolve`: Resolves all IDs on the link to their respective
objects (node IDs, slot indexes)
- `LinkNetwork.getLink`: a more concise pattern to resolve links
### Virtual helper "slots"
Adds a virtual input and output slot to native reroutes, allowing links
to be dragged from them to other reroutes or nodes.
https://github.com/user-attachments/assets/67d308c4-4732-4b04-a2b9-0a2b0c79b413
### Notes
- Reroute slots automatically show an outline as the pointer gets close
- When the slot is clickable, it will highlight in the same colour as
the reroute
- Enables opposite direction connecting: from reroute to node outputs
- Floating reroutes only show one slot - to whichever side is not
connected
Resolves several issues with floating links. Highlights:
- Caches floating links on slots, removing some loop checks (inefficient
/ does not scale)
- Simpler APIs
- Adds `Reroute.totalLinks` (regular and floating
- Fixes TS types
- Various bug fixes for reroute / link (re)connect
- Adds reroute snap circle when connecting links
- Validates reroutes on drop (part of larger work)
- Prevent nodes linking to themselves
- Updates UUIDv4 generator
- Adds a unique id & revision support to graphs
- `revision` to be incremented downstream (e.g. on save)
- `id` automatically assigned if not provided
### Floating reroutes
Native reroutes can now be kept in a disconnected state.
Link chains may be kept provided they are connected to _either_ an input
or an output. By design, reroutes will be automatically removed if both
sides are disconnected.
- Fixes root cause of minor in-memory-only corruption when deleting
reroutes from output slots
- Already automatically corrected via serialisation
- If `reroutes` or `links` are empty arrays, removes them from newer
object-based serialised output entirely
- Minor refactors
- Removes unused code
- Fixes some serialisation types
- Adds `ReadonlyLinkNetwork` interface
- Adds remaining TS nullable types
- Adds type guards to allow strict mode
- Uses explicit throw in places that would throw regardless
- Adds ts-ignore that must be removed later
* [ ] #578
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.
- 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)
- Part of effort to convert LGraphNode to TS strict
- Adds some small runtime changes - no impact expected, but it is
possible
- Runtime changes are in separate commits from compile-time type changes
- Risk of downstream impact is low
* [TS] Undefined is not a valid object key
* Deprecate unused code
Adds ts-expect-error to TS strict issues on unmaintained public interfaces.
* [TS] Fix nullability: asSerialisable return type
* nit - Remove outdated comment
* [TS] Strict mode: LGraph
- Adds minor coercion changes; would need extremely specific hacks performed to result in runtime change
* [TMP] Work around typescript-strict-plugin
Must be reverted once plugin removed.
See #578