You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto-insert converter on convertible type mismatch
Add TypeConverterNode UI and engine node
Extend schema conversion and registry APIs
Support design token conversions with tests
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
The automatic insertion logic for the TypeConverterNode silently skips conversion if nodeLookup[TYPE_CONVERTER] is undefined. Ensure there is a clear fallback or warning to prevent silent failures during node connections.
if(needsConversion){// Create a type converter nodeconstTypeConverterClass=nodeLookup[TYPE_CONVERTER];if(TypeConverterClass){constconverterNode=newTypeConverterClass({ graph });
The code calls reactFlowInstance?.addNodes(converterFlowNode), but React Flow's API may expect a different method signature (e.g., addNode or an array). Verify that this matches the version in use to avoid UI integration errors.
The update to canConvertSchemaTypes now treats schemas with src.$id === ANY as convertible to any target. Confirm this doesn't introduce unintended conversions by reviewing downstream impacts.
Why: Passing a single node object to addNodes may not insert it properly when the API expects an array of nodes, so wrapping converterFlowNode in an array fixes a potential insertion bug.
Medium
Guard connection parameters
Add a guard at the start of the conversion block to verify that params.source, params.sourceHandle, params.target, and params.targetHandle are defined before using them, preventing possible runtime undefined errors.
Why: Adding a guard for params.source and related handles prevents runtime undefined errors, but it's a minor defensive check and can be addressed elsewhere in the call chain.
Low
General
Simplify edge filtering
Simplify the edge filtering by using filter and array spread, which improves readability and avoids manual accumulator mutations.
Why: Replacing the reduce logic with a simple filter and array spread improves readability and maintains the same functionality for edge cleanup.
Low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Tests
Description
Auto-insert converter on convertible type mismatch
Add
TypeConverterNodeUI and engine nodeExtend schema conversion and registry APIs
Support design token conversions with tests
Changes walkthrough 📝
8 files
Add TypeConverterNode React componentInsert converter between incompatible nodesRegister TYPE_CONVERTER node typeInclude typeConverter in generic nodesImplement TypeConverter graph engine nodeExtend schema conversion logicAdd design token conversion extensionsAdd design token schema conversions2 files
Define TYPE_CONVERTER node identifierAuto-register token conversion extensions5 files
Add conversion connection logic testsAdd TypeConverter node testsTest design token conversion extensionsIntegration tests for automatic conversionE2E tests for token conversion workflow