Skip to content

Commit

Permalink
Bump RN codegen to uniffi 0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
dangeross committed Sep 30, 2024
1 parent 8374a18 commit 73765ba
Show file tree
Hide file tree
Showing 60 changed files with 2,016 additions and 1,057 deletions.
205 changes: 23 additions & 182 deletions lib/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions lib/bindings/langs/react-native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ edition = "2021"
anyhow = { version = "1.0.57", features = ["backtrace"] }
thiserror = "1.0"
tokio = { version = "1", features = ["full"] }
uniffi = { version = "0.23.0", features = ["bindgen-tests", "cli"] }
uniffi_bindgen = "0.23.0"
uniffi_macros = "0.23.0"
uniffi = { version = "0.25.2", features = ["bindgen-tests", "cli"] }
uniffi_bindgen = "0.25.2"
uniffi_macros = "0.25.2"
camino = "1.1.1"
log = { workspace = true }
serde = "*"
askama = { version = "0.11.1", default-features = false, features = ["config"] }
askama = { version = "0.12", default-features = false, features = ["config"] }
toml = "0.5"
clap = { version = "3.2.22", features = ["derive"] }
heck = "0.4"
paste = "1.0"
once_cell = { workspace = true }

[build-dependencies]
uniffi_build = { version = "0.23.0" }
uniffi_bindgen = "0.23.0"
uniffi_build = { version = "0.25.2" }
uniffi_bindgen = "0.25.2"
anyhow = { version = "1.0.57", features = ["backtrace"] }
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use uniffi_bindgen::ComponentInterface;

use super::CodeType;

#[derive(Debug)]
pub struct CallbackInterfaceCodeType {
id: String,
}

impl CallbackInterfaceCodeType {
pub fn new(id: String) -> Self {
Self { id }
}
}

impl CodeType for CallbackInterfaceCodeType {
fn type_label(&self, ci: &ComponentInterface) -> String {
super::KotlinCodeOracle.class_name(ci, &self.id)
}

fn canonical_name(&self) -> String {
format!("Type{}", self.id)
}

fn initialization_fn(&self) -> Option<String> {
Some(format!("{}.register", self.ffi_converter_name()))
}
}
Loading

0 comments on commit 73765ba

Please sign in to comment.