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(js): remove double wrap #1138

Merged
merged 2 commits into from
Mar 5, 2025

Conversation

baszalmstra
Copy link
Collaborator

This PR removes the double wrapping of Version and VersionSpec and moves all the logic to Rust. This avoids creating an additional indirection in javascript which is easier to maintain and should be faster.

Initially I double wrapped the types meaning we expose type A from rust, then create type B in typescript that wraps A and only expose B to the user. The advantage of this approach is that we can provide a more ergonomic API to the user. But I found wasm-bindgen flexible enough that we can provide the same level of ergonomics directly from Rust. wasm-bindgen allows overriding types which allows manual control in places where the generated API is a bit ugly.

@baszalmstra baszalmstra added the JS label Mar 4, 2025
@baszalmstra baszalmstra force-pushed the js/refactor/remove_double_wrap branch from 0e9f70f to a86ecaa Compare March 4, 2025 10:33
@wolfv
Copy link
Contributor

wolfv commented Mar 5, 2025

nice!

@wolfv wolfv merged commit c765a53 into conda:main Mar 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants