fix!: improve the robustness of codecs by tbouffard · Pull Request #872 · maxGraph/maxGraph

@tbouffard

GraphViewCodec and StylesheetCodec:
  - fix style property retrieval: correctly loop over the properties of the style of CellState
  - add tests

Other fixes:
  - Graph codec: only exclude existing fields
  - exclude and idrefs: enforce type in array
  - ObjectCodec: use right numeric attributes names for Geometry and Point

Improvements:
  - ModelCodec: improve method signature of encodeObject
  - use explicit names for object and array codecs
  - decode/import: generate a warning log when no codec found for a node
  - types in codecs: use specific types instead of any to better detect type errors
  - declare more precise types in method signature of EditorToolbar and accept null parameters in some methods
  - improve JSDoc
  - add tests for GraphDataModel codec for extra node in addition to root

BREAKING CHANGES: the return types of some methods of EditorToolbar are now more precise.
  - addPrototype(): HTMLImageElement, no longer HTMLImageElement | HTMLButtonElement
  - addCombo(): HTMLSelectElement instead of HTMLElement

@tbouffard added the bug

Something isn't working

label

Jul 10, 2025

tbouffard

@tbouffard tbouffard marked this pull request as ready for review

July 10, 2025 19:09

coderabbitai[bot]

@tbouffard

@tbouffard

@tbouffard tbouffard deleted the fix/codec_improve_robustness branch

July 11, 2025 10:02