-
Notifications
You must be signed in to change notification settings - Fork 67
Handle large collections in Debugger #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lydell
wants to merge
2
commits into
elm:master
Choose a base branch
from
lydell:fix-debugger-large-collections
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Large collections, like lists with thousands of items, either cause the debugger and the whole application to be very slow, or crash with a stack overflow. Closes elm/compiler#2133 Closes elm#90 Closes elm#104 Closes elm#132 Closes elm#120. That’s a previous PR that touched on this problem. That PR makes the experience go from crashing to awfully slow. This PR is fast even with big collections, by expanding just the first 100 items. There’s a “view more” button to show the next 100. I went with the simplest possible UX around that, since it’s unclear if anyone actually tries to click to item number 9000 – at that point, search is better. And then you could just as well do the search with Elm code and `Debug.log` rather than using some obscure search syntax in the debugger. I think looking at the model in the debugger is more for learning the overall structure of an app, than to look at every single item of long lists, sets or dicts.
|
Applying this fix seems to crash the debugger? I got an error: This was applying it on top of previous PRs in the elm-janitor/browser fork, and there was a merge conflict that needed to be resolved with, I believe, #142 |
Author
|
Most likely a mistake in the merge conflict resolution then. I use this via the |
ahankinson
added a commit
to elm-janitor/browser
that referenced
this pull request
Nov 21, 2025
fixes elm#145 # Conflicts: # src/Elm/Kernel/Debugger.js
ahankinson
added a commit
to elm-janitor/browser
that referenced
this pull request
Nov 21, 2025
fixes elm#145 # Conflicts: # src/Elm/Kernel/Debugger.js
ahankinson
added a commit
to elm-janitor/browser
that referenced
this pull request
Nov 21, 2025
fixes elm#145 # Conflicts: # src/Elm/Kernel/Debugger.js
ahankinson
added a commit
to elm-janitor/browser
that referenced
this pull request
Nov 23, 2025
fixes elm#145 # Conflicts: # src/Elm/Kernel/Debugger.js
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.
Large collections, like lists with thousands of items, either cause the debugger and the whole application to be very slow, or crash with a stack overflow.
Closes elm/compiler#2133
Closes #90
Closes #104
Closes #132
Closes #120. That’s a previous PR that touched on this problem. That PR makes a function tail call recursive to avoid crashing, but the slowness remains.
This PR is fast even with big collections, by expanding just the first 100 items. There’s a “view more” button to show the next 100. I went with the simplest possible UX around that, since it’s unclear if anyone actually tries to click to item number 9000 – at that point, search is better. And then you could just as well do the search with Elm code and
Debug.lograther than using some obscure search syntax in the debugger. I think looking at the model in the debugger is more for learning the overall structure of an app, than to look at every single item of long lists, sets or dicts.Note to those following along: This PR is included in https://github.com/lydell/browser/tree/safe, which is part of https://github.com/lydell/elm-safe-virtual-dom, but it has nothing to do with “safe virtual DOM” really, it’s just in there because it’s convenient.