feat: add barcode component for email-safe HTML table barcodes#2960
feat: add barcode component for email-safe HTML table barcodes#2960balcsida wants to merge 17 commits intoresend:canaryfrom
Conversation
|
|
@balcsida is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
6a133b4 to
e7aec55
Compare
There was a problem hiding this comment.
3 issues found across 31 files
Confidence score: 3/5
- Potential data corruption risk:
packages/barcode/src/generate-qr.tspasses string input to qrcode-generator as raw bytes, so non-ASCII/multi-byte characters may be truncated or corrupted - Two naming-convention violations (
hasEC,generateQR) are style issues and low impact compared to the encoding concern - Given the concrete user-facing encoding risk (sev 7/10), this is a moderate-risk merge despite mostly stylistic issues
- Pay close attention to
packages/barcode/src/generate-qr.ts,packages/barcode/src/types.ts,packages/barcode/src/barcode.tsx- encoding handling and acronym naming consistency.
Prompt for AI agents (all 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="packages/barcode/src/generate-qr.ts">
<violation number="1" location="packages/barcode/src/generate-qr.ts:10">
P1: Potential data corruption for non-ASCII input due to missing UTF-8 encoding. The qrcode-generator library treats string input as raw bytes (ISO-8859-1) by default. Multi-byte characters will be truncated or corrupted.</violation>
</file>
<file name="packages/barcode/src/types.ts">
<violation number="1" location="packages/barcode/src/types.ts:25">
P2: Rule violated: **Initialisms and Acronyms Naming Conventions**
Rename `hasEC` to a normalized acronym form like `hasEc` to comply with the Initialisms and Acronyms Naming Conventions rule (all-caps acronyms inside identifiers are disallowed).</violation>
</file>
<file name="packages/barcode/src/barcode.tsx">
<violation number="1" location="packages/barcode/src/barcode.tsx:9">
P2: Rule violated: **Initialisms and Acronyms Naming Conventions**
Rename the `generateQR` identifier to `generateQr` to avoid all-uppercase acronyms inside camelCase/PascalCase identifiers, per the Initialisms and Acronyms Naming Conventions rule.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
commit: |
Summary
@react-email/barcodepackage that generates barcodes as pure HTML tables — no images needed, works in every email clientComponent API
Output uses
dangerouslySetInnerHTMLwith a<table>— same pattern as@react-email/markdown.Key design decisions
qrcode-generatorandbwip-jsas regulardependencies(matches how@react-email/markdownusesmarked)GridDrawingclass with scanline polygon fill, avoiding any canvas/native dependency — fully synchronous, works in React render<td>cellsTest plan
pnpm --filter @react-email/barcode buildproducesdist/pnpm --filter @react-email/barcode test— 9 vitest tests pass:Summary by cubic
Add @react-email/barcode to render QR and other barcodes as pure HTML tables in emails—no images. Uses a custom no-canvas bwip-js backend with packing/compression for smaller HTML and broad client support.
New Features
Bug Fixes
Written for commit 0d5bdfe. Summary will update on new commits.