-
Notifications
You must be signed in to change notification settings - Fork 274
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
Report errors encountered during bootPlaygroundRemote() #570
Merged
+170
−60
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d82009e
Report errors encountered during bootPlaygroundRemote()
adamziel fa7fb2c
Add a todo
adamziel 0590c1a
Ensure data dependencies reject on network failure
adamziel 4c45cb3
Fix build errors
adamziel 13b80b1
Add the missing postMessage to worker thread
adamziel 02d7461
Formatting
adamziel 237638f
Tiny insigificant cleanup for make it easier for Dennis to read the s…
dmsnell 5f99872
fixup! Tiny insigificant cleanup for make it easier for Dennis to rea…
dmsnell e9f132e
fixup! fixup! Tiny insigificant cleanup for make it easier for Dennis…
dmsnell a9cc3b1
Prepend the promise to methods only after it is constructed.
adamziel de8660b
Render a nicer error message
adamziel 2931d21
Try again button: Reload the current window
adamziel a8c9e73
Add nice error about the third-party cookies
adamziel 1ed6e7b
Report loading errors from inside worker thread
adamziel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
1 change: 1 addition & 0 deletions
1
packages/playground/compile-wordpress/build-assets/esm-suffix.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
// See esm-prefix.js | ||
}); | ||
} |
This file contains 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
This file contains 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
This file contains 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
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.
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.
before we have been running these and moving on possibly before they finish, but now with
Promise.all
we are pausing until they all finish. is that intentional?also, we are using
Promise.all
so if a single data dependency throws an error the entire thing collapses.Promise.allSettled
so we can report failures for specific dependencies?try
/catch
or adding anycatch
handler to any of the promises.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.
Before we've waited for data dependencies, too, in one of the next lines:
await depsReady;
. That line is still there, in this PR, but maybe we don't need it anymore.We could, but that would amount to the same outcome – display a loading error. Or would you like to do something more granular with that information?
That was my intention – try to download and start PHP and, if anything at all fails, reject the promise.
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.
No, we still need
await depsReady;
because it's resolved after the data dependencies have been both loaded and processedThere 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.
the point was that
depsReady
is all or nothing and.allSettled
can tell us which dependencies failed. so if our goal is to expose more errors it could be beneficial to say something like "dependency {name} from {URL} failed to download" and be able to do that for each one that fails.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.
Ah, I see what you mean! The information about the URL is included in the error message thrown by the Emscripten module. The ability to display multiple errors would still be nice, we’d just need to handle an array of error messages up the call stack.
Worth noting: data dependencies are produced by file_packager.py and we only load a single data dependency now: wp.data.