Skip to content

svg: use shared bounded prefix path parsing - #3800

Merged
dylanmtaylor merged 1 commit into
mainfrom
refactor/shared-svg-prefix-path
Nov 17, 2026
Merged

dylanmtaylor merged 1 commit into
mainfrom
refactor/shared-svg-prefix-path

Conversation

@dylanmtaylor

@dylanmtaylor dylanmtaylor commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Scope

Remove the local SVG path/numeric tokenizer and parser, using craft_svg::prefix_path for production parse_path_data, bounded geometry and numeric lists. All eight original module tests remain on the shared production reexports. App document budgets, rendering and geometry mapping stay unchanged.

Depends on storytold/craft-libs#1972 at e52cd9a889adbeeda447c75a546133960cf3382d. Merge prerequisite, repin to shared main, then rerun hosted checks before merging. Reconcile sibling CSS #3797 and colour #3798 by retaining all cutovers and pinning shared main containing all prerequisites.

This removes path parsing only; full SVG document migration is not complete.

Parity, safety and attribution

Shared compatibility API keeps malformed prefixes, exact kurbo quadratic elements, radius-scaled cubic arc tolerance, degenerate endpoints, finite-coordinate refusal, post-Z termination and flag semantics. Strict neutral shared paths are intentionally not substituted. Newly public shared budget ceilings are100,000 elements/200,000 numbers; existing app callers are already within them. Shared primary-author commits preserve Brandon Thomas, NetterSilver and FredApps contributions.

Only craft-svg manifest pin changes. Lock removals are its existing optional raster-codec dependency split, not unrelated upgrades.

Validation

Metadata --no-deps --locked, rustfmt --check and whitespace checks passed. Shared small offline Cargo harness with kurbo0.13.1 passed19tests and2,700 exact old/new path/flag/number comparisons. Full app/shared workspace build, Clippy, WASM and render suites not run locally; independent review and relevant hosted gates required. No workflow edits or bypass.

Summary by CodeRabbit

  • Refactor
    • Updated the implementation used for SVG path parsing. No user-visible behavior changes were specified.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The craft-svg dependency revision changes. The SVG path data module replaces its local parser implementation with re-exports from craft_svg::prefix_path.

Changes: SVG Path Parser

Layer / File(s) Summary
Delegate path parsing
Cargo.toml, crates/svg/src/pathdata.rs
The craft-svg revision changes. The path data module re-exports MAX_PATH_ELEMENTS, numbers_bounded, parse_path_data, and parse_path_data_bounded from craft_svg::prefix_path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: echelon, slager2, fredapps

Merge Risk: Minimal · up to 5d740

This change moves SVG path parsing to the shared craft-svg library with no intended behavior change. No concrete problems were found. Make sure the hosted build and render checks pass after the shared dependency is merged and repinned.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "svg: use shared bounded prefix path parsing" matches the main change. The PR removes the local SVG path tokenizer and parser in crates/svg/src/pathdata.rs and re-exports parse_path_data and…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "svg: use shared bounded prefix path parsing" matches the main change. The PR removes the local SVG path tokenizer and parser in crates/svg/src/pathdata.rs and re-exports parse_path_data and parse_path_data_bounded from craft_svg::prefix_path. The title is specific and concise. It does not mention the numeric parsing or the dependency pin, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 60e2cbb and 5d74082.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 2

  • Cargo.toml
  • crates/svg/src/pathdata.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@dylanmtaylor
dylanmtaylor merged commit defa16a into main Nov 17, 2026
12 checks passed
dotCooCoo added a commit to dotCooCoo/effectcraft that referenced this pull request Nov 17, 2026
Every direct craft-libs dependency, the hayro-syntax and hayro-jbig2
patches and craft-cms now pin craft-libs main at 453b0da782, and
`cargo xtask pdf-deps` expects craft-pdf and craft-ps there. craft-svg
moves from the branch head main pinned for storytold#3800 to the merged
storytold/craft-libs#1972.

craft-mesh now reads glTF KHR_texture_transform (craft-libs storytold#1935) and
no longer reports it as unread. The model import does not apply the
transform yet, so it warns when a texture slot carries one; the
TextureRef literal in the scene test gains the new field.

craft-update inspects a release the app offers on a thread of its own
(craft-libs storytold#1149), so the startup-prompt lifecycle test ticks the
updater until the prompt opens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant