Skip to content

refactor: make millisecond units explicit in time parameter names - #552

Merged
hyesungoh merged 5 commits into
toss:v1-basefrom
Antoliny0919:issue-536
Oct 8, 2026
Merged

hyesungoh merged 5 commits into
toss:v1-basefrom
Antoliny0919:issue-536

Conversation

@Antoliny0919

Copy link
Copy Markdown
Contributor

Overview

Closes: #536

Add units to time related option names to make their meaning clearer.

Components

  • ImpressionArea: timeThreshold → timeThresholdMs

Hooks

  • useLongPress: delay → delayMs
  • useImpressionRef: delay → delayMs
  • useDebouncedCallback: timeThreshold → debounceMs
  • useDebounce: wait → debounceMs
  • useDebouncedValue: wait → debounceMs
  • useThrottle: wait → throttleMs
  • useThrottledValue: wait → throttleMs
  • useThrottledCallback: wait → throttleMs
  • useAvoidKeyboard: transitionDuration → transitionDurationMs
  • useTimeout: delay → delayMs

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b0d41c2

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

This PR includes changesets to release 1 package
Name Type
react-simplikit Major

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

@Antoliny0919

Copy link
Copy Markdown
Contributor Author

I think it would be helpful to have CI run against v1-base as well.

index cb92b28..861655c 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -2,11 +2,9 @@ name: Integration
 
 on:
   push:
-    branches:
-      - main
+    branches: [main, v1-base]
   pull_request:
-    branches:
-      - main
+    branches: [main, v1-base]
 
 jobs:
   quality:

How about adding the configuration above for now and removing it after the v1 migration?

@hyesungoh hyesungoh mentioned this pull request Oct 6, 2026
1 of 4 tasks
@hyesungoh

Copy link
Copy Markdown
Member

I think it would be helpful to have CI run against v1-base as well.

index cb92b28..861655c 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -2,11 +2,9 @@ name: Integration
 
 on:
   push:
-    branches:
-      - main
+    branches: [main, v1-base]
   pull_request:
-    branches:
-      - main
+    branches: [main, v1-base]
 
 jobs:
   quality:

How about adding the configuration above for now and removing it after the v1 migration?

great thought 👍 I will do this

@codecov-commenter

codecov-commenter commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c6511ef) to head (b0d41c2).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           v1-base      #552   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           71        71           
  Lines         2288      2288           
  Branches       735       735           
=========================================
  Hits          2288      2288           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Antoliny0919

Copy link
Copy Markdown
Contributor Author

Once this work is complete, please assign this issue to me! -> #538

@hyesungoh hyesungoh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks great! 👍 please check below comments 👍

Comment thread .changeset/deep-pandas-stare.md Outdated
'react-simplikit': major
---

Renamed time related options and parameters to include Ms, making their units clearer and naming more consistent.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about list up breacking changes? 🤔

Suggested change
Renamed time related options and parameters to include Ms, making their units clearer and naming more consistent.
Time-related options and parameters now include `Ms` in their names.
These option keys are renamed, so existing calls need to be updated:
- `useDebouncedCallback`: `timeThreshold` → `debounceMs`
- `useThrottledCallback`: `timeThreshold` → `throttleMs`
- `useImpressionRef`, `ImpressionArea`: `timeThreshold` → `timeThresholdMs`
- `useLongPress`: `delay` → `delayMs`
- `useAvoidKeyboard`: `transitionDuration` → `transitionDurationMs`
```ts
// before
useDebouncedCallback({ onChange: setQuery, timeThreshold: 300 });
// after
useDebouncedCallback({ onChange: setQuery, debounceMs: 300 });
```
The positional `wait` parameter of `useDebounce`, `useDebouncedValue`, `useThrottle` and `useThrottledValue` is now `debounceMs` / `throttleMs`. Calls like `useDebounce(fn, 300)` keep working.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I completely agree! 👍👍⭐️⭐️

@hyesungoh
hyesungoh merged commit d5a46be into toss:v1-base Oct 8, 2026
19 checks passed
@hyesungoh hyesungoh linked an issue Oct 8, 2026 that may be closed by this pull request
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.

Add useDebouncedState and useThrottledState

3 participants