Skip to content

feat(hooks): add usePress - #285

Merged
botond-szabo merged 1 commit into
mainfrom
feat-new-react-hook-option
Aug 29, 2026
Merged

feat(hooks): add usePress#285
botond-szabo merged 1 commit into
mainfrom
feat-new-react-hook-option

Conversation

@botond-szabo

@botond-szabo botond-szabo commented Aug 29, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added a defer option to useMounted, allowing mounted state to update after the initial mount.
    • Deferred updates are safely canceled when a component unmounts.
  • Release

    • Published an initial placeholder release for the Bolt package to reserve its name; no HTTP server API is available yet.
  • Tests

    • Added coverage for deferred mounting behavior, timer handling, references, and cleanup.

@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 002b842

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@necto/bolt Major
@necto-react/hooks Minor
@necto-react/components Patch
@necto-react/popper Patch
@necto/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@botond-szabo
botond-szabo enabled auto-merge August 29, 2026 00:00
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 53d7aa5f-cf96-488e-b235-298c773e0742

📥 Commits

Reviewing files that changed from the base of the PR and between d509c8b and 002b842.

📒 Files selected for processing (10)
  • .changeset/bolt-initial-release.md
  • .changeset/real-knives-scream.md
  • packages/@necto-react/necto-react-hooks/__tests__/useMounted.test.ts
  • packages/@necto-react/necto-react-hooks/src/useMounted/useMounted.ts
  • packages/@necto-react/necto-react-hooks/src/useMounted/useMounted.types.ts
  • packages/@necto-react/necto-react-hooks/vite.config.ts
  • packages/@necto/necto-bolt/CHANGELOG.md
  • packages/@necto/necto-bolt/package.json
  • packages/@necto/necto-bolt/src/index.ts
  • packages/@necto/necto-bolt/vite.config.ts
💤 Files with no reviewable changes (1)
  • packages/@necto/necto-bolt/CHANGELOG.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds a defer option to useMounted, including timer cleanup and tests. It also adds placeholder entry-point and packaging configuration for @necto/bolt, with release changesets for both packages.

Changes

Deferred useMounted state

Layer / File(s) Summary
Deferred mount-state behavior
packages/@necto-react/necto-react-hooks/src/useMounted/*, packages/@necto-react/necto-react-hooks/__tests__/useMounted.test.ts, .changeset/real-knives-scream.md, packages/@necto-react/necto-react-hooks/vite.config.ts
useMounted accepts defer, schedules the mounted update with setTimeout, clears pending work on unmount, and preserves ref and getter access. Tests cover timing, access types, cleanup, and timer isolation.

Bolt placeholder package

Layer / File(s) Summary
Placeholder package packaging
packages/@necto/necto-bolt/src/index.ts, packages/@necto/necto-bolt/vite.config.ts, packages/@necto/necto-bolt/package.json, .changeset/bolt-initial-release.md
@necto/bolt has an empty placeholder export, Vite packaging configuration, a build script, version 0.0.0, and an initial release changeset.

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

Merge Risk: ⚪ Minimal · up to 002b8

The PR adds optional deferred mounted-state activation while preserving the existing default behavior, and its package metadata changes do not establish a release problem. No actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ReactMountCommit
  participant useMounted
  participant TimerScheduler
  participant useMountedTest
  ReactMountCommit->>useMounted: run mount effect with defer
  useMounted->>TimerScheduler: schedule deferred state update
  TimerScheduler->>useMounted: run pending task
  useMounted-->>useMountedTest: expose mounted ref and getter as true
  ReactMountCommit->>useMounted: run unmount cleanup
  useMounted->>TimerScheduler: clear pending task
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is misleading. The changes add a defer option to the existing useMounted hook and prepare a placeholder release for @necto/bolt; they do not add usePress. Update the title to describe the main change, for example: "feat(hooks): add defer option to useMounted".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 6 files. (3 skipped: 3 …
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 6 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ 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 feat-new-react-hook-option

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.

@botond-szabo botond-szabo changed the title feat: Added new react hook option feat(hooks): add usePress Aug 29, 2026
@botond-szabo
botond-szabo added this pull request to the merge queue Aug 29, 2026
Merged via the queue into main with commit 839ae42 Aug 29, 2026
7 of 9 checks passed
@botond-szabo
botond-szabo deleted the feat-new-react-hook-option branch August 29, 2026 00:08
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