Remove now obsolete disable-registration special case from node macro (#4375)

This commit is contained in:
Timon
2026-07-25 13:54:46 +00:00
committed by GitHub
parent 0f0f62c2e9
commit eb50be844b
4 changed files with 13 additions and 24 deletions
Generated
-1
View File
@@ -2392,7 +2392,6 @@ dependencies = [
"graphite-proc-macros", "graphite-proc-macros",
"js-sys", "js-sys",
"log", "log",
"node-macro",
"serde", "serde",
"serde-wasm-bindgen", "serde-wasm-bindgen",
"serde_bytes", "serde_bytes",
+2 -3
View File
@@ -13,10 +13,10 @@ license = "Apache-2.0"
[features] [features]
default = ["gpu", "shader-nodes", "web"] default = ["gpu", "shader-nodes", "web"]
web = ["editor", "editor?/wasm"] web = ["editor", "editor?/wasm"]
editor = ["dep:editor", "dep:graphene-std", "dep:graph-craft", "dep:node-macro", "dep:wgpu"] editor = ["dep:editor", "dep:graphene-std", "dep:graph-craft", "dep:wgpu"]
gpu = ["editor?/gpu"] gpu = ["editor?/gpu"]
shader-nodes = ["graphene-std?/shader-nodes", "gpu"] shader-nodes = ["graphene-std?/shader-nodes", "gpu"]
native = ["node-macro?/disable-registration"] native = []
[lib] [lib]
crate-type = ["cdylib", "rlib"] crate-type = ["cdylib", "rlib"]
@@ -39,7 +39,6 @@ wgpu = { workspace = true, optional = true }
web-sys = { workspace = true } web-sys = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tsify = { workspace = true } tsify = { workspace = true }
node-macro = { workspace = true, optional = true }
[dev-dependencies] [dev-dependencies]
serde_bytes = { workspace = true } serde_bytes = { workspace = true }
-3
View File
@@ -13,9 +13,6 @@ license = "Apache-2.0"
[lib] [lib]
proc-macro = true proc-macro = true
[features]
disable-registration = []
[dependencies] [dependencies]
# Workspace dependencies # Workspace dependencies
syn = { workspace = true } syn = { workspace = true }
+11 -17
View File
@@ -720,24 +720,18 @@ fn generate_register_node_impl(parsed: &ParsedNodeFn, field_names: &[&Ident], st
) )
)); ));
} }
let native = quote! {
#[cfg_attr(not(target_family = "wasm"), ctor)]
fn register_node() {
let mut registry = NODE_REGISTRY.lock().unwrap();
registry.insert(
#identifier(),
vec![
#(#constructors,)*
]
);
}
};
if cfg!(feature = "disable-registration") {
return Ok(native);
}
Ok(quote! { Ok(quote! {
#native #[cfg_attr(not(target_family = "wasm"), ctor)]
fn register_node() {
let mut registry = NODE_REGISTRY.lock().unwrap();
registry.insert(
#identifier(),
vec![
#(#constructors,)*
]
);
}
#wasm_shim #wasm_shim
}) })
} }