Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: [POC] Replace mxGraph with maxGraph 0.15.0 #3270

Draft
wants to merge 102 commits into
base: master
Choose a base branch
from

Conversation

tbouffard
Copy link
Member

@tbouffard tbouffard commented Feb 8, 2025

Overview

This is a POC and it is not intended to be merged into master, so don't expect to find a high quality code here! 😺
This is a continuation of #3098
Covers #3238

Please don't rebase on master. If necessary, merge the master branch but instead we will create a new POC with the latest changes from the master branch.

Start from master e8fa907 (0.37.0 with dev dependencies update only)

Status

After Initialization

Just bump maxGraph to 0.15.0

  • changelog do not mention breaking changes affecting us. However, the type of the createMarker function has been enforced, and we used a wrong one
  • unit and integration tests pass
Bundle maxGraph 4.2.2 maxGraph 0.10.3 maxGraph 0.15.0 (PR intialization)
IIFE raw 1 669 729 1 249 348 1 207 959
IIFE minified 984 186 604 940 586 176
ESM 198 486 194 144 194 144
Demo chunk 818 KB 466.12 kB 447.69 kB

Detected issues in maxGraph

tbouffard added 30 commits July 4, 2023 06:53
BpmnGraph: remove batchUpdate as it is already defined in the Graph class

GraphCellUpdater.ts: WIP fix TSC errors

StyleManager.ts: WIP fix TSC errors

StyleComputer.ts: WIP fix TSC errors

BpmnRenderer.ts: update TODO

StyleConfigurator.ts: WIP fix TSC errors

StyleConfigurator.ts: add TODO after rebase

ShapeConfigurator.ts: WIP fix TSC errors

fix rebase: fix FONT imports (no more exported in style/index - internal only)

Add TODO in BPMNCellStyle

style/utils.ts: WIP fix TSC errors

StyleManager.ts: remove unused imports

StyleComputer.test.ts: WIP fix TSC errors

integration tests: WIP fix TSC errors

mxGraph.model.bpmn.elements.test.ts: restore variable name after rebase (no mx in names)

run fix CSS class undefined access - WIP CSS classes disapaer when doing navigation

fix typo in TODO/FIXME about maxgraph

StyleComputer.test.ts: fix msg flow icon tests after rebase

StyleComputer.test.ts: fix sub-process tests after rebase

StyleComputer.test.ts: clean comment in sub-process tests after rebase

the comments was the test implementation in the previous poc. During rebase, as there were too many conflicts, the tests
 hadn't been migrated and the former poc implem put there to help the new test migration

StyleComputer.test.ts: fix subprocess markers test

StyleComputer.test.ts: fix event gateway test

StyleComputer.test.ts: WIP fix bpmn in color

StyleComputer.ts: fix msg icon flow extension computation

StyleComputer.ts: improve comment

StyleComputer.ts: fix edges extension computation

style-utils.test.ts: fix subprocess tests (adhoc still KO)

style-utils.test.ts: fix msg flow icon

style-utils.test.ts: FIXME for adhoc

ThemedBpmnVisualization.ts: fix wrongly migrated comment

refactor: restore getDataModel method when getModel was called with mxGraph

refactor: restore usage of getDataModel method in BpmnRenderer.ts

refactor: restore usage of getDataModel method in GraphCellUpdater.ts

GraphCellUpdater.ts add TODO for the master branch

SvgExporter.ts: restore import order like with mxGraph imple

ShapeConfigurator.ts: restore import order like with mxGraph implem

ShapeConfigurator.ts: restore comment

StyleConfigurator.ts: restore import order

StyleConfigurator.ts: add todo for arc configuration

custom-overlay.ts: restore import order

toBeShape/index.ts: fix compilation errors

toBeEdge/index.ts: fix compilation errors

matcher-utils.ts: fix compilation errors

mxGraph.model.bpmn.elements.test.ts: fix compilation errors

integration tests: fix CSS api tests

mxGraph.model.css.api.test.ts: check no extra css classes prior adding them

IT: simplify check of extra css classes edge/shape

WIP debug extra CSS classes not added to the dom

style-utils.test.ts: fix test

WIP restore style.isInitiating: make test pass

WIP restore style.isInitiating

integration test: BpmnCellStyle.horizontal is now a boolean (same type as in CellStyle)

integration test: fix test in "bpmn in color"

StyleComputer.ts remove TODO about "isInitiating" (already managed)

mxGraph.model.bpmn.elements.test.ts: revert extra changes

StyleComputer.ts remove TODO about "style.horizontal" (already managed)

StyleComputer.ts fix label position (horizontal and vertical)

style-utils.test.ts: remove TODO already managed

StyleComputer.ts: simplify management of style.horizontal for lane and pool

update TODO

custom-overlay.ts: restore original license header

model-expect.ts: remove extra imports

model-expect.ts: simplify import

WIP tmp fix to update the style

WIP tmp fix to update the style and CSS classes (clone the style of the cell to cache and update)

refactor: simply the storage of CSS classes in the BPMN style object

integ test: refactor markers management

integ test: restore the implem of the getFontStyleValue utils function (make 2 tests pass)

CSS classes: only set in style when the array is not empty (fix 10 integration tests)

TMP: more logs in the matcher error msg to better diagnose the problem

WIP integ test: investigate lower fontStyle value

WIP integ test: fix fontStyle value

update TODO comments for consistency

fix more integration tests: CSS class reset

fix wrong assertion in IT: fontStyle

updateStyle fontStyle: less side effect when setting flag of undefined value

StyleComputer: do not set fontStyle value to 0 (restore mxGraph behaviour) + fix IT

IT: remove extra check

fix: updateStyle 'default' special value now correctly reset the value

style utils.ts: improve TODO

improve comments about workarounds for maxGraph issues

Add TODO set plugins in Graph constructor

mxGraph.model.style.api.test.ts remove extra FIXME

mxGraph.model.style.api.test.ts add TODO

StyleComputer.ts remove managed TODO

style utils: update todo

test: simplify todo

remove managed TODO

matcher-utils.ts: remove tmp solution to jest msg

matcher-utils.ts remove managed TODO

Manage "todo rebase"

update todo

fix style for rounded activity (was not correcly migrated)

StyleConfigurator.ts: migrated code better fit the original code

manage some "todo rebase"

refactor: style function - no need to return the style object anymore

refactor: rename style properties used to fill markers (prepare future feature available in maxGraph)

Add todo about fixing "fill edge markers"
…SS in master branch)

WIP integration tests run in ESM (with commonJS configuration)

Revert "EXTRA WIP run integration in ESM mode"

This reverts commit 21c3691647630cd11f5572789d47cc5a22decfce.

EXTRA WIP run integration in ESM mode

EXTRA WIP run integration in ESM mode (vscode config)
with commonJS configuration

EXTRA WIP unit tests run in ESM (with commonJS configuration)

WIP unit tests run in ESM (with commonJS configuration)

WIP unit tests run in ESM (with commonJS configuration) test pass

WIP unit tests run in ESM (with commonJS configuration) vscode config
The promises management was wrong, images were not correctly assigned to the right file
@tbouffard tbouffard added refactoring Code refactoring poc 💫 Experimentation to discuss about future implementation. Not intended to be merged mxgraph integration Something involving mxGraph (be aware of EOL) labels Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mxgraph integration Something involving mxGraph (be aware of EOL) poc 💫 Experimentation to discuss about future implementation. Not intended to be merged refactoring Code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant