You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ee77abb
Browse filesBrowse the repository at this point in the historyBrowse files
perf(ios): ship default metadata as a separate framework for embedding hosts only (#488)
* build(ios): stop copying unused default metadata into NativeScript.framework
The framework already embeds metadata-arm64.bin as its __DATA,__TNSMetadata section, which is the only copy the runtime reads. The loose 8.8 MB resource copy is never read, and the opt-in "Add default metadata" phase copied from a NativeScript/metadata/ directory that does not exist, gated on an INCLUDE_DEFAULT_METADATA setting nothing sets.
* feat(runtime): resolve metadata from the host executable when no pointer is given
When Config.MetadataPtr is nil, look for a non-empty __DATA,__TNSMetadata section in the host executable (or its <executable>.debug.dylib in Xcode debug-dylib builds) before falling back to the metadata embedded in NativeScript.framework. Hosts set up by 'ns embed ios' link their own metadata this way but never pass the pointer, so they were silently running on the framework's 2024 snapshot.
* feat(ios): move default metadata into a NativeScriptDefaultMetadata framework
NativeScript.framework no longer embeds the 8.8 MB default metadata snapshot. It now lives in a separate NativeScriptDefaultMetadata framework (iOS, simulator and Mac Catalyst) that only the NativeScriptSDK SwiftPM product links, so apps built by the NativeScript CLI, which use the NativeScript product and link their own metadata, stop shipping it.
When neither Config.MetadataPtr nor a host executable section is available, the runtime loads the accessor exported by NativeScriptDefaultMetadata.framework (already loaded, or found next to NativeScript.framework), and otherwise fails to start with an actionable message instead of running on metadata the host never asked for.
build_default_metadata.sh builds the xcframework, build_spm_artifacts.sh packages it with an NS_CHECKSUM_DEFAULTMETADATA_IOS checksum, and generate-spm-manifest.mjs declares it as a binary target of the NativeScriptSDK product. visionOS has no default metadata build.
* fix(build): accept numeric boolean flags and use $PWD in the framework build scripts
to_bool matched numbers with the case pattern [0-9]+, which is a glob for one digit followed by a literal plus, so BUILD_CATALYST=1 and friends were treated as invalid and turned the slice off. DIST was computed with $(PWD), which only resolves to /bin/pwd on a case-insensitive filesystem.
0 commit comments