Repository navigation
Conversation
Snapping to a node starts a 500ms d3 zoom transition that was not interrupted on dispose. If the tree visualizer is destroyed mid-transition, d3-zoom keeps reading the size of the now detached SVG and throws `NotSupportedError: Failed to read the 'value' property from 'SVGLength'`. Interrupt any running transition in `dispose()`. Tested with the router tree spec running zoneless (next commit), which fails with the error above without this change.
Remove `provideZoneChangeDetection()` from the router tree spec and replace `fixture.detectChanges()` with `await fixture.whenStable()`. With zones, the single `detectChanges()` never ran the visualizer's render effect, so the tree was never drawn. Running zoneless now covers rendering and the initial snap to root, which relies on the previous fix. Tested with `pnpm bazel test //devtools/projects/ng-devtools/src/lib/devtools-tabs/router-tree:test_chromium`.
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.
What is the current behavior?
Snapping to a node in the tree visualizer starts a 500ms d3 zoom transition that is not interrupted on
dispose(). If the visualizer is destroyed mid-transition, d3-zoom keeps reading the size of the detached SVG and throws:The router tree spec ran with
provideZoneChangeDetection()(with a TODO to migrate), and its singlefixture.detectChanges()never ran the visualizer's render effect, so the tree was never drawn and this path was not covered.Issue Number: N/A
What is the new behavior?
Two commits:
fix(devtools): interrupt any running transition inTreeVisualizer.dispose().refactor(devtools): run the router tree spec zoneless (removeprovideZoneChangeDetection()and the TODO, replacefixture.detectChanges()withawait fixture.whenStable()). The tree is now rendered and snapped to the root, which fails with the error above without the first commit.