Skip to content

feat: migrate deprecated diagram to new yuml API - #190

Merged
chgeo merged 1 commit into
mainfrom
yuml-migrate
Sep 16, 2026
Merged

chgeo merged 1 commit into
mainfrom
yuml-migrate

Conversation

@chgeo

@chgeo chgeo commented Sep 16, 2026

Copy link
Copy Markdown
Member

The current diagram has a 'PLEASE MIGRATE' hint on it.

So:

  • Migrate over to the new API
  • Add a test for the diagram specifically.
  • Regenerate tests

Changes in detail:

URL migration (yuml.me → app.yuml.me v1)

  • Base URL: https://yuml.me/diagram/class/https://app.yuml.me/diagram/v1/class/plain/
  • Added .svg suffix required by v1
  • Old style/direction params (;plain;dir:TB;scale:60) replaced by inline @direction LR DSL metadata and ?dir query param (which turned out not to work — only the inline DSL directive does)
  • DSL is now encodeURIComponent-encoded before embedding in the URL (raw [, ], {, } caused 500 errors in v1)

Node disambiguation fix

  • Old code used a literal %20 in the DSL to give entity set boxes a different name (Books ) from same-named entity type boxes (Books). v1 normalizes/trims whitespace in node names, collapsing them together.
  • Replaced with U+200C (ZWNJ), an invisible zero-width character that v1 treats as part of the name, keeping the nodes distinct while rendering identically.

Legend

  • @direction LR embedded in DSL for the horizontal layout
  • Rendered via <img width="450"> for a smaller display size

ER diagram

  • Rendered as a markdown linked image so clicking opens the full-size SVG

Example from the test base:

test/lib/compile/data/example.openapi3.json

New:

new

Old

old

@chgeo chgeo changed the title feat: migrate deprecated diagram to new yuml feat: migrate deprecated diagram to new yuml API Sep 16, 2026
The current diagram has a 'PLEASE MIGRATE' hint on it.

URL migration (yuml.me → app.yuml.me v1)
- Base URL: https://yuml.me/diagram/class/https://app.yuml.me/diagram/v1/class/plain/
- Added .svg suffix required by v1
- Old style/direction params (;plain;dir:TB;scale:60) replaced
  by inline @direction LR DSL metadata and ?dir query param
  (which turned out not to work — only the inline DSL directive does)
- DSL is now encodeURIComponent-encoded before embedding in the URL
  (raw [, ], {, } caused 500 errors in v1)

Node disambiguation fix
- Old code used a literal %20 in the DSL to give entity set boxes a
  different name (Books ) from same-named entity type boxes (Books).
  v1 normalizes/trims whitespace in node names, collapsing them together.
- Replaced with U+200C (ZWNJ), an invisible zero-width character that v1
  treats as part of the name, keeping the nodes distinct while rendering identically.

Legend
- @direction LR embedded in DSL for the horizontal layout
- Rendered via <img width="450"> for a smaller display size

ER diagram
- Rendered as a markdown linked image [![](url)](url) so clicking opens
  the full-size SVG
@chgeo
chgeo marked this pull request as ready for review September 16, 2026 17:20
@daogrady
daogrady self-requested a review September 16, 2026 17:39

@daogrady daogrady left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First time I am consciously hearing of "yuml"...

Image

thanks for the fix

@chgeo
chgeo merged commit 42958b8 into main Sep 16, 2026
18 of 19 checks passed
@chgeo
chgeo deleted the yuml-migrate branch September 16, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants