Skip to content

Do not generate bindings for dependencies #1231

Open
@zrzka

Description

@zrzka

I have two crates - reconfix and cdsl. The former one depends on the later one:

reconfix
  |- cdsl

cdsl crate can be used as a Rust crate and it also contains bindings gated via cfg(target_arch = "wasm32"). NPM package with proper bindings can be generated.

Now I have a reconfix crate, which does use cdsl as a dependency. But when I generate bindings for the reconfix crate, all bindings (JS functions) from the cdsl crate are in the reconfix bindings as well.

Example:

  • cdsl contains JS function generate_ui
  • reconfix has cdsl as a dependency
  • reconfix does not contain JS function generate_ui
  • create NPM package / generate bindings and reconfix does contain generate_ui function, which is something I do not want, it behaves like implicit pub use ... reexports

Is there a way how to disable this behavior? For now, I introduced disable-wasm-bindings feature in the cdsl crate. But it's nothing I like or I consider as a good solution. What's the recommended way? Should I split cdsl in two crates, like cdsl (without wasm bindings) and cdsl-wasm crate, which will act as a bridge between Rust & JS only?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions