Skip to content

Deps 04 08 2026 - #601

Merged
LGLabGreg merged 3 commits into
mainfrom
deps-04-08-2026
Aug 4, 2026
Merged

Deps 04 08 2026#601
LGLabGreg merged 3 commits into
mainfrom
deps-04-08-2026

Conversation

@LGLabGreg

@LGLabGreg LGLabGreg commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes

    • Made randomly sized QR modules deterministic, preventing server-rendering hydration mismatches and visual reshuffling during image resizing.
    • Ensured module sizing remains stable when QR image areas are excavated or altered.
  • Tests

    • Added coverage for consistent, value-based sizing across cells, seeds, and rendering scenarios.
  • Chores

    • Updated development and documentation tooling dependencies.

Bumps Next 16.2.10 -> 16.3.0, TypeScript 6 -> 7, and the usual minor
and patch updates across the workspace.

TypeScript 7 no longer ships the JavaScript Compiler API that
vite-plugin-dts needs to emit declarations, so the library gains
@typescript/typescript6 as a devDependency. Next 16.3 runs the
project-local tsc for type checking by default, so `next build` now
uses TypeScript 7 directly.

pnpm added minimumReleaseAgeExclude entries for next@16.3.0 and its
prebuilt SWC binaries to waive the release-age delay. They pin exact
versions, so they can be pruned once Next moves past 16.3.0.
getScaleFactor called Math.random() during render, so the server and
the client produced different module sizes. That desynced hydration,
and a static prerender froze one arbitrary result into the HTML: every
visitor saw the same "random" code until the next deploy. Under Next's
Cache Components it is a hard prerender error.

Scale factors now come from a hash of the module's position and a seed
derived from the code's own module grid, so the same value always
renders the same layout and different values still differ.

The seed is taken from the pre-excavation grid, so resizing an image
with excavate set no longer reshuffles the modules around the logo.
This required threading cells through to DataModules; the prop is
required rather than defaulted to modules, since a silent fallback
would reintroduce the same bug.

The qrcodegen change is a whitespace-only reformat from oxfmt 0.62,
grouped here because oxlint ignores that path and rejects a commit
where it is the only staged file under packages/.
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
reactqrcode-com Ready Ready Preview Aug 4, 2026 5:28pm

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@LGLabGreg, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 46d1f886-ce89-4dfa-b502-1ab0d7b1933e

📥 Commits

Reviewing files that changed from the base of the PR and between a23a08f and e24a44c.

📒 Files selected for processing (1)
  • package.json

Walkthrough

The PR replaces render-time randomness in QR module sizing with deterministic, grid-seeded scaling. It passes pre-excavation cells through DataModules, adds coverage for stable output, and updates dependency and workspace configuration.

Changes

Deterministic QR module sizing

Layer / File(s) Summary
Seeded module scaling
packages/react-qr-code/src/types/utils.ts, packages/react-qr-code/src/utils/data-modules.ts, packages/react-qr-code/src/components/data-modules.tsx, packages/react-qr-code/src/react-qr-code.tsx
DataModules receives the pre-excavation cells grid. getModulesSeed uses FNV-1a hashing. getScaleFactor uses cell coordinates and the seed instead of Math.random().
Sizing and rendering validation
packages/react-qr-code/src/components/data-modules.test.tsx, packages/react-qr-code/src/utils/data-modules.test.ts, packages/react-qr-code/src/react-qr-code.test.tsx, .changeset/fix-random-size-hydration.md
Tests verify deterministic sizing, seed variation, bounded values, value-specific layouts, and stable scales after excavation changes. A patch changeset documents the behavior.

Repository maintenance

Layer / File(s) Summary
Tooling and workspace updates
apps/docs/package.json, package.json, packages/react-qr-code/package.json, pnpm-workspace.yaml, packages/react-qr-code/src/lib/qrcodegen/index.ts
Dependency versions and testing tools were updated. Next.js 16.3.0 packages were excluded from release-age checks. One numeric-segment loop initializer was reformatted.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReactQrCode
  participant DataModules
  participant SizingUtils
  ReactQrCode->>DataModules: pass pre-excavation cells
  DataModules->>SizingUtils: derive seed from cells
  DataModules->>SizingUtils: calculate scale using x, y, and seed
  SizingUtils-->>DataModules: return deterministic module scale
  DataModules-->>ReactQrCode: render scaled modules
Loading

Possibly related PRs

Poem

I’m a rabbit with a QR to share,
Seeded squares now stay in place with care.
No random hops from server to screen,
Stable circles glow crisp and clean.
Cells guide each nibble-sized delight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the dependency updates, but it does not mention the deterministic random sizing and hydration fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deps-04-08-2026

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LGLabGreg
LGLabGreg merged commit c07de11 into main Aug 4, 2026
3 of 4 checks passed
@LGLabGreg
LGLabGreg deleted the deps-04-08-2026 branch August 4, 2026 17:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 38: Update the Vitest setup path in vitest.setup.ts to import the
Vitest-specific `@testing-library/jest-dom/vitest` entry point instead of the Jest
entry point, while preserving the existing DOM matcher setup.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f0171a5e-86fe-492b-a912-5f780907294b

📥 Commits

Reviewing files that changed from the base of the PR and between d8a5ca0 and a23a08f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .changeset/fix-random-size-hydration.md
  • apps/docs/package.json
  • package.json
  • packages/react-qr-code/package.json
  • packages/react-qr-code/src/components/data-modules.test.tsx
  • packages/react-qr-code/src/components/data-modules.tsx
  • packages/react-qr-code/src/lib/qrcodegen/index.ts
  • packages/react-qr-code/src/react-qr-code.test.tsx
  • packages/react-qr-code/src/react-qr-code.tsx
  • packages/react-qr-code/src/types/utils.ts
  • packages/react-qr-code/src/utils/data-modules.test.ts
  • packages/react-qr-code/src/utils/data-modules.ts
  • pnpm-workspace.yaml

Comment thread package.json
"@changesets/cli": "^2.31.0",
"@testing-library/jest-dom": "^6.9.1",
"@changesets/cli": "^2.31.1",
"@testing-library/jest-dom": "^7.0.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package files =="
git ls-files | rg '(^|/)(package\.json|vite\.config\.(ts|js|r?mts?|cts?)|vitest\.(config|setup)\.(ts|js|r?mts?|cts?)|\.config/vitest.*)$' || true

echo
echo "== package.json deps around `@testing-library` =="
if [ -f package.json ]; then
  node -e "const p=require('./package.json'); console.log('test:', JSON.stringify(Object.fromEntries(Object.entries(p.devDependencies||{}).filter(([k])=>k.includes('testing')||k.includes('vitest')||k.includes('jest')), null, 2)))"
fi

echo
echo "== vitest setup import(s) =="
for f in $(git ls-files | rg '(^|/)vitest\.setup\.(ts|js|m?ts)$|(^|/)vite\.config\.(ts|js)$'); do
  echo "-- $f"
  sed -n '1,160p' "$f" | nl -ba -v1 | rg -n '`@testing-library/jest-dom`|vite/config|test|globals|setupFiles|environment' -C 2 || true
done

echo
echo "== package manager lock files =="
git ls-files | rg '(^|/)(package-lock\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb|bun\.lock)$' || true

Repository: LGLabGreg/react-qr-code

Length of output: 716


🌐 Web query:

@testing-library/jest-dom Vitest import @testing-library/jest-dom/vitest documentation

💡 Result:

To use @testing-library/jest-dom with Vitest, you must import the dedicated Vitest entry point in your test setup file [1][2]. Setup Instructions: 1. Create a setup file (e.g., vitest-setup.ts or vitest-setup.js) and add the following import [1][2]: import '@testing-library/jest-dom/vitest'; 2. Update your vitest.config.js (or vitest.config.ts) to include this file in the setupFiles configuration [1][2]: export default defineConfig({ test: { setupFiles: ['./vitest-setup.ts'], // or your filename }, }); 3. If you are using TypeScript, ensure your setup file is included in your tsconfig.json and that the necessary types are configured. Add @testing-library/jest-dom to your compilerOptions.types to ensure the matchers are correctly recognized by your IDE and TypeScript compiler [1][2]: { "compilerOptions": { "types": ["vitest/globals", "@testing-library/jest-dom"] }, "include": [ "./vitest-setup.ts" ] } Using the /vitest entry point is required for compatibility, as it correctly hooks into Vitest's expect interface rather than the global Jest object [1][3][2]. If you encounter type errors, verifying that the setup file is included in your tsconfig and that the types are referenced in the configuration is often the solution [4][5].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== vitest.setup.ts =="
python3 - <<'PY'
from pathlib import Path
for p in ["vitest.setup.ts", "vitest.config.ts", "vitest.config.js"]:
    try:
        text = Path(p).read_text()
    except FileNotFoundError:
        continue
    print(f"-- {p} ({len(text.splitlines())} lines)")
    for i, line in enumerate(text.splitlines(), 1):
        if 1 <= i <= 220:
            print(f"{i:4d}: {line}")
PY

echo
echo "== check setupFiles =="
python3 - <<'PY'
from pathlib import Path
import re
p=Path("vitest.config.ts")
if p.exists():
    text=p.read_text()
    print(text)
PY

Repository: LGLabGreg/react-qr-code

Length of output: 1436


Use the Vitest entry point for @testing-library/jest-dom.

vitest.setup.ts is loaded by the Vitest setup path and imports the Jest entry point. Since this setup files DOM matchers, import @testing-library/jest-dom/vitest so Vitest matchers are registered correctly.

Suggested setup change
-import '`@testing-library/jest-dom`'
+import '`@testing-library/jest-dom/vitest`'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 38, Update the Vitest setup path in vitest.setup.ts to
import the Vitest-specific `@testing-library/jest-dom/vitest` entry point instead
of the Jest entry point, while preserving the existing DOM matcher setup.

Source: MCP tools

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 this pull request may close these issues.

1 participant