refactor: Split SvgDocument into separate package#20
Draft
bobzhang wants to merge 1 commit into
Draft
Conversation
- Created new svg/ package directory with proper package configuration - Moved SvgDocument struct and all SVG rendering methods to svg package - Updated main package to import and re-export svg functionality - Added render_image_to_svg method to main Image type for compatibility - All tests passing after refactoring Co-authored-by: openhands <openhands@all-hands.dev>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR refactors the VG vector graphics library by splitting the
SvgDocumentfunctionality into a separate package, improving code organization and modularity.Changes Made
Package Structure
svg/package with proper package configurationCode Organization
render_image_to_svgmethod to main Image typeFiles Changed
svg/svg.mbt- New file containing SvgDocument implementationsvg/moon.pkg.json- Package configuration for svg packagesvg.mbt- Updated to re-export from svg packagemoon.pkg.json- Updated to import svg packageimage.mbt- Added render_image_to_svg method for compatibilityTesting
moon checkandmoon buildcomplete without errorsBenefits
Backward Compatibility
This refactoring maintains full backward compatibility. All existing code using
SvgDocumentand related functions will continue to work without any changes required.@bobzhang can click here to continue refining the PR