Skip to content

[CPF] Port SVGView to FoundationEssentials#17

Merged
gn-adin-b merged 20 commits into
mainfrom
adin/foundation-essentials
Jul 22, 2026
Merged

[CPF] Port SVGView to FoundationEssentials#17
gn-adin-b merged 20 commits into
mainfrom
adin/foundation-essentials

Conversation

@gn-adin-b

@gn-adin-b gn-adin-b commented Jul 20, 2026

Copy link
Copy Markdown

Summary

  • Use FoundationEssentials for WASI builds while leaving other platforms unchanged.
  • Parse Wasm XML with pinned Xylem and retain FoundationXML elsewhere.
  • Replace Foundation-only SVG parsing helpers with small pure Swift equivalents.

Validation

  • swift test
  • Swift tools 5.9 fallback manifest
  • Clean release Wasm build
  • Wasmtime smoke test through DOMParser and SVGParser
  • Verified Wasm objects contain no Foundation, FoundationXML, CoreFoundation, or ICU autolinks

@gn-adin-b
gn-adin-b force-pushed the adin/foundation-essentials branch 4 times, most recently from 464b281 to d8fecbd Compare July 21, 2026 07:52
#elseif !canImport(CoreGraphics)
public typealias CGFloat = Double

public struct CGPoint: Equatable {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I wanted to separate these in another repo since it's reusable. But, this repo is public and I can't make this thing public without legal approval so this is the best I can do

https://github.com/GoodNotes/FoundationEssentialsExtras

@gn-adin-b
gn-adin-b force-pushed the adin/foundation-essentials branch from 619414a to 233fb0d Compare July 22, 2026 09:32
Comment thread Package.swift
Comment on lines +27 to +30
.package(
url: "https://github.com/compnerd/xylem.git",
revision: "9881c95ce3a139f4ccfa584676201516c2a5751d"
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pointing to a specific rev might be an issue with some internal tooling we have about the SPM registry, but since we are not actively using it ATM we can revisit this problem later, hopefully xylem cuts a version soon.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I already faced this now

error: Dependencies could not be resolved because package 'svgview' is required using a stable-version but 'svgview' depends on an unstable-version package 'xylem' and 'svgtonotesitems' depends on 'svgview' 0.2.20-goodnotes-foundation-essentials.

@gn-adin-b

Copy link
Copy Markdown
Author

It's a pretty big PR, thanks @0xpablo for reviewing this really quickly!

I'm going to merge this now but feel free to still leave any comments. This won't be live until I merge https://github.com/GoodNotes/GoodNotes-5/pull/62778 anyway

@gn-adin-b
gn-adin-b merged commit 8295ab0 into main Jul 22, 2026
2 checks passed
@gn-adin-b
gn-adin-b deleted the adin/foundation-essentials branch July 22, 2026 11:15
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.

2 participants