Email attachment builder: typed-array helper + worker test#988
Open
guybedford wants to merge 1 commit intomainfrom
Open
Email attachment builder: typed-array helper + worker test#988guybedford wants to merge 1 commit intomainfrom
guybedford wants to merge 1 commit intomainfrom
Conversation
Adopts the ts-gen typed-array builder cleanups in the regenerated\n`worker/src/email.rs`. The dictionary helpers for `EmailAttachment.content`\nnow expose a generic `*_with_typed_array<T: ::js_sys::TypedArray>` shape so\ncallers can pass any `Uint8Array`/`Int32Array`/etc. directly, plus the\nkeyword-safe `type_` getter, the deduped `set_disposition`, and trimmed JSDoc\noutput. Adds an end-to-end worker test that exercises the new builder via the email\nbinding: - `test/src/send_email.rs` registers a `structured-with-attachment`\n scenario that builds a `Uint8Array`, calls\n `EmailAttachment::new_attachment_with_typed_array`, and attaches it to\n the structured `SendEmailBuilder`.\n- `test/tests/send_email.spec.ts` adds a matching vitest case. Refs wasm-bindgen/ts-gen#15. Verified with `cargo +stable check -p worker-sandbox --target wasm32-unknown-unknown`.
Closed
Merging this PR will not alter performance
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adopts the ts-gen typed-array builder cleanups in the regenerated
worker/src/email.rs. The dictionary helpers forEmailAttachment.contentnow expose a generic*_with_typed_array<T: ::js_sys::TypedArray>shape, plus the keyword-safetype_getter, the dedupedset_disposition, and trimmed JSDoc output.The submodule bump pulls in the ts-gen changes from wasm-bindgen/ts-gen#15.
A new end-to-end worker test exercises the regenerated builder against the live email binding:
test/src/send_email.rsadds astructured-with-attachmentscenario that builds aUint8Array, constructs the attachment viaEmailAttachment::new_attachment_with_typed_array, and attaches it to the structuredSendEmailBuilder.test/tests/send_email.spec.tsadds a matching vitest case.Tests
cargo +stable check -p worker-sandbox --target wasm32-unknown-unknownsend_emailvitest cases still pass; new typed-array scenario added.Remaining follow-ups
These belong upstream in ts-gen, but are worth listing here so the workers-rs side is regenerated when they land:
undefined/voidarms in the union LUB socontentId?: string | undefinedbecomesOption<String>and the deadset_content_id_with_undefinedsetter overload disappears.Returns:JSDoc rendering JSDoc-aware (backtick the braced{T}, leave prose untouched).