Skip to content
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

xhr is called synchronously #106

Open
trungleduc opened this issue Aug 13, 2024 · 3 comments · May be fixed by #107
Open

xhr is called synchronously #106

trungleduc opened this issue Aug 13, 2024 · 3 comments · May be fixed by #107
Labels
bug Something isn't working

Comments

@trungleduc
Copy link
Contributor

trungleduc commented Aug 13, 2024

Description

getJson helper is using XMLHttpRequest synchronously, which is deprecated and does not work well with service worker. Is there any technical season to avoid async call here or can we convert this function to use fetch?

xeus/src/index.ts

Lines 15 to 20 in 6504866

function getJson(url: string) {
const json_url = URLExt.join(PageConfig.getBaseUrl(), url);
const xhr = new XMLHttpRequest();
xhr.open('GET', json_url, false);
xhr.send(null);

@trungleduc trungleduc added the bug Something isn't working label Aug 13, 2024
@trungleduc
Copy link
Contributor Author

cc @DerThorsten

@DerThorsten
Copy link
Collaborator

DerThorsten commented Aug 14, 2024

@trungleduc so if you can make this part async then we of course can just use fetch
I assume that part here

export default plugins;

is the problem

@trungleduc
Copy link
Contributor Author

Thanks @DerThorsten, i will open a PR to fix this issue.

@trungleduc trungleduc linked a pull request Aug 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants