Skip to content

refactor!: convert ShapeUtil from static-only class to object literal#3538

Merged
tbouffard merged 2 commits into
masterfrom
refactor/ShapeUtil_value_object
Jun 29, 2026
Merged

refactor!: convert ShapeUtil from static-only class to object literal#3538
tbouffard merged 2 commits into
masterfrom
refactor/ShapeUtil_value_object

Conversation

@tbouffard

Copy link
Copy Markdown
Member

ShapeUtil only ever held static methods, so modelling it as a class was misleading: it forced an eslint-disable for unicorn/no-static-only-class and let consumers reference it as a type or try to instantiate it. Exposing it as a plain object literal reflects what it actually is, a namespace of stateless utility functions, and removes the lint suppression.

Every call site already uses ShapeUtil.method() access, so runtime behaviour and all internal usages are unchanged. The API remains experimental.

BREAKING CHANGE:

  • ShapeUtil is now an object literal instead of a class. Calling its functions via ShapeUtil.method() is unchanged, but it can no longer be used as a type (e.g. let u: ShapeUtil), instantiated with new ShapeUtil(), or extended. This API is experimental.

ShapeUtil only ever held static methods, so modelling it as a class was misleading: it forced an eslint-disable for
unicorn/no-static-only-class and let consumers reference it as a type or try to instantiate it. Exposing it as a
plain object literal reflects what it actually is, a namespace of stateless utility functions, and removes the lint
suppression.

Every call site already uses ShapeUtil.method() access, so runtime behaviour and all internal usages are unchanged.
The API remains experimental.

BREAKING CHANGE:
- ShapeUtil is now an object literal instead of a class. Calling its functions via ShapeUtil.method() is unchanged,
  but it can no longer be used as a type (e.g. `let u: ShapeUtil`), instantiated with `new ShapeUtil()`, or extended.
  This API is experimental.
@tbouffard tbouffard added the refactoring Code refactoring label Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

♻️ Preview destroyed

PR preview ♻️ Destroyed ♻️ Destroyed
🔗 Preview https://process-analytics-bpmn-visualization-js-doc_preview-pr-3538.surge.sh (already destroyed)
📝 Commite25f1ed
🪵 LogsView logs

🤖 Powered by surge-preview

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

♻️ Preview destroyed

PR preview ♻️ Destroyed ♻️ Destroyed
🔗 Preview https://process-analytics-bpmn-visualization-js-demo_preview-pr-3538.surge.sh (already destroyed)
📝 Commite25f1ed
🪵 LogsView logs

🤖 Powered by surge-preview

@tbouffard tbouffard added the skip CI e2e tests GitHub Actions do not run e2e tests (for Pull Requests) label Jun 29, 2026
@sonarqubecloud

Copy link
Copy Markdown

@tbouffard
tbouffard merged commit fb53e59 into master Jun 29, 2026
15 checks passed
@tbouffard
tbouffard deleted the refactor/ShapeUtil_value_object branch June 29, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Code refactoring skip CI e2e tests GitHub Actions do not run e2e tests (for Pull Requests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant