docs: use the object parameter form of insertVertex - #1125
Conversation
The positional signature is a legacy mxGraph inheritance and is going to be formally deprecated (see issue #856), so the documentation should not keep teaching it. Convert the tutorial sample to the single object parameter form and drop the TODO that tracked this migration. Also state in the mxGraph migration guide why the new signature should be preferred, instead of only mentioning that the former one still exists.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe documentation updates replace the positional ChangesGraph API documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



The tutorial still documented
insertVertexwith the positional signature, guarded by aTODOcomment asking for the migration. That signature is a legacymxGraphinheritance and is going to be formally deprecated, so the documentation should not keep teaching it to new users.Changes
docs/tutorials/graph.md: convert the styled vertex sample to the single object parameter form and remove theTODOthat tracked this migration.docs/usage/migrate-from-mxgraph.md: say why the new signature should be preferred (more readable and maintainable, and the positional one is going to be deprecated) instead of only stating that the former one still exists, and link issue DeprecateinsertVertexandinsertEdgelegacy methods in AbstractGraph #856.Note
The converted sample was missing the closing brace of the object literal, which made it invalid JavaScript:
This is fixed in this PR, so the published sample now parses. Verified with
node --check.Summary by CodeRabbit