feat: support --react-email flag in binaries#271
Merged
felipefreitag merged 4 commits intomainfrom Apr 16, 2026
Merged
Conversation
felipefreitag
commented
Apr 15, 2026
| if ('pkg' in process) { | ||
| return require('esbuild-wasm'); | ||
| } | ||
| return require('esbuild'); |
Contributor
Author
There was a problem hiding this comment.
Native esbuild works and is faster in the npm-installed version
Contributor
There was a problem hiding this comment.
1 issue found across 15 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/test-react-email-binary.yml">
<violation number="1" location=".github/workflows/test-react-email-binary.yml:49">
P1: `|| true` masks command failures, so this CI test can pass even when the binary invocation itself is broken.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
gabrielmfern
approved these changes
Apr 16, 2026
The --react-email flag was blocked for binary users (Homebrew, curl, Windows installer) because esbuild's native platform-specific binaries can't be packaged into pkg binaries. This uses esbuild-wasm as a fallback when running inside a pkg binary, keeping native esbuild for npm users. - Add esbuild-wasm dependency as WASM-based fallback for pkg binaries - Detect pkg runtime and dynamically load esbuild-wasm instead of esbuild - Configure pkg to include esbuild-wasm scripts and WASM asset - Add --config package.json to all pkg invocations in CI workflows - Remove (npm install only) from --react-email flag descriptions - Add cross-platform CI workflow to test react-email in binaries
Instead of checking that build/render error codes are absent (which would also pass on segfaults or missing binaries), check that send_error is present — proving the template was bundled, rendered, and reached the API call.
On Windows CI there's no credential store, so the CLI fails with auth_error before reaching the API. Since buildReactEmailHtml runs before requireClient, auth_error also proves bundling + rendering succeeded.
c532539 to
f1fe94d
Compare
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.
Summary by cubic
Enable React Email templates in compiled binaries by loading
esbuild-wasmwhen running underpkg, while keeping nativeesbuildfor npm installs. Adds cross-platform CI to prove bundling/rendering across macOS, Linux, and Windows binaries.New Features
--react-emailworks in Homebrew/curl/Windows installer binaries viaesbuild-wasmfallback.pkgruntime and loadsesbuild-wasm; usesesbuildotherwise.Dependencies
esbuild-wasm@0.28.0and configuredpkgto include its scripts/assets.esbuildandesbuild-wasm.--config package.jsonto allpkginvocations in workflows andbuild:binso assets are bundled.Written for commit f1fe94d. Summary will update on new commits.