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

impl_wasm_map! unaware of primitive vs not #234

Closed
rooooooooob opened this issue Jun 28, 2023 · 1 comment · Fixed by #250
Closed

impl_wasm_map! unaware of primitive vs not #234

rooooooooob opened this issue Jun 28, 2023 · 1 comment · Fixed by #250
Assignees

Comments

@rooooooooob
Copy link
Contributor

impl_wasm_map! needs to be aware of if the keys/values are primitives or not as wasm_bindgen does not allow references for primitives, and CML uses references for non-primitives for consistency + to avoid confusing crashes (it moves the params in so if you refer to it later from JS it crashes which is confusing since unlike rust there's no compile to check that you're not using a moved value and 99% of people trying to use the library are probably completely unaware of this).

@rooooooooob rooooooooob self-assigned this Jun 28, 2023
@rooooooooob
Copy link
Contributor Author

Once this is done we should use it to add the #216 WASM maps for LabelMetadata::nfts.

rooooooooob added a commit that referenced this issue Aug 16, 2023
impl_wasm_map is now aware of whether the keys/values are WASM-exposable
and copy or not. There is now a away to specify the backing map e.g.
BTreeMap for preserve-encodings=false i.e. Byron, CIP25

Use of this macro now replaces hard-generated WASM Map (and list) types
to reduce boilerplate + allow a single common place to fix linting
errors (one of the main reasons for this change to be done in this PR -
but it was planned at some point anyway)

Fixes #234

The rest of clippy linting errors were also fixed and a check in the CI
for fmt + linting.
rooooooooob added a commit that referenced this issue Aug 16, 2023
impl_wasm_map is now aware of whether the keys/values are WASM-exposable
and copy or not. There is now a away to specify the backing map e.g.
BTreeMap for preserve-encodings=false i.e. Byron, CIP25

Use of this macro now replaces hard-generated WASM Map (and list) types
to reduce boilerplate + allow a single common place to fix linting
errors (one of the main reasons for this change to be done in this PR -
but it was planned at some point anyway)

Fixes #234

The rest of clippy linting errors were also fixed and a check in the CI
for fmt + linting.
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.

1 participant