[pull] main from mobxjs:main - #64
Merged
Merged
Conversation
Bumps [changesets/action](https://github.com/changesets/action) from 1.9.0 to 2.1.0. - [Release notes](https://github.com/changesets/action/releases) - [Changelog](https://github.com/changesets/action/blob/main/CHANGELOG.md) - [Commits](changesets/action@v1.9.0...v2.1.0) --- updated-dependencies: - dependency-name: changesets/action dependency-version: 2.1.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…dered component tree and its transitive closures] (#4689) subscribe/getSnapshot were created inside useObserver's first invocation and shared that invocation's closure context with the reaction.track callback's captures (render, renderResult). Since useSyncExternalStore holds subscribe for as long as the component is mounted, the element tree returned by the first render (and every fiber and DOM node reachable from it) could never be garbage collected. Create the administration object in a module-level factory instead, so subscribe/getSnapshot close over nothing render-related.
…onBecomeUnobserved (#4684) * Fix stack overflow in endBatch() when disposing a Reaction from onBecomeUnobserved endBatch()'s pendingUnobservations drain loop calls onBUO() per observable, which can dispose a Reaction (a common pattern). Reaction.dispose() calls startBatch()/endBatch() again, and since inBatch is already back at 0 at that point, the nested endBatch() recursed into the same drain loop instead of returning, unlike runReactions() which already guards against this exact kind of reentrancy with isRunningReactions. For long enough chains of onBecomeUnobserved handlers disposing reactions, this recursion overflowed the stack (issue #3954). Add an analogous isRunningUnobservations guard: a nested endBatch() call now just returns, and the already-running outer loop picks up anything a nested dispose() pushes onto pendingUnobservations because it re-reads list.length on every iteration. * Address review feedback: release isRunningUnobservations via try/finally If an onBecomeUnobserved handler threw, the guard flag never got reset, permanently disabling pendingUnobservations draining for the rest of the process. Wrap the drain in try/finally so it releases regardless of how the block exits; pendingUnobservations itself is only cleared on the success path, unchanged from before this fix, so a thrown exception still leaves the array for a later pass to pick back up. Added a regression test: a handler that throws still surfaces the error, and a second, unrelated disposal right after still fires its own handler instead of silently no-oping forever.
…rved atoms (#4682) Co-authored-by: Michel Weststrate <mweststrate@gmail.com>
…4681) union, intersection and symmetricDifference delegated to the argument when it was a plain Set, so results came out in the argument's order instead of the receiver's. Build every result from the receiver, as difference/isSubsetOf/isSupersetOf already do, to match native Set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )