Repository navigation
feat(ios): ship the xcframeworks through SwiftPM instead of npm - #206
Merged
Merged
Conversation
The canvas npm tarball outgrew the registry's size limit (413 on publish). Each of canvas, canvas-svg and audio-context now references its framework through a local SwiftPM package at platforms/ios/<Framework>Binary. In the repo the binaryTarget points at a framework downloaded or built into that directory. The npm Release workflow uploads the frameworks to the tag's GitHub release and stamps the zip's url and checksum into the published Package.swift, so SwiftPM downloads only the zip. A repositoryURL is not an option: SwiftPM would clone this repo's multi-GB history first. The frameworks and the src-native build output are no longer tracked. Run `npm run download.ios.frameworks` after cloning, or build them from source (see the README).
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 12, 2026
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.
The canvas npm tarball no longer fits on the registry: publishing 3.0.5 failed with
413 Payload Too Large(246 MB packed, 564 MB unpacked). Most of that isCanvasNative.xcframework. This moves the iOS frameworks for canvas, canvas-svg and audio-context out of the npm packages and serves them through SwiftPM from the GitHub release.How it works
Each plugin's
nativescript.config.tsnow lists two local SwiftPM packages shipped inside the npm package:platforms/ios/NativeScriptV8: the existing V8 header shim, unchanged.platforms/ios/<Framework>Binary(CanvasNativeBinary,CanvasSVGBinary,AudioContextNativeBinary): abinaryTargetfor the plugin's framework.In the repo the binary target uses
path:. During npm Release,tools/scripts/release-ios-binaries.shruns beforenpm publish:distand uploads it to the tag's GitHub release. If the release doesn't exist yet, it creates it with generated notes.url:andchecksum:into the publishedPackage.swiftand removes the framework from the package.The publish job now needs
contents: write.This is a local package with a remote binary target, not a
repositoryURLas font-manager uses. SwiftPM clones a package repository's full git history before readingPackage.swift, and this repo's history is several GB.Repo changes
src-native/*/distbuild outputs: 918 files.npm run download.ios.frameworks(latest release, or-- <tag>), or build from source. The README has a new section on this.<Framework>Binaryfolder has its own.gitignore. A root rule would make Nx leave the frameworks out ofdist, as it already did once for the V8 headers.platforms/ios: the CLI auto-links any.xcframeworkthere, so it would be linked a second time next to the SwiftPM copy. The build scripts,place-native-artifacts.shandbuild-native.ymlnow use the<Framework>Binaryfolders.Testing
NSCOpusDecoder, a class that exists only in the framework.binaryTargetcomes from a release URL resolved through Xcode and the CLI. Only the zip was downloaded, with no git clone.ghandcurlstubbed. It created a prerelease for a-betatag and wrote the URL and checksum. The zip kept the Catalyst symlinks. A second run reused the existing assets and produced the same manifests.curland with the real latest release, which has no zips yet and fails with a clear message.Not tested yet:
distdespite the per-folder.gitignore. The release would fail its "Verify native artifacts" step if it didn't.Follow-ups
download.ios.frameworkshas nothing to fetch, so building from source is the only option for a fresh clone.CanvasNative.podspec(v2.0.0) vendorssrc-native/canvas-ios/dist/CanvasNative.xcframework, which is no longer tracked. The plugins don't use it; it can probably be removed.