feat: Add runtime errors overlay to show undefined nodes location#372
Open
GuiDevloper wants to merge 7 commits intonullstack:nextfrom
Open
feat: Add runtime errors overlay to show undefined nodes location#372GuiDevloper wants to merge 7 commits intonullstack:nextfrom
GuiDevloper wants to merge 7 commits intonullstack:nextfrom
Conversation
d875f43 to
7eae773
Compare
Member
Author
3b27991 changes:
|
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.

TL;DR:
UndefinedNodesOverlay-speed.mp4
Important notes
Two routes were added for when
environment.development === true(written inserver/devRoutes.js):/nullstack-dev-server/get-file?fileName=full/path/to/File.jsx&lineNumber=20&columnNumber=2:Returns the formatted
filepointing exactly where the undefined error happens and therelativePathto it (for showing purposes)./nullstack-dev-server/open-editor?fileName=full/path/to/File.jsx:20:2:Opens editor in that line/column using Evan You's
launch-editor.The default editor can be configured, I moved that possibility to a env variable
NULLSTACK_EDITORdefaulting to VSCode.Only works in development mode (when
__sourceobject is injected for every node by SWC & Babel), otherwise throws saying to retry that route in development mode to see the source of error.The errors are always cleared at every
generateTreecall, keeping it all updated at every rerender step.Throws became the last-case warning, only happening in production (
__source === undefined) or when the main component tries to render an undefined node itself, like: