Skip to content

[wasm] Rework fetch - #61639

Merged
lewing merged 8 commits into
dotnet:mainfrom
lewing:rework-fetch
Nov 16, 2021
Merged

[wasm] Rework fetch#61639
lewing merged 8 commits into
dotnet:mainfrom
lewing:rework-fetch

Conversation

@lewing

Copy link
Copy Markdown
Member

No description provided.

@ghost

Copy link
Copy Markdown

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

kg
kg approved these changes Nov 16, 2021

@kgkg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine assuming nothing breaks

catch (e) {
return <Response><any> {
ok: true,
ok: false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe store the error as a property so the caller can find out what the error was without an extra throw+catch

}
else if (ENVIRONMENT_IS_NODE) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const fs = require("fs");

@pavelsavarapavelsavaraNov 16, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will do require for each call of the _fetch_asset. I admit the previous implementation had the same issue.

@pavelsavarapavelsavara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly prefer the async variant for NodeJs. readFileSync is "stop the world and wait for disk" for node engine.

@lewing

Copy link
Copy Markdown
MemberAuthor

I strongly prefer the async variant for NodeJs. readFileSync is "stop the world and wait for disk" for node engine.

Oddly enough that was entirely accidental, I should be a little more careful about what completions I accept.

@pavelsavara

Copy link
Copy Markdown
Member

it seems there are lint issue


D:\a\_work\1\s\src\mono\wasm\runtime\startup.ts
5:117 warning 'TypedArray' is defined but never used @typescript-eslint/no-unused-vars

@pavelsavara

Copy link
Copy Markdown
Member

I wonder why only staging pipeline failed, not the runtime pipeline.

Comment threadsrc/mono/wasm/runtime/startup.ts
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@lewing@pavelsavara@kg