Skip to content

Support expr when use typescript_custom_section attribute#3901

Merged
Liamolucko merged 21 commits intowasm-bindgen:mainfrom
swnb:main
Apr 10, 2024
Merged

Support expr when use typescript_custom_section attribute#3901
Liamolucko merged 21 commits intowasm-bindgen:mainfrom
swnb:main

Conversation

@swnb
Copy link
Copy Markdown
Contributor

@swnb swnb commented Mar 20, 2024

for example

#[wasm_bindgen(typescript_custom_section)]
const _: &'static str = include_str!("./types.d.ts");
const TS_INTERFACE_EXPORT: &str = "interface Person2 { height: number; }";
#[wasm_bindgen(typescript_custom_section)]
const _: &str = TS_INTERFACE_EXPORT;

this pr is inspired by #3308 , and will fix [#2828]

this pr is compatible with current encode logic, so wasm-bindgen cli can decode normally without updating

@daxpedda daxpedda added the needs review Needs a review by a maintainer. label Mar 27, 2024
@swnb
Copy link
Copy Markdown
Contributor Author

swnb commented Apr 1, 2024

I don't mean to rush you , but any progress about this pr @daxpedda

@daxpedda
Copy link
Copy Markdown
Member

daxpedda commented Apr 1, 2024

Unfortunately I'm not really qualified to review any TS related stuff, so I leave it to other maintainers.

Comment thread src/lib.rs Outdated
Comment thread crates/backend/src/codegen.rs Outdated
Comment thread crates/backend/src/codegen.rs Outdated
Comment thread crates/backend/src/codegen.rs Outdated
Comment thread crates/backend/src/codegen.rs Outdated
Comment thread crates/cli-support/src/decode.rs Outdated
Comment thread crates/shared/src/lib.rs Outdated
Comment thread crates/backend/src/encode.rs Outdated
Comment thread crates/typescript-tests/src/custom_section_types
Comment thread src/lib.rs Outdated
@swnb swnb requested a review from Liamolucko April 9, 2024 11:39
Comment thread crates/backend/src/encode.rs Outdated
Comment thread src/lib.rs Outdated
@swnb swnb requested a review from Liamolucko April 9, 2024 14:34
Copy link
Copy Markdown
Contributor

@Liamolucko Liamolucko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Could you add a changelog entry?

Comment thread src/lib.rs Outdated
swnb added 2 commits April 10, 2024 11:00
Support Expressions when using the `typescript_custom_section` attribute[wasm-bindgen#3901]
@swnb
Copy link
Copy Markdown
Contributor Author

swnb commented Apr 10, 2024

Thanks for your patience, I've updated the changelog

@swnb swnb requested a review from Liamolucko April 10, 2024 03:15
Comment thread CHANGELOG.md Outdated
@Liamolucko Liamolucko merged commit 7d0b11c into wasm-bindgen:main Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Needs a review by a maintainer.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants