Repository navigation
feat(usePageVisibilityEffect): add usePageVisibilityEffect and deprecate useVisibilityEvent - #546
Conversation
🦋 Changeset detectedLatest commit: c9e27b9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Size Change: +527 B (+0.46%) Total Size: 116 kB 📦 View Changed
ℹ️ View Unchanged
|
|
Thanks, this looks good! One thing on the changeset: #435 announced that |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1-base #546 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 70 71 +1
Lines 2282 2287 +5
Branches 735 735
=========================================
+ Hits 2282 2287 +5 🚀 New features to boost your workflow:
|
30078f7 to
18625de
Compare
…ate useVisibilityEvent useVisibilityEvent runs a callback when the value of usePageVisibility would change, but the names do not show that the two are a pair, and it is the only hook with an *Event suffix. Add usePageVisibilityEffect with the same signature and behavior, keep useVisibilityEvent as a deprecated alias of it, and switch useImpressionRef to the new name.
… deprecated alias useVisibilityEvent moves into the usePageVisibilityEffect folder as a one-line alias, its pages are removed, the usePageVisibilityEffect page says it was renamed, and the old URL redirects to the new page.
18625de to
c9e27b9
Compare
Overview
Closes #541
usePageVisibilityEffect. It has the same signature and behavior asuseVisibilityEvent, and its name pairs withusePageVisibilitythe wayuseOutsideClickEffectnames an effect hook.useVisibilityEventis now a deprecated alias ofusePageVisibilityEffect. It is the same function, so existing calls keep working, and editors show it as deprecated.useImpressionRefand theusePageVisibilitydocs now point to the new name, and so does the Common needs table in the agent skill.Stacked on #545, which adds the tooling for deprecated exports. This PR targets that branch, so its diff shows only the changes for #541. Once #545 is merged, it is rebased onto
v1-base.Tests
The tests moved to
usePageVisibilityEffect.test.tsunchanged. One added test checks thatuseVisibilityEventis the same function, which also keeps the alias file covered.Checklist
yarn run fixto format and lint the code and docs? (yarn testpasses)yarn run test:coverageto make sure there is no uncovered line?