@crossbind/core-embind-rust 2.0.0-beta.62 → 2.0.0-beta.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Rust **producer** for the crossbind embind registration protocol. Write an idiomatic Rust
4
4
  struct, register it, and it surfaces in JS as a real class - on web through emscripten's
5
- embind, on mobile through [`@crossbind/core-embind-jsi`](../core-embind-jsi) - **with no
5
+ embind, on mobile through [`@crossbind/core-embind-jsi`](../embind-jsi) - **with no
6
6
  generated C++ wrapper and no cbindgen header**. The Rust side talks straight to the
7
7
  registration ABI that both hosts already consume.
8
8
 
@@ -92,7 +92,8 @@ On import the toolchain synthesizes a self-contained bridge crate under
92
92
  `<project>/.crossbind/rust-bridges/<name>/` (the user file is embedded via `#[path] mod user;` -
93
93
  no copy) plus a `counter.rs.d.ts` next to the source for full editor typing. The native builds
94
94
  bundle every app-local surface into ONE super staticlib (`rust-bridges/_app_super`) and link it
95
- into the app lib (iOS: merged into the force_loaded react-native-crossbind.a; Android: whole-archive).
95
+ into the app lib (iOS: merged into the force_loaded react-native-crossbind.a; Android and Node.js
96
+ addons: whole-archive, on Windows through its keep symbol).
96
97
 
97
98
  App-local surfaces can use UPSTREAM crates directly - the C++-style model where the app writes
98
99
  its own thin surface over a linked library and no crossbind package is involved. Declare the crates
@@ -165,7 +166,10 @@ constructor share one object), and is linked lazily with that symbol pinned
165
166
  (iOS `-Wl,-u,_crossbind_keep_<lib>`, Android `-Wl,--undefined=crossbind_keep_<lib>`) - the registration
166
167
  object is pulled, libstd stays lazy and deduplicates. Manual-bindings crates (no keep symbol)
167
168
  still fall back to force_load/whole-archive and are therefore safe only as the app's single
168
- Rust archive.
169
+ Rust archive. On Windows the super staticlib links lazily too: two crates in it may import one
170
+ DLL through raw-dylib (std and getrandom both import `ProcessPrng`), and lld cannot load the
171
+ repeated import tables whole. There the link pins `crossbind_keep_crossbind_app_super()`, which
172
+ reaches the keep symbol each app bridge exports; the super builds every bridge as one object.
169
173
 
170
174
  Web specifics: wasm-ld's `-u` does NOT pull archive members, so the wasm link pins keep symbols
171
175
  with `-Wl,--export=crossbind_keep_<lib>` instead; and any Rust archive in the link makes `buildWasm`
package/crate/src/lib.rs CHANGED
@@ -173,7 +173,9 @@ macro_rules! bindings {
173
173
  }
174
174
  #[used]
175
175
  #[cfg_attr(target_vendor = "apple", link_section = "__DATA,__mod_init_func")]
176
- #[cfg_attr(not(target_vendor = "apple"), link_section = ".init_array")]
176
+ // The Windows CRT runs no .init_array; it calls what .CRT$XCU holds when the DLL loads.
177
+ #[cfg_attr(windows, link_section = ".CRT$XCU")]
178
+ #[cfg_attr(not(any(target_vendor = "apple", windows)), link_section = ".init_array")]
177
179
  static __CROSSBIND_EMBIND_CTOR: extern "C" fn() = __crossbind_embind_ctor;
178
180
  };
179
181
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossbind/core-embind-rust",
3
- "version": "2.0.0-beta.62",
3
+ "version": "2.0.0-beta.63",
4
4
  "description": "Rust producer for the crossbind embind registration protocol - bind Rust structs as classes reachable from JS on web (embind) and mobile (embind-jsi). Research/spike stage.",
5
5
  "homepage": "https://github.com/crossbind/crossbind/tree/main/core/embind-rust#readme",
6
6
  "repository": {