Skip to content

V2.3.2 #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 8, 2025
Merged

V2.3.2 #108

merged 7 commits into from
Jul 8, 2025

Conversation

gadingnst
Copy link
Owner

PR Notes

Title: Feature & Refactor: React Native Support, Simplified Store, and Demo Enhancements

Description:
This pull request includes several updates to improve the library's functionality, developer experience, and cross-platform compatibility. Key changes include adding support for React Native, simplifying the store creation and mutation logic, and enhancing the demo application.

Changes:

  • Features:

    • React Native Support: The library is now compatible with React Native. The NodeJS.Timeout type has been replaced with the more generic ReturnType<typeof setTimeout> in utils.ts to ensure timers work correctly in a non-Node.js environment.
    • Demo Enhancements: A new test input page has been added to the demo application, along with navigation links to improve usability.
  • Refactoring:

    • The store creation and mutation logic in the core swr-global-state package has been simplified for better readability and maintainability.
  • Documentation:

    • Typos have been corrected and comments in the code and tests have been improved for clarity.

gadingnst added 6 commits July 8, 2025 10:42
refactor setState implementation to improve performance and prevent cursor jumps
add test input page to verify cursor behavior during rapid typing
update dependencies and add eslint disable comments where needed
Remove unnecessary type casting in mutate call
Simplify createStore function by removing initial parameter override
- Add new test input page with improved textarea input and styling
- Include navigation links to test input page from home and about pages
- Remove unnecessary state dependency from useStore hook
- Correct "untuk" to "for" in rate limit config comment
- Update Indonesian comments to English in test setup
- Remove redundant comment in useStore hook
- Update test wrapper component comment to English
Replace NodeJS.Timeout with ReturnType<typeof setTimeout> for better cross-environment compatibility
@gadingnst gadingnst self-assigned this Jul 8, 2025
Copy link

vercel bot commented Jul 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
swr-global-state-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 4:17am

Copy link

github-actions bot commented Jul 8, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 36.74% 97 / 264
🔵 Statements 36.74% 97 / 264
🔵 Functions 33.33% 3 / 9
🔵 Branches 58.82% 20 / 34
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/swr-global-state/src/lib/useStore.ts 66.66% 60.71% 100% 66.66% 75-93, 106-108, 110-115, 140-141, 145, 157, 175-182, 186-188
packages/swr-global-state/src/lib/utils.ts 4.28% 100% 0% 4.28% 21-34, 45-69, 80-121
Generated in workflow #239 for commit b10a798 by the Vitest Coverage Report Action

Copy link

github-actions bot commented Jul 8, 2025

size-limit report 📦

Path Size
dist/index.js 1.25 KB (+0.16% 🔺)
dist/swr-global-state.esm.js 1.33 KB (+0.23% 🔺)

The createStore function now accepts an optional initial value parameter that overrides the default initial value from StoreParams. This provides more flexibility when initializing store values.

Also updates package-lock.json with new @next/swc dependencies.
@gadingnst gadingnst merged commit 2cd4390 into main Jul 8, 2025
6 checks passed
@gadingnst gadingnst deleted the v2.3.2 branch July 8, 2025 04:37
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