sync(common-v8): AppOwner/docs/logging wave + governance merge#47
sync(common-v8): AppOwner/docs/logging wave + governance merge#47
Conversation
Replace the previous createInt/int alias with a safeInt BrandFactory and update Int to use safeInt(Number). Update the JSDoc example and add a note explaining the rename (to avoid a Next.js runtime `int is not defined` regression). Functionality (using Number.isSafeInteger) is preserved.
# Conflicts: # pnpm-lock.yaml
ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Free 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughReorganizace pravidel vlastnictví v Changes
Sequence Diagram(s)(žádné — změny neuvádějí nový vícekrokový tok mezi více komponentami, pouze refaktory a logování) Estimated code review effort🎯 3 (Středně složité) | ⏱️ ~20 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
This pull request addresses a Next.js runtime issue by renaming the internal integer type branding helper from int to safeInt to avoid a naming conflict that caused int is not defined errors in Next.js environments. The change updates the helper function name and its references in documentation while maintaining the public Int export that uses this helper internally.
Changes:
- Renamed the internal brand factory helper from
int(viacreateInt) tosafeInt - Updated the JSDoc example to reference
safeIntinstead ofint - Added a note in the documentation explaining the rename reason
- Updated the
Intexport to usesafeIntinternally
| const safeInt: BrandFactory<"Int", number, IntError> = (parent) => | ||
| brand("Int", parent, (value) => | ||
| globalThis.Number.isSafeInteger(value) | ||
| ? ok(value) | ||
| : err<IntError>({ type: "Int", value }), | ||
| ); |
There was a problem hiding this comment.
The safeInt helper should be exported to maintain backward compatibility. The previous int helper was exported (via export const int = createInt), and other similar brand factories in this file (nonNegative, positive, nonPositive, negative) are also exported. Not exporting safeInt is a breaking change for users who were using int(Number) to create custom Int types.
Add console.debug traces for mutateBatch, queryBatch and onPatchesByQuery (reporting change/query/onComplete counts) and a console.info on dispose to improve observability. Re-scope the postMessage variable declaration so worker/channel wiring stays inside its block and only postMessage remains in the outer scope. Minor comment clarifies the intent; no functional logic changes aside from logging and variable relocation.
Refine console output in packages/common/src/local-first/Db.ts: rename the leader acquisition message from "leaderAcquired" to "leaderLock acquired" for clarity, and add a "SQLite created" log after sqlite initialization to aid debugging of worker startup.
# Conflicts: # apps/web/src/app/(playgrounds)/playgrounds/minimal/EvoluMinimalExample.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Miccy <code@miccy.dev>
Summary
Conflict resolution
Verification
All verification commands passed.
Summary by CodeRabbit
Poznámky k vydání
Dokumentace
Refaktor
Chores