Mark fewer modules as circuit breakers - #98923
Draft
lukesandberg wants to merge 1 commit into
Draft
lukesandberg wants to merge 1 commit into
lukesandberg wants to merge 1 commit into
Conversation
lukesandberg
added this pull request to stack #98899
September 19, 2026 00:47
Contributor
Tests PassedCommit: a466b1a |
lukesandberg
force-pushed
the
fewer-circuit-breaker-modules
branch
from
September 19, 2026 00:47
bfd63dc to
a466b1a
Compare
lukesandberg
commented
Sep 19, 2026
| // Only the modules that can be read before they finish evaluating need to break | ||
| // the cycle. The rest are fully evaluated by the time anything reads them, so they | ||
| // can keep exporting values instead of getters. | ||
| export_circuit_breakers.extend(cycle.partially_observable.iter().map(|n| **n)); |
Contributor
Author
There was a problem hiding this comment.
partialily_observable makes sense as a name for this usecase but not for the graph traversal
back_edge_targets still seems correct
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
To preserve semantics, when generating exports for ESM modules that have cyclic dependencies we need to find a way to break the cycle using early bound 'getter' exports.
Currently the semantics are conservative, all modules in a cycle are tagged as breakers. This PR changes that to instead only mark cycle entry points and 'back edges' as circuit breakers. This increases the scope for other ESM optimizations