You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v1.1.0: Add useAsyncMemoSuspense hook with implementation, tests, and documentation (#7)
* feat: add test suite with GitHub Actions workflow and React version compatibility tests
* feat: add cross-version React testing compatibility layer and fix type issues
* chore: add CodeRabbit config for main and develop branch reviews
* feat: add matrix testing across React 16-19 and Node 16-20 versions
* fix: add conditional testing library versions based on React version in CI workflow
* chore: add @testing-library/react dependency for React version compatibility
* test: add comprehensive test coverage for edge cases and error handling in useAsyncMemo and useAsyncEffekt
* chore: update Codecov action from v3 to v4
* add comment for any type usage
* chore: add strict error handling to matrix test script with set -euo pipefail
* fix: add error handling and exit codes to matrix test script
* style: improve readability of conditional npm install in Dockerfile.test
* chore: remove --force flag from npm install commands in test setup
* reset version to pre-release version
* fix: downgrade testing-library/react to v16.1.0 for React 19 test script
* fix: update test dependencies installation for different React versions in CI/Docker
* docs: add clickable links to README badges
* chore: add sideEffects:false to package.json for tree-shaking optimization
* feat: implement useAsyncMemoSuspense hook with global caching and dependency tracking
* feat(hooks): add docs and tests for useAsyncMemoSuspense
Adds JSDocs, README documentation, and tests for the new `useAsyncMemoSuspense` hook.
The documentation includes examples and important notes about SSR and client component usage.
The tests cover suspense, error handling, dependency changes, and scope usage.
* refactor: improve test coverage with TypeScript and realistic test scenarios
* test: improve timer handling and mock implementations in async memo tests
* ci: skip Suspense tests for React versions 16 and 17 in test workflow
* chore: update ErrorBoundary props type to use simplified React.PropsWithChildren syntax
* ci: exclude suspense module from test coverage collection for React 16/17
* chore: exclude test-utils.ts from code coverage metrics
* test: add comprehensive cache behavior and performance tests for useAsyncMemoSuspense
* docs: add vibe coded testing note in README
* refactor: removing unnecessary comments
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
-`scope?: string` - An optional scope to isolate the cache. This is useful when you have multiple instances of the hook with the same factory and dependencies but you want to keep their caches separate.
373
+
374
+
**Returns:**`T` - The memoized value. It suspends the component while the async operation is in progress.
375
+
376
+
**Important Notes:**
377
+
378
+
-**SSR Environments (e.g., Next.js):** In a server-side rendering environment, this hook will always return `undefined` on the server. The component will suspend on the client during hydration (not on initial render on the server). This means the suspense fallback will be displayed on hydration, and nothing will be displayed on the server-side render.
379
+
-**Client Component:** This hook must be used within a "client component" (e.g., in Next.js, the file must have the `"use client";` directive at the top).
380
+
-**Experimental:** This hook is experimental and its API might change in future versions.
0 commit comments