Closed Johennes closed 1 month ago
In truth, I haven't spent very much time writing Javascript/Typescript, or in this community.
I don't really know how people are going to want to distribute uniffied packages via npm.
I am kinda waiting for—/ hoping that— the community (including you!) will work out what to do next.
At a minimum, I can add some .gitignore
instructions to the tutorial, but I'd love to see more patterns of usage and more developer input before writing either code or more comprehensive docs.
I'm going to add the label:help+wanted tag to this issue.
I've successfully published https://www.npmjs.com/package/@unomed/react-native-matrix-sdk with the binaries for all targets except for x86 on the public npm registry yesterday. The unpacked size is ~430MB. Packed is about a third.
Annoyingly, I wasn't able to find any official reference for the maximum allowed package or file size. So I'm not sure how much head room there is.
Including the binaries in the package has the huge advantage that consumers don't need to spend an hour building matrix-rust-sdk in release mode.
@Johennes' review for #125 had a lot of good suggestions; we should not close this yet.
After setting up UBRN in a new project created with create-react-native-library@0.35.1, I had to add the following to
.gitignore
to exclude the Rust checkouts and binaries from git:When packing the library for publishing, npm appears to have special logic for combining
.gitignore
and thefiles
array frompackage.json
.For Android,
*.a
in.gitignore
and"android"
infiles
results in theandroid/src/main/jniLibs/$target/$library.a
files being included in the package.For iOS, however, in order to include
build/$library.xcframework
, I had to add"build"
tofiles
to undo thebuild/
from.gitignore
.I'm not yet sure how to best publish packages built with UBRN but decided to log this here for documentation in the meanwhile. Changes to
.gitignore
and orfiles
appear to be needed regardless of whether one wants to include the binaries in the package or not.