Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc to be clear that exported functions work component to component #176

Open
jsturtevant opened this issue Nov 21, 2024 · 1 comment · May be fixed by #177
Open

Update doc to be clear that exported functions work component to component #176

jsturtevant opened this issue Nov 21, 2024 · 1 comment · May be fixed by #177

Comments

@jsturtevant
Copy link

The docs state in several places that you must use an interface to exports from other components but this isn't correct. You can compose together two components via an exported function. I did a prototype here https://github.com/jsturtevant/csharp-components-demos/tree/main/adder-wrapper

https://component-model.bytecodealliance.org/language-support/rust.html#exporting-an-interface-with-cargo-component

The sample add.wit file exports a function. However, to use your component from another component, it must export an interface.

https://component-model.bytecodealliance.org/language-support/csharp.html#building-a-component-that-exports-an-interface

The previous example uses a WIT file that exports a function. However, to use your component from another component, it must export an interface

fyi @lukewagner

@itowlson
Copy link
Collaborator

Thanks. If memory serves (and that's a big if), this may have been written for a pre-0.2 drop of tools where composing via functions didn't work as well as intended, and copied around / not updated despite more recent tools addressing that issue. Anyway, agree the statement needs removing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants