Conversation
woahwhattheheck
left a comment
There was a problem hiding this comment.
A focused serialization correction from our preserved source packet: true-valued JSX attributes currently serialize as bare names, which is valid HTML boolean syntax but invalid XML attribute syntax for inline SVG. The existing escaped string path already converts true to "true". The suggestion keeps false/null omission and the rest of this implementation unchanged, preserving @bpc-oss's feature authorship. Source inspection only; I did not run Qt, TypeScript, or verify:svg. AI-assisted review.
| return result; | ||
| } | ||
|
|
||
| result.push(value === true ? attributeName : `${attributeName}="${escapeAttribute(attributeValue)}"`); |
There was a problem hiding this comment.
Use the existing quoted/escaped value path for true as well, so the output remains well-formed XML:
Suggested change
| result.push(value === true ? attributeName : `${attributeName}="${escapeAttribute(attributeValue)}"`); | |
| result.push(`${attributeName}="${escapeAttribute(attributeValue)}"`); |
This branch has not been deployed
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 adds SVG component support to
react-nodeguiusingQSvgWidget, and includes the runtime fixes needed to make the feature work reliably.It covers:
Svgroot component plus exported helpers likeRect,Circle,Path, andSvgTextsrc,content, andbufferloading pathstspanhandling inside SVG text nodesnpm run verify:svgFixes #31.
Why this PR
There are already related attempts in #387, #388, and #389. Compared with those branches, this version also fixes the runtime issues that blocked a clean handoff:
createInstancebehavior for nested SVG elements@nodegui/nodegui/dist/...dependencyVerification
Ran locally:
npm run buildnpm run verify:svgnpm run verify:svgcovers:rectSvgTextcontent/buffer/srctspanserializationNotes
SvgTextrather than the existing hostTextcomponent.