-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[file-packager] Use fetch()
for loading file packages.
#22016
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
[file-packager] Use fetch()
for loading file packages.
#22016
Conversation
fetch()
for loading file packages.
fetch()
for loading file packages.fetch()
for loading file packages.
}; | ||
</script> | ||
{{{ SCRIPT }}} | ||
</body> |
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.
Rather than require special shell can you just rely on the fact that default reporting will try bot fetch
and origFetch
:
emscripten/test/browser_reporting.js
Line 16 in a6e1f5c
let doFetch = typeof origFetch != 'undefined' ? origFetch : fetch; |
i.e. when you disable fetch
you can cache the original fetch so that that browser reporting doesn't break.
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.
@sbc100 I'm not able to get the exception out of the browser without the custom shell. It just hangs with the exception listed as uncaught in the browser's console.
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.
lgtm modulo a few comments
@seanmorris do you have some time up update this PR? I'd love to see it landing if possible. |
…ipten into sm-worker-package-fetch
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.
Thanks for all the back and forth on this! I think this is ready to land now!
NICE!!! |
Head branch was pushed to by a user without write access
…ipten into sm-worker-package-fetch
This PR switches AJAX requests for file packages to be loaded with fetch() rather than XmlHttpRequest(). This allows service workers to make AJAX requests, since XmlHttpRequest is not available in service workers.
Module['setStatus']
is now called with more granularity during package downloads.Previously, --embed-file was necessary to load file packages, which embeds the files into the binary and precludes caching and re-use of the package.
Partially fixes #22003, only applies to file packages.