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

refactor(provider-wit-bindgen): use internalized deps for providers #1344

Conversation

vados-cosmonic
Copy link
Contributor

Feature or Problem

Up until now, providers that used bindgen have had to each add a few dependencies themselves that were required by bindgen:

  • serde
  • serde_bytes
  • async_trait
  • wasmcloud-provider-sdk

Bindgen used these crates as external dependencies (i.e. using a preceeding :: in the use statements), which meant that crates that used bindgen had to include these dependencies themslves.

By refactoring the bidngen crate(s) to contain these dependencies, we can write providers that only require the
wasmcloud_provider_wit_bindgen top level crate, and use the re-exported dependencies
underneath (wasmcloud_provider_wit_bindgen::deps) rather than requiring new deps.

Unfortunately, for dependencies like serde extra care must be taken as it does not rename easily, but other dependencies can mostly be used directly.

This commit converts all providers to use internalized dependencies present in wasmcloud_provider_wit_bindgen.

Related Issues

Release Information

Consumer Impact

Testing

Unit Test(s)

Acceptance or Integration

Manual Verification

@vados-cosmonic vados-cosmonic requested review from a team as code owners January 17, 2024 11:46
Up until now, providers that used bindgen have had to each add a few
dependencies themselves that were required by bindgen:

- serde
- serde_bytes
- async_trait
- wasmcloud-provider-sdk

Bindgen used these crates as external dependencies (i.e. using a
preceeding `::` in the use statements), which meant that crates that
used bindgen had to include these dependencies themslves.

By refactoring the bidngen crate(s) to contain these dependencies, we
can write providers that only require the
`wasmcloud_provider_wit_bindgen` top level crate, and use the
re-exported dependencies
underneath (`wasmcloud_provider_wit_bindgen::deps`) rather than
requiring new deps.

Unfortunately, for dependencies like `serde` extra care must be taken
as it does not rename easily, but other dependencies can mostly be
used directly.

This commit converts all providers to use internalized
dependencies present in `wasmcloud_provider_wit_bindgen`.

Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
@vados-cosmonic vados-cosmonic force-pushed the feat/provider-wit-bindgen/internalize-deps-for-providers branch from 03dd003 to 776a032 Compare January 17, 2024 11:50
@vados-cosmonic vados-cosmonic merged commit ef78904 into wasmCloud:main Jan 17, 2024
47 checks passed
@vados-cosmonic vados-cosmonic deleted the feat/provider-wit-bindgen/internalize-deps-for-providers branch January 17, 2024 12:56
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 this pull request may close these issues.

None yet

2 participants