-
Notifications
You must be signed in to change notification settings - Fork 159
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
Restore react-router error handling #5682
Conversation
originalMethod(...args) | ||
|
||
// If the first part of the log line is a string | ||
const firstLine = args[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously we would use console-feed
to parse, then encode, then decode (?) the args
(https://github.com/concrete-utopia/utopia/pull/5676/files#diff-e3967556a9487a929c1e232412b7704ffd6fb9d427e4722eb2cb2322963f7c56L55-L57), which creates an object used by that library. We would then check the data
field of that object, which is just the args
array (https://github.com/concrete-utopia/utopia/pull/5676/files#diff-a4c8338855ca2b6cba1cde108cc950253be1063727a563185098bbd573c2bea7L134-L145). So since we no longer need to proxy to a console pane, we don't need to do any of that, and can just check the args
directly.
#12469 Bundle Size — 62.15MiB (+0.03%).
Warning Bundle contains 52 duplicate packages – View duplicate packages Bundle metrics
|
Current #12469 |
Baseline #12464 |
|
---|---|---|
Initial JS | 45.21MiB (+0.04% ) |
45.19MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 21.31% |
21.91% |
Chunks | 31 |
31 |
Assets | 34 |
34 |
Modules | 4278 (+0.05% ) |
4276 |
Duplicate Modules | 511 (+0.39% ) |
509 |
Duplicate Code | 31.02% (+0.03% ) |
31.01% |
Packages | 449 |
449 |
Duplicate Packages | 52 |
52 |
Bundle size by type 2 changes
1 regression
1 improvement
Current #12469 |
Baseline #12464 |
|
---|---|---|
JS | 62.14MiB (+0.03% ) |
62.12MiB |
HTML | 10.94KiB (-0.34% ) |
10.98KiB |
Bundle analysis report Branch fix/restore-react-router-error-h... Project dashboard
@@ -154,3 +154,62 @@ export function useErrorOverlayRecords(): ErrorOverlayRecords { | |||
|
|||
return { errorRecords, overlayErrors } | |||
} | |||
|
|||
function filterOldPasses(errorMessages: Array<ErrorMessage>): Array<ErrorMessage> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved this function (without making any changes to it) as it was causing a cyclic dependency in the tests
Problem:
#5676 removed some handling we put in place in #5084 specific for a couple of react-router errors that would cause issues with the canvas.
Fix:
Rather than resurrecting the console proxying code for the sake of this, I've narrowed the logic down to only operate on the
console.error
method. We then listen for those specific errors (checking the first arg of the function, which is what we were doing previously).Note:
Unlike before, this will no longer immediately restore the canvas. Some form of action is required to restore the canvas, such as a manual save, or even scrolling the canvas (in the following video I wait a bit before scrolling the canvas to demonstrate this):
https://github.com/concrete-utopia/utopia/assets/1044774/d92e3eba-4d7f-413a-b484-8c34228d0adf
I believe this is because with the previous console proxying we would have re-rendered the canvas after any log line due to the (horrible) way the proxying was wired in.
Manual Tests:
I hereby swear that: