-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: catch runtime error #4605
feat: catch runtime error #4605
Conversation
Codecov ReportBase: 92.11% // Head: 91.98% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #4605 +/- ##
==========================================
- Coverage 92.11% 91.98% -0.14%
==========================================
Files 16 16
Lines 1661 1659 -2
Branches 623 618 -5
==========================================
- Hits 1530 1526 -4
- Misses 120 122 +2
Partials 11 11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@alexander-akait the issue that I mentioned in the previous PR about differentiating build error vs runtime error is no longer a concern with this implementation as once any The next step I need to work on is to find out the source code that throws the runtime error (currently the info I get is the URL prefix with |
The modeling using finite-state machine is just a random idea that come to me today. Let me know if it's involving too much change and I will revert it. I'm using it to think through the desired behavior. |
client-src/overlay/state-machine.js
Outdated
@@ -0,0 +1,89 @@ | |||
import { createMachine, assign } from "@xstate/fsm"; |
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.
What is size @xstate/fsm
? Because extra size reduce build time
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.
https://bundlejs.com/?q=%40xstate%2Ffsm
It's 3.94kb/1.82kb gzip.
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.
Looks like big... Maybe we can reimplement only necessary things or use more small alternative?
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.
What's the acceptable size? I can shop around.
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 just look at @xstate/fsm
's implementation, which seems to be quite minimal.
I can think of two options:
- use
@xstate/fsm
as baseline and continue code golf it to make it as small as possible (probably by removing some error check and some convenient API). - pre-minify it before build, but I not sure if this would help the compilation efficiency.
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 think the 1.
will be better, we can add a new API when we will need it
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.
Sorry for no update for more than a month! 😅
I've just created a custom createMachine
while maintain enough compatibility so we can use their visualizer.
43e3f51
to
7907c8e
Compare
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.
Looks very good for me
@snitin315 Can you review too, also what do you think about include it in the next (or we can include it in master and get feedback faster)
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.
Looks great ⭐ . @malcolm-kee can you also update the webpack 4 snapshots?
@alexander-akait I think we can release it in master. next
will take time.
62ecee6
62ecee6
to
5298888
Compare
I've updated the snapshot for webpack 4. There are few things that I want to continue work on once this is merged:
|
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.
Thank, you will do release tomorrow
@malcolm-kee looks like four tests for webpack v4 is failed (not sure, why because logic is the same, maybe you are missing something, where we before have workarounds for webpack v4), can you look at them? |
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.
Just to ensure, can you test it using IE11-IE10 (some developer still need it), to ensure we don't use the modern browser API and babel works correctly here, just a manual test, and thank you for your hard work
@alexander-akait is there any workflow/test case that I can refer for testing in IE? It seems like webpack code itself use arrow function, which is not supported in IE. |
Also on side note, is it possible for this repo to request free account from Browserstack or Saucelab? I paid for a month subscription to do the testing above 😅 |
@malcolm-kee You can send a request to them 😄 I use virtual machines in such case For testing please use |
Based on the fix above, overlay is displayed when there is build error. However the runtime error is not caught, probably something wrong with |
Great, thank you fro this work, let's check if |
@malcolm-kee friendly ping ⭐ |
Sorry for the delayed response. |
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.
@snitin315 Can you review too, thank you
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.
Let's release this and gather feedback!
@alexander-akait you can merge and release. |
Sorry for big delay, let's merge and release, really very sorry |
For Bugs and Features; did you add new tests?
Motivation / Use-Case
filename
received in theErrorEvent
will be an URL prefixed withwebpack:///
. Not sure if we would be able to find the actual code path based on this.Part of #3689.
Breaking Changes
Additional Info
Test results in IE10