diff --git a/.changeset/active-query-work.md b/.changeset/active-query-work.md deleted file mode 100644 index eeef2b2..0000000 --- a/.changeset/active-query-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard-tanstack": minor ---- - -Block query initial loading only while pending and actively fetching. Disabled idle and offline paused queries no longer block by default across single, infinite, and collection hooks. Background refetch and pagination blocking remain opt-in, and mutation pending behavior is unchanged. See the TanStack README migration guidance for workflows that previously relied on pending queries without active work. diff --git a/.changeset/async-execution-onboarding.md b/.changeset/async-execution-onboarding.md deleted file mode 100644 index 4258d1e..0000000 --- a/.changeset/async-execution-onboarding.md +++ /dev/null @@ -1,6 +0,0 @@ ---- ---- - -Clarify async tracking, blocker timeout, cleanup, and application-owned cancellation -in onboarding documentation. Add public-hook lifetime tests without changing runtime -behavior or public APIs; no package release is required. diff --git a/.changeset/bold-beers-accept.md b/.changeset/bold-beers-accept.md deleted file mode 100644 index a845151..0000000 --- a/.changeset/bold-beers-accept.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.changeset/bright-blockers-live.md b/.changeset/bright-blockers-live.md deleted file mode 100644 index 4b349d9..0000000 --- a/.changeset/bright-blockers-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": minor ---- - -Introduce a public Blocking lifecycle interface that owns blocker transitions, timers, immutable reads, and isolated observation while preserving the existing Zustand store interface through a compatibility adapter. diff --git a/.changeset/bright-scopes-align.md b/.changeset/bright-scopes-align.md deleted file mode 100644 index d493911..0000000 --- a/.changeset/bright-scopes-align.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch -"@okyrychenko-dev/react-action-guard-ui": patch ---- - -Centralize scope normalization, inheritance, observation, and targeted-clear semantics in the core package, preserve empty observed scopes, and migrate guarded UI controls to use the shared behavior. The UI package now requires the core release that exports these helpers. diff --git a/.changeset/browser-history-verification.md b/.changeset/browser-history-verification.md deleted file mode 100644 index da09aaa..0000000 --- a/.changeset/browser-history-verification.md +++ /dev/null @@ -1,6 +0,0 @@ ---- ---- - -Add real-browser TanStack back/forward confirmation tests, CI verification, and -versioned evidence. This is test and documentation infrastructure with no public -runtime behavior change, so no package release is required. diff --git a/.changeset/calm-tools-migrate.md b/.changeset/calm-tools-migrate.md deleted file mode 100644 index 6f599c6..0000000 --- a/.changeset/calm-tools-migrate.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch -"@okyrychenko-dev/react-action-guard-devtools": patch ---- - -Migrate the Core and Devtools store integrations to `@okyrychenko-dev/react-zustand-toolkit` 1.0.0 while preserving React Action Guard's public store and provider APIs. diff --git a/.changeset/clean-blockers-publish.md b/.changeset/clean-blockers-publish.md deleted file mode 100644 index ce9c2bc..0000000 --- a/.changeset/clean-blockers-publish.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": minor -"@okyrychenko-dev/react-action-guard-devtools": minor -"@okyrychenko-dev/react-action-guard-ui": patch ---- - -Publish immutable Blocking lifecycle snapshots through global and provider-scoped stores. React hooks, guarded UI controls, and Devtools now subscribe to those snapshots. Devtools requires core 1.1.0 or newer for the snapshot API. This compatibility drop, together with the Node.js 20 minimum in the pending type-utils migration, releases Devtools as 0.4.0 instead of a 0.3.x patch. diff --git a/.changeset/deep-guards-contract.md b/.changeset/deep-guards-contract.md deleted file mode 100644 index edac2de..0000000 --- a/.changeset/deep-guards-contract.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": major -"@okyrychenko-dev/react-action-guard-devtools": major -"@okyrychenko-dev/react-action-guard-ui": patch -"@okyrychenko-dev/react-action-guard-tanstack": patch -"@okyrychenko-dev/react-action-guard-router": patch ---- - -Complete the Blocking lifecycle architecture migration. Remove mutable blocker and middleware maps, -named middleware registration, direct event dispatch, and compatibility restore contracts. Observe -lifecycle transitions through ownership-safe anonymous leases and read readonly BlockerInfo snapshots. -Devtools sessions release only their observations; manual observation is now additive on every store. -Centralize guarded-control state and accessible reasons while retaining public hooks, state mappers, -state utilities, and distinct link behavior. Consolidate shared TanStack coverage at its coordination -interface and document migration from removed interfaces. Retain react-zustand-toolkit as the state -management base. diff --git a/.changeset/duplicate-hook-diagnostics.md b/.changeset/duplicate-hook-diagnostics.md deleted file mode 100644 index 1b62799..0000000 --- a/.changeset/duplicate-hook-diagnostics.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch ---- - -Warn in development when active useActionBlocker hooks share an ID in the same store. Track registrations through cleanup and Strict Mode without warning for equal IDs in isolated stores. Shared IDs still require consumer correction; production registration and cleanup behavior is unchanged. diff --git a/.changeset/empty-peer-install-config.md b/.changeset/empty-peer-install-config.md deleted file mode 100644 index ec380ec..0000000 --- a/.changeset/empty-peer-install-config.md +++ /dev/null @@ -1,3 +0,0 @@ ---- ---- - diff --git a/.changeset/four-lands-smash.md b/.changeset/four-lands-smash.md deleted file mode 100644 index 6e10bf9..0000000 --- a/.changeset/four-lands-smash.md +++ /dev/null @@ -1,4 +0,0 @@ ---- ---- - -Centralize shared tooling configuration without changing published package behavior. diff --git a/.changeset/frozen-normalized-scopes.md b/.changeset/frozen-normalized-scopes.md deleted file mode 100644 index 1dd3c1b..0000000 --- a/.changeset/frozen-normalized-scopes.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch ---- - -Freeze normalized scope arrays so JavaScript mutation cannot corrupt cached results shared by other consumers. Stable identity, sorting, deduplication, default and empty scope semantics, and bounded cache eviction are preserved. diff --git a/.changeset/fuzzy-dingos-match.md b/.changeset/fuzzy-dingos-match.md deleted file mode 100644 index e4af3a6..0000000 --- a/.changeset/fuzzy-dingos-match.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch ---- - -Treat array-form global blocker scopes consistently across store scope queries and targeted clears. diff --git a/.changeset/gentle-stores-resolve.md b/.changeset/gentle-stores-resolve.md deleted file mode 100644 index 9563643..0000000 --- a/.changeset/gentle-stores-resolve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard-tanstack": patch ---- - -Route TanStack blocking hooks through the nearest `UIBlockingProvider` store while preserving the global-store fallback when no provider is present. diff --git a/.changeset/native-tanstack-navigation.md b/.changeset/native-tanstack-navigation.md deleted file mode 100644 index 8f6456c..0000000 --- a/.changeset/native-tanstack-navigation.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard-router": minor ---- - -Restore TanStack navigation blocking using native useBlocker. Confirmed transitions keep protection armed, failed confirmations deny navigation, and superseded or unmounted attempts cannot allow navigation. Require TanStack Router >=1.170.41 within v1, the verified compatibility floor, and use native unload protection with a one-shot bypass after accepted document navigation, avoiding a duplicate browser prompt. - -Invalidate pending confirmations when when or scope changes, including replacements that leave the computed blocking state active. - -Preserve pending confirmations when observer callbacks onBlock or onAllow change during a rerender. - -Compare scopes by normalized contents so equivalent arrays, including reordered or duplicated entries, preserve pending confirmations while effective scope changes invalidate them. - -Document and test the native not-found limitation at TanStack Router 1.170.41: unmatched-to-matched navigation skips adapter callbacks even with an active condition or scope; subsequent matched-route navigation remains guarded. diff --git a/.changeset/packed-public-compatibility.md b/.changeset/packed-public-compatibility.md deleted file mode 100644 index a6fa4a4..0000000 --- a/.changeset/packed-public-compatibility.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch -"@okyrychenko-dev/react-action-guard-ui": patch -"@okyrychenko-dev/react-action-guard-devtools": patch -"@okyrychenko-dev/react-action-guard-tanstack": patch -"@okyrychenko-dev/react-action-guard-router": minor ---- - -Publish format-specific ESM and CommonJS declarations so NodeNext CommonJS consumers can use the supported public imports. Correct Core's legacy main/module paths and resolve Next's router.js entry so native Node ESM can load the Next adapter. Require React Router DOM >=6.19.0 within v6 or v7 because earlier v6 releases do not export the stable useBlocker API. This excludes previously declared unsupported versions and releases the pre-1.0 router package as a minor change. Consumers on older v6 must upgrade before adopting this release; no new runtime dependency is added. Publish evidence-labelled capabilities and packed peer/provider checks, and clarify App Router and application-owned payment cancellation limits. diff --git a/.changeset/publication-evidence-parity.md b/.changeset/publication-evidence-parity.md deleted file mode 100644 index 6b2a0cf..0000000 --- a/.changeset/publication-evidence-parity.md +++ /dev/null @@ -1,4 +0,0 @@ ---- ---- - -Add publication checks using publint and Are the Types Wrong?, measured bundles and import-side-effect probes, and strict peer installation of a disposable workspace versioned with the real pending Changesets. Run them in CI and before release. This is private test/release infrastructure with no public runtime or API change, so no package version bump is required. diff --git a/.changeset/quiet-queries-coordinate.md b/.changeset/quiet-queries-coordinate.md deleted file mode 100644 index 12bfe64..0000000 --- a/.changeset/quiet-queries-coordinate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard-tanstack": patch ---- - -Centralize blocking state policy, reasons, instance identity, provider store resolution, and blocker cleanup across TanStack hooks. Use the shared type-utils toolset for reason selection. Consolidate public hook configuration and behavior documentation in the package README. diff --git a/.changeset/quiet-tools-observe.md b/.changeset/quiet-tools-observe.md deleted file mode 100644 index 5228f30..0000000 --- a/.changeset/quiet-tools-observe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard-devtools": patch ---- - -Isolate Devtools event history and runtime viewing state per observed blocking store, share one observation session between Devtools instances attached to the same store, and expose custom sessions to advanced hook consumers through `ActionGuardDevtoolsProvider`. diff --git a/.changeset/reactive-blocker-config.md b/.changeset/reactive-blocker-config.md deleted file mode 100644 index 0dbb79f..0000000 --- a/.changeset/reactive-blocker-config.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch -"@okyrychenko-dev/react-action-guard-tanstack": patch ---- - -Apply current reactive blocker configuration in core and TanStack hooks. Removed -scope, reason and priority values return to defaults; omitted timeout and callback -values clear. Metadata changes preserve unchanged deadlines and registration -timestamps, while changed timeouts restart and removed timeouts cancel timers. -Imperative updateBlocker patch behavior remains compatible. Consumers relying on -retained hook options must keep those options in the current configuration. -TanStack integration now requires core 1.0.6 or later for replacement support. diff --git a/.changeset/real-dogs-jog.md b/.changeset/real-dogs-jog.md deleted file mode 100644 index be13c66..0000000 --- a/.changeset/real-dogs-jog.md +++ /dev/null @@ -1,6 +0,0 @@ ---- ---- - -Monorepo restructuring only (repo layout, tooling, docs). No package's published -output changed — verified via `npm pack --dry-run` diff against each package's -pre-migration tarball. No version bump needed. diff --git a/.changeset/settled-custom-dialogs.md b/.changeset/settled-custom-dialogs.md deleted file mode 100644 index 0bb1690..0000000 --- a/.changeset/settled-custom-dialogs.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard-router": patch ---- - -Settle pending custom confirmation dialogs as false on effect teardown, including unmount and hiding a preserved React Activity subtree. Clear preserved dialog state so it cannot reappear after effects reconnect. Dialog-specific resolvers now close their own dialog exactly once and cannot affect a replacement dialog. Stable hook-level controls continue to act on the current dialog. diff --git a/.changeset/single-flight-confirmation.md b/.changeset/single-flight-confirmation.md deleted file mode 100644 index b76181c..0000000 --- a/.changeset/single-flight-confirmation.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch ---- - -Prevent repeated confirmation calls from executing the same action more than once per hook -instance. Concurrent callers share its outcome; reopening and cancellation are ignored while -execution is pending. Success and failure both allow retry. Existing timeout and unmount -behavior remains unchanged. diff --git a/.changeset/slick-eggs-mix.md b/.changeset/slick-eggs-mix.md deleted file mode 100644 index a845151..0000000 --- a/.changeset/slick-eggs-mix.md +++ /dev/null @@ -1,2 +0,0 @@ ---- ---- diff --git a/.changeset/small-dogs-observe.md b/.changeset/small-dogs-observe.md deleted file mode 100644 index d0cf4af..0000000 --- a/.changeset/small-dogs-observe.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": minor -"@okyrychenko-dev/react-action-guard-devtools": patch ---- - -Expose anonymous, ownership-safe lifecycle event observation through global and provider-scoped stores. Provider middleware and automatic Devtools observation now use release leases without registry names, while legacy named middleware remains available for compatibility and runs without awaiting earlier observers. - -Observers registered while an event is being delivered begin receiving events with the next delivery, preventing self-replacing named middleware from processing the same event twice. - -Observers released before their turn in an event are skipped, and replacing named middleware keeps its original delivery position. - -Named middleware replacements made during an event take effect on the next event. Direct compatibility calls to `runMiddlewares` invoke middleware concurrently and settle after all complete. - -Global Devtools observation keeps the current event when manual Devtools middleware registers during delivery, while manual registrations already participating in that event remain authoritative, even if they unregister themselves after handling it. diff --git a/.changeset/steady-sessions-observe.md b/.changeset/steady-sessions-observe.md deleted file mode 100644 index da03c77..0000000 --- a/.changeset/steady-sessions-observe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard-devtools": patch ---- - -Manage Devtools observation through store-specific participation leases. Panels and providers observing the same blocking store share one event history and automatic observer; configuration ownership transfers deterministically without reapplying `defaultOpen`, and the final release detaches observation and clears runtime viewing state. Manual Devtools middleware remains compatible. diff --git a/.changeset/tidy-wombats-listen.md b/.changeset/tidy-wombats-listen.md deleted file mode 100644 index 6b827db..0000000 --- a/.changeset/tidy-wombats-listen.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@okyrychenko-dev/react-action-guard": patch -"@okyrychenko-dev/react-action-guard-devtools": patch -"@okyrychenko-dev/react-action-guard-router": patch -"@okyrychenko-dev/react-action-guard-ui": patch ---- - -Adopt `@okyrychenko-dev/type-utils` 0.1.2 for internal type guards, assertions, and utility types, replacing equivalent hand-rolled checks, a duplicated `assertNever` helper, and inline nullable/optional unions. Runtime behavior is unchanged; some public function signatures now show the package's equivalent utility types. Adds `@okyrychenko-dev/type-utils` as a new dependency and explicitly requires Node.js 20 or newer; Node.js 18 is EOL and unsupported. diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 601c066..f0f7229 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,53 @@ # Changelog +## 2.0.0 + +### Major Changes + +- 0d3c1f7: Complete the Blocking lifecycle architecture migration. Remove mutable blocker and middleware maps, + named middleware registration, direct event dispatch, and compatibility restore contracts. Observe + lifecycle transitions through ownership-safe anonymous leases and read readonly BlockerInfo snapshots. + Devtools sessions release only their observations; manual observation is now additive on every store. + Centralize guarded-control state and accessible reasons while retaining public hooks, state mappers, + state utilities, and distinct link behavior. Consolidate shared TanStack coverage at its coordination + interface and document migration from removed interfaces. Retain react-zustand-toolkit as the state + management base. + +### Minor Changes + +- 39fb3de: Introduce a public Blocking lifecycle interface that owns blocker transitions, timers, immutable reads, and isolated observation while preserving the existing Zustand store interface through a compatibility adapter. +- 3db526a: Publish immutable Blocking lifecycle snapshots through global and provider-scoped stores. React hooks, guarded UI controls, and Devtools now subscribe to those snapshots. Devtools requires core 1.1.0 or newer for the snapshot API. This compatibility drop, together with the Node.js 20 minimum in the pending type-utils migration, releases Devtools as 0.4.0 instead of a 0.3.x patch. +- 4363609: Expose anonymous, ownership-safe lifecycle event observation through global and provider-scoped stores. Provider middleware and automatic Devtools observation now use release leases without registry names, while legacy named middleware remains available for compatibility and runs without awaiting earlier observers. + + Observers registered while an event is being delivered begin receiving events with the next delivery, preventing self-replacing named middleware from processing the same event twice. + + Observers released before their turn in an event are skipped, and replacing named middleware keeps its original delivery position. + + Named middleware replacements made during an event take effect on the next event. Direct compatibility calls to `runMiddlewares` invoke middleware concurrently and settle after all complete. + + Global Devtools observation keeps the current event when manual Devtools middleware registers during delivery, while manual registrations already participating in that event remain authoritative, even if they unregister themselves after handling it. + +### Patch Changes + +- 32264e4: Centralize scope normalization, inheritance, observation, and targeted-clear semantics in the core package, preserve empty observed scopes, and migrate guarded UI controls to use the shared behavior. The UI package now requires the core release that exports these helpers. +- 5d403d8: Migrate the Core and Devtools store integrations to `@okyrychenko-dev/react-zustand-toolkit` 1.0.0 while preserving React Action Guard's public store and provider APIs. +- 083a5b7: Warn in development when active useActionBlocker hooks share an ID in the same store. Track registrations through cleanup and Strict Mode without warning for equal IDs in isolated stores. Shared IDs still require consumer correction; production registration and cleanup behavior is unchanged. +- a1b83db: Freeze normalized scope arrays so JavaScript mutation cannot corrupt cached results shared by other consumers. Stable identity, sorting, deduplication, default and empty scope semantics, and bounded cache eviction are preserved. +- d07b65a: Treat array-form global blocker scopes consistently across store scope queries and targeted clears. +- bd1dc3b: Publish format-specific ESM and CommonJS declarations so NodeNext CommonJS consumers can use the supported public imports. Correct Core's legacy main/module paths and resolve Next's router.js entry so native Node ESM can load the Next adapter. Require React Router DOM >=6.19.0 within v6 or v7 because earlier v6 releases do not export the stable useBlocker API. This excludes previously declared unsupported versions and releases the pre-1.0 router package as a minor change. Consumers on older v6 must upgrade before adopting this release; no new runtime dependency is added. Publish evidence-labelled capabilities and packed peer/provider checks, and clarify App Router and application-owned payment cancellation limits. +- 6513e1e: Apply current reactive blocker configuration in core and TanStack hooks. Removed + scope, reason and priority values return to defaults; omitted timeout and callback + values clear. Metadata changes preserve unchanged deadlines and registration + timestamps, while changed timeouts restart and removed timeouts cancel timers. + Imperative updateBlocker patch behavior remains compatible. Consumers relying on + retained hook options must keep those options in the current configuration. + TanStack integration now requires core 1.0.6 or later for replacement support. +- eefba30: Prevent repeated confirmation calls from executing the same action more than once per hook + instance. Concurrent callers share its outcome; reopening and cancellation are ignored while + execution is pending. Success and failure both allow retry. Existing timeout and unmount + behavior remains unchanged. +- 6230733: Adopt `@okyrychenko-dev/type-utils` 0.1.2 for internal type guards, assertions, and utility types, replacing equivalent hand-rolled checks, a duplicated `assertNever` helper, and inline nullable/optional unions. Runtime behavior is unchanged; some public function signatures now show the package's equivalent utility types. Adds `@okyrychenko-dev/type-utils` as a new dependency and explicitly requires Node.js 20 or newer; Node.js 18 is EOL and unsupported. + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), diff --git a/packages/core/package.json b/packages/core/package.json index e62b347..a94cbad 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@okyrychenko-dev/react-action-guard", - "version": "1.0.5", + "version": "2.0.0", "type": "module", "description": "Coordinate shared UI interaction locks across complex React forms and workflows", "engines": { diff --git a/packages/devtools/CHANGELOG.md b/packages/devtools/CHANGELOG.md index 12b21ad..0d28d0f 100644 --- a/packages/devtools/CHANGELOG.md +++ b/packages/devtools/CHANGELOG.md @@ -1,5 +1,54 @@ # Changelog +## 1.0.0 + +### Major Changes + +- 0d3c1f7: Complete the Blocking lifecycle architecture migration. Remove mutable blocker and middleware maps, + named middleware registration, direct event dispatch, and compatibility restore contracts. Observe + lifecycle transitions through ownership-safe anonymous leases and read readonly BlockerInfo snapshots. + Devtools sessions release only their observations; manual observation is now additive on every store. + Centralize guarded-control state and accessible reasons while retaining public hooks, state mappers, + state utilities, and distinct link behavior. Consolidate shared TanStack coverage at its coordination + interface and document migration from removed interfaces. Retain react-zustand-toolkit as the state + management base. + +### Minor Changes + +- 3db526a: Publish immutable Blocking lifecycle snapshots through global and provider-scoped stores. React hooks, guarded UI controls, and Devtools now subscribe to those snapshots. Devtools requires core 1.1.0 or newer for the snapshot API. This compatibility drop, together with the Node.js 20 minimum in the pending type-utils migration, releases Devtools as 0.4.0 instead of a 0.3.x patch. + +### Patch Changes + +- 5d403d8: Migrate the Core and Devtools store integrations to `@okyrychenko-dev/react-zustand-toolkit` 1.0.0 while preserving React Action Guard's public store and provider APIs. +- bd1dc3b: Publish format-specific ESM and CommonJS declarations so NodeNext CommonJS consumers can use the supported public imports. Correct Core's legacy main/module paths and resolve Next's router.js entry so native Node ESM can load the Next adapter. Require React Router DOM >=6.19.0 within v6 or v7 because earlier v6 releases do not export the stable useBlocker API. This excludes previously declared unsupported versions and releases the pre-1.0 router package as a minor change. Consumers on older v6 must upgrade before adopting this release; no new runtime dependency is added. Publish evidence-labelled capabilities and packed peer/provider checks, and clarify App Router and application-owned payment cancellation limits. +- 94547ea: Isolate Devtools event history and runtime viewing state per observed blocking store, share one observation session between Devtools instances attached to the same store, and expose custom sessions to advanced hook consumers through `ActionGuardDevtoolsProvider`. +- 4363609: Expose anonymous, ownership-safe lifecycle event observation through global and provider-scoped stores. Provider middleware and automatic Devtools observation now use release leases without registry names, while legacy named middleware remains available for compatibility and runs without awaiting earlier observers. + + Observers registered while an event is being delivered begin receiving events with the next delivery, preventing self-replacing named middleware from processing the same event twice. + + Observers released before their turn in an event are skipped, and replacing named middleware keeps its original delivery position. + + Named middleware replacements made during an event take effect on the next event. Direct compatibility calls to `runMiddlewares` invoke middleware concurrently and settle after all complete. + + Global Devtools observation keeps the current event when manual Devtools middleware registers during delivery, while manual registrations already participating in that event remain authoritative, even if they unregister themselves after handling it. + +- 5d03641: Manage Devtools observation through store-specific participation leases. Panels and providers observing the same blocking store share one event history and automatic observer; configuration ownership transfers deterministically without reapplying `defaultOpen`, and the final release detaches observation and clears runtime viewing state. Manual Devtools middleware remains compatible. +- 6230733: Adopt `@okyrychenko-dev/type-utils` 0.1.2 for internal type guards, assertions, and utility types, replacing equivalent hand-rolled checks, a duplicated `assertNever` helper, and inline nullable/optional unions. Runtime behavior is unchanged; some public function signatures now show the package's equivalent utility types. Adds `@okyrychenko-dev/type-utils` as a new dependency and explicitly requires Node.js 20 or newer; Node.js 18 is EOL and unsupported. +- Updated dependencies [39fb3de] +- Updated dependencies [32264e4] +- Updated dependencies [5d403d8] +- Updated dependencies [3db526a] +- Updated dependencies [0d3c1f7] +- Updated dependencies [083a5b7] +- Updated dependencies [a1b83db] +- Updated dependencies [d07b65a] +- Updated dependencies [bd1dc3b] +- Updated dependencies [6513e1e] +- Updated dependencies [eefba30] +- Updated dependencies [4363609] +- Updated dependencies [6230733] + - @okyrychenko-dev/react-action-guard@2.0.0 + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), diff --git a/packages/devtools/package.json b/packages/devtools/package.json index 79656c7..4d5efda 100644 --- a/packages/devtools/package.json +++ b/packages/devtools/package.json @@ -1,6 +1,6 @@ { "name": "@okyrychenko-dev/react-action-guard-devtools", - "version": "0.3.0", + "version": "1.0.0", "type": "module", "description": "Developer tools for @okyrychenko-dev/react-action-guard", "engines": { @@ -71,7 +71,7 @@ "access": "public" }, "peerDependencies": { - "@okyrychenko-dev/react-action-guard": "^1.1.0", + "@okyrychenko-dev/react-action-guard": "^2.0.0", "react": "^18.0.0 || ^19.0.0", "zustand": "^5.0.0" }, diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index cc4ddca..0ad36b5 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -1,5 +1,48 @@ # Changelog +## 1.0.0 + +### Minor Changes + +- b4945b0: Restore TanStack navigation blocking using native useBlocker. Confirmed transitions keep protection armed, failed confirmations deny navigation, and superseded or unmounted attempts cannot allow navigation. Require TanStack Router >=1.170.41 within v1, the verified compatibility floor, and use native unload protection with a one-shot bypass after accepted document navigation, avoiding a duplicate browser prompt. + + Invalidate pending confirmations when when or scope changes, including replacements that leave the computed blocking state active. + + Preserve pending confirmations when observer callbacks onBlock or onAllow change during a rerender. + + Compare scopes by normalized contents so equivalent arrays, including reordered or duplicated entries, preserve pending confirmations while effective scope changes invalidate them. + + Document and test the native not-found limitation at TanStack Router 1.170.41: unmatched-to-matched navigation skips adapter callbacks even with an active condition or scope; subsequent matched-route navigation remains guarded. + +- bd1dc3b: Publish format-specific ESM and CommonJS declarations so NodeNext CommonJS consumers can use the supported public imports. Correct Core's legacy main/module paths and resolve Next's router.js entry so native Node ESM can load the Next adapter. Require React Router DOM >=6.19.0 within v6 or v7 because earlier v6 releases do not export the stable useBlocker API. This excludes previously declared unsupported versions and releases the pre-1.0 router package as a minor change. Consumers on older v6 must upgrade before adopting this release; no new runtime dependency is added. Publish evidence-labelled capabilities and packed peer/provider checks, and clarify App Router and application-owned payment cancellation limits. + +### Patch Changes + +- 0d3c1f7: Complete the Blocking lifecycle architecture migration. Remove mutable blocker and middleware maps, + named middleware registration, direct event dispatch, and compatibility restore contracts. Observe + lifecycle transitions through ownership-safe anonymous leases and read readonly BlockerInfo snapshots. + Devtools sessions release only their observations; manual observation is now additive on every store. + Centralize guarded-control state and accessible reasons while retaining public hooks, state mappers, + state utilities, and distinct link behavior. Consolidate shared TanStack coverage at its coordination + interface and document migration from removed interfaces. Retain react-zustand-toolkit as the state + management base. +- 691ea3e: Settle pending custom confirmation dialogs as false on effect teardown, including unmount and hiding a preserved React Activity subtree. Clear preserved dialog state so it cannot reappear after effects reconnect. Dialog-specific resolvers now close their own dialog exactly once and cannot affect a replacement dialog. Stable hook-level controls continue to act on the current dialog. +- 6230733: Adopt `@okyrychenko-dev/type-utils` 0.1.2 for internal type guards, assertions, and utility types, replacing equivalent hand-rolled checks, a duplicated `assertNever` helper, and inline nullable/optional unions. Runtime behavior is unchanged; some public function signatures now show the package's equivalent utility types. Adds `@okyrychenko-dev/type-utils` as a new dependency and explicitly requires Node.js 20 or newer; Node.js 18 is EOL and unsupported. +- Updated dependencies [39fb3de] +- Updated dependencies [32264e4] +- Updated dependencies [5d403d8] +- Updated dependencies [3db526a] +- Updated dependencies [0d3c1f7] +- Updated dependencies [083a5b7] +- Updated dependencies [a1b83db] +- Updated dependencies [d07b65a] +- Updated dependencies [bd1dc3b] +- Updated dependencies [6513e1e] +- Updated dependencies [eefba30] +- Updated dependencies [4363609] +- Updated dependencies [6230733] + - @okyrychenko-dev/react-action-guard@2.0.0 + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), diff --git a/packages/router/package.json b/packages/router/package.json index a845b6b..9e232e7 100644 --- a/packages/router/package.json +++ b/packages/router/package.json @@ -1,6 +1,6 @@ { "name": "@okyrychenko-dev/react-action-guard-router", - "version": "0.2.4", + "version": "1.0.0", "type": "module", "description": "Navigation blocking adapters for React Action Guard across React Router, TanStack Router, and Next.js", "engines": { @@ -103,7 +103,7 @@ "access": "public" }, "peerDependencies": { - "@okyrychenko-dev/react-action-guard": "^1.0.4", + "@okyrychenko-dev/react-action-guard": "^2.0.0", "@tanstack/react-router": "^1.170.41", "next": "^13.4.0 || ^14.0.0 || ^15.0.0", "react": "^18.0.0 || ^19.0.0", diff --git a/packages/tanstack/CHANGELOG.md b/packages/tanstack/CHANGELOG.md index 0a16b9c..5f803a4 100644 --- a/packages/tanstack/CHANGELOG.md +++ b/packages/tanstack/CHANGELOG.md @@ -1,5 +1,46 @@ # Changelog +## 0.4.0 + +### Minor Changes + +- f75e05e: Block query initial loading only while pending and actively fetching. Disabled idle and offline paused queries no longer block by default across single, infinite, and collection hooks. Background refetch and pagination blocking remain opt-in, and mutation pending behavior is unchanged. See the TanStack README migration guidance for workflows that previously relied on pending queries without active work. + +### Patch Changes + +- 0d3c1f7: Complete the Blocking lifecycle architecture migration. Remove mutable blocker and middleware maps, + named middleware registration, direct event dispatch, and compatibility restore contracts. Observe + lifecycle transitions through ownership-safe anonymous leases and read readonly BlockerInfo snapshots. + Devtools sessions release only their observations; manual observation is now additive on every store. + Centralize guarded-control state and accessible reasons while retaining public hooks, state mappers, + state utilities, and distinct link behavior. Consolidate shared TanStack coverage at its coordination + interface and document migration from removed interfaces. Retain react-zustand-toolkit as the state + management base. +- 583ec47: Route TanStack blocking hooks through the nearest `UIBlockingProvider` store while preserving the global-store fallback when no provider is present. +- bd1dc3b: Publish format-specific ESM and CommonJS declarations so NodeNext CommonJS consumers can use the supported public imports. Correct Core's legacy main/module paths and resolve Next's router.js entry so native Node ESM can load the Next adapter. Require React Router DOM >=6.19.0 within v6 or v7 because earlier v6 releases do not export the stable useBlocker API. This excludes previously declared unsupported versions and releases the pre-1.0 router package as a minor change. Consumers on older v6 must upgrade before adopting this release; no new runtime dependency is added. Publish evidence-labelled capabilities and packed peer/provider checks, and clarify App Router and application-owned payment cancellation limits. +- b050190: Centralize blocking state policy, reasons, instance identity, provider store resolution, and blocker cleanup across TanStack hooks. Use the shared type-utils toolset for reason selection. Consolidate public hook configuration and behavior documentation in the package README. +- 6513e1e: Apply current reactive blocker configuration in core and TanStack hooks. Removed + scope, reason and priority values return to defaults; omitted timeout and callback + values clear. Metadata changes preserve unchanged deadlines and registration + timestamps, while changed timeouts restart and removed timeouts cancel timers. + Imperative updateBlocker patch behavior remains compatible. Consumers relying on + retained hook options must keep those options in the current configuration. + TanStack integration now requires core 1.0.6 or later for replacement support. +- Updated dependencies [39fb3de] +- Updated dependencies [32264e4] +- Updated dependencies [5d403d8] +- Updated dependencies [3db526a] +- Updated dependencies [0d3c1f7] +- Updated dependencies [083a5b7] +- Updated dependencies [a1b83db] +- Updated dependencies [d07b65a] +- Updated dependencies [bd1dc3b] +- Updated dependencies [6513e1e] +- Updated dependencies [eefba30] +- Updated dependencies [4363609] +- Updated dependencies [6230733] + - @okyrychenko-dev/react-action-guard@2.0.0 + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), diff --git a/packages/tanstack/package.json b/packages/tanstack/package.json index d57079c..203dd49 100644 --- a/packages/tanstack/package.json +++ b/packages/tanstack/package.json @@ -1,6 +1,6 @@ { "name": "@okyrychenko-dev/react-action-guard-tanstack", - "version": "0.3.5", + "version": "0.4.0", "type": "module", "description": "TanStack Query integration for React Action Guard - seamless UI blocking for queries and mutations", "main": "./dist/index.js", @@ -64,7 +64,7 @@ "access": "public" }, "peerDependencies": { - "@okyrychenko-dev/react-action-guard": "^1.0.6", + "@okyrychenko-dev/react-action-guard": "^2.0.0", "@tanstack/react-query": "^5.90.10", "react": "^18.0.0 || ^19.0.0" }, diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index e9fb89e..4ca193e 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## 1.0.0 + +### Patch Changes + +- 32264e4: Centralize scope normalization, inheritance, observation, and targeted-clear semantics in the core package, preserve empty observed scopes, and migrate guarded UI controls to use the shared behavior. The UI package now requires the core release that exports these helpers. +- 3db526a: Publish immutable Blocking lifecycle snapshots through global and provider-scoped stores. React hooks, guarded UI controls, and Devtools now subscribe to those snapshots. Devtools requires core 1.1.0 or newer for the snapshot API. This compatibility drop, together with the Node.js 20 minimum in the pending type-utils migration, releases Devtools as 0.4.0 instead of a 0.3.x patch. +- 0d3c1f7: Complete the Blocking lifecycle architecture migration. Remove mutable blocker and middleware maps, + named middleware registration, direct event dispatch, and compatibility restore contracts. Observe + lifecycle transitions through ownership-safe anonymous leases and read readonly BlockerInfo snapshots. + Devtools sessions release only their observations; manual observation is now additive on every store. + Centralize guarded-control state and accessible reasons while retaining public hooks, state mappers, + state utilities, and distinct link behavior. Consolidate shared TanStack coverage at its coordination + interface and document migration from removed interfaces. Retain react-zustand-toolkit as the state + management base. +- bd1dc3b: Publish format-specific ESM and CommonJS declarations so NodeNext CommonJS consumers can use the supported public imports. Correct Core's legacy main/module paths and resolve Next's router.js entry so native Node ESM can load the Next adapter. Require React Router DOM >=6.19.0 within v6 or v7 because earlier v6 releases do not export the stable useBlocker API. This excludes previously declared unsupported versions and releases the pre-1.0 router package as a minor change. Consumers on older v6 must upgrade before adopting this release; no new runtime dependency is added. Publish evidence-labelled capabilities and packed peer/provider checks, and clarify App Router and application-owned payment cancellation limits. +- 6230733: Adopt `@okyrychenko-dev/type-utils` 0.1.2 for internal type guards, assertions, and utility types, replacing equivalent hand-rolled checks, a duplicated `assertNever` helper, and inline nullable/optional unions. Runtime behavior is unchanged; some public function signatures now show the package's equivalent utility types. Adds `@okyrychenko-dev/type-utils` as a new dependency and explicitly requires Node.js 20 or newer; Node.js 18 is EOL and unsupported. +- Updated dependencies [39fb3de] +- Updated dependencies [32264e4] +- Updated dependencies [5d403d8] +- Updated dependencies [3db526a] +- Updated dependencies [0d3c1f7] +- Updated dependencies [083a5b7] +- Updated dependencies [a1b83db] +- Updated dependencies [d07b65a] +- Updated dependencies [bd1dc3b] +- Updated dependencies [6513e1e] +- Updated dependencies [eefba30] +- Updated dependencies [4363609] +- Updated dependencies [6230733] + - @okyrychenko-dev/react-action-guard@2.0.0 + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), diff --git a/packages/ui/package.json b/packages/ui/package.json index dc897e9..5701b21 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@okyrychenko-dev/react-action-guard-ui", - "version": "0.1.5", + "version": "1.0.0", "type": "module", "description": "UI-agnostic guarded control primitives for react-action-guard", "engines": {