@ts-graphviz/react@0.11.0 #1444
kamiazya
started this conversation in
Show and Tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Minor Changes
#1363
9328563
Thanks @kamiazya! - 🚨 Breaking Changes: Drop Node.js 18 supportMinimum required version is now Node.js 20+
ESM-Only Distribution
require
fields frompackage.json
exports"type": "module"
🔄 Migration Guide
For ESM Projects (Recommended)
For CommonJS Projects
If you are using CommonJS (CJS) and need to migrate to ESM, you will need to update your project to support dynamic imports. This is necessary because the packages no longer provide CommonJS builds.
Before (CJS)
After (ESM)
🎯 Benefits
#1363
9328563
Thanks @kamiazya! - Define Supported environment and Support levelsTo provide clarity on the environments in which ts-graphviz operates, we have categorized support levels:
Support Levels
Tier 1: Full Support
Tier 2: Active Support
Tier 3: Community Support
#1363
9328563
Thanks @kamiazya! - ## React 19 Support with Breaking Changes🚨 BREAKING CHANGES
React 18 Support Discontinued
peerDependencies
to requirereact@>=19
(removedreact-dom
dependency)API Changes
Migration Required:
Container Model Access Changes
🚨 BREAKING CHANGE: New createRoot API changes how you access rendered models
Migration Required:
✨ NEW FEATURES
Modern createRoot API
createRoot()
function following React 19's modern patternscreateRoot(options)
- single options parameter for all configurationcreateRoot({ container, onRenderComplete })
for cleaner codeAdvanced Error Handling
onUncaughtError
callback with component stack tracesonCaughtError
callback for error boundary integrationRef as Prop Support
NodeModel
,EdgeModel
,RootGraphModel
) via refsReduced Dependencies
react-dom
dependency - now uses custom HTML rendering implementation🔧 TECHNICAL UPDATES
React Reconciler Modernization
createContainer
API (8 arguments vs 10)TypeScript Improvements
Type System Modernization
@ts-graphviz/common
Two approaches for type-safe model access:
Runtime Type Filtering (safe, validated):
Direct Type Casting (fast, trusted):
Model Collection Algorithm Improvements
Test Infrastructure
📚 MIGRATION GUIDE
Prerequisites
react@^19.0.0
(required)react-dom
is no longer required as this package now uses a custom HTML rendering implementationStep-by-Step Migration
Update React Dependency
Note: You can now remove
react-dom
from your dependencies if it was only needed for @ts-graphviz/react:Update to createRoot API
Replace render function calls with createRoot pattern:
Update Model Access Patterns
Add Error Handling (Optional)
Multiple Renders with Same Root
API Reference
Core Functions:
createRoot(container?, options?)
- Creates a rendering root following React 19 patternsrenderToDot(element, options?)
- Primary DOT string generationcreateRoot Options:
Type-Safe Model Access Examples:
renderToDot Options:
📦 INSTALLATION
This release represents a strategic modernization to ensure long-term compatibility with React's ecosystem while providing improved performance and developer experience.
#1363
9328563
Thanks @kamiazya! - Adjust HTML label AST handling for consistent behavior fromDot + toDot of label containing HTML gives invalid Dot #1335Improves the handling of HTML-like labels in the
fromDot
andtoDot
functions to ensure valid Dot output.Patch Changes
#1363
9328563
Thanks @kamiazya! - Update Develop Environment#1363
9328563
Thanks @kamiazya! - New GitHub Action main workflow and testsUpdated dependencies [
9328563
,9328563
,9328563
,9328563
,9328563
]:This discussion was created from the release @ts-graphviz/react@0.11.0.
Beta Was this translation helpful? Give feedback.
All reactions