Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

What's in-scope? #10

Closed
jcbhmr opened this issue May 23, 2023 · 4 comments
Closed

What's in-scope? #10

jcbhmr opened this issue May 23, 2023 · 4 comments

Comments

@jcbhmr
Copy link

jcbhmr commented May 23, 2023

There's other stuff that is specified in the https://html.spec.whatwg.org/multipage/workers.html page relating to how the Worker interface works. For instance, there's a WorkerNavigator and WorkerLocation. I assume these are out-of-scope, but I just want to confirm? There's also the onoffline, onlanguagechange, and ononline events.

image

@jcbhmr jcbhmr changed the title How much stuff? Are WorkerLocation and WorkerNavigator out-of-scope? May 23, 2023
@jcbhmr jcbhmr changed the title Are WorkerLocation and WorkerNavigator out-of-scope? What's in-scope? May 23, 2023
@jcbhmr
Copy link
Author

jcbhmr commented May 23, 2023

Another thing I've noticed is that there appears to be support for importing http: and https: URLs. Is this something that can be relegated to --experimental-network-imports? It appears that it's already native, just behind a flag!
https://nodejs.org/api/esm.html#https-and-http-imports

Also consider that some people may not want to have HTTP imports.
If you really want to use a custom HTTP loader, I suggest having a conditional like:

if (process.execArgv.includes("--experimental-network-imports") {
  applyCustomHTTPLoader(); // Or whatever...
}

Thoughts? 🤔

@jimmywarting
Copy link
Owner

jimmywarting commented May 23, 2023

The hole reason i wanted to have custom experimental loaders where not particularly import http url.
it was so that i could create dynamic code and import them with blob + ObjectURL (for await-sync)

so the idea was to do something like:

const blob = new Blob([`
  import fs from 'node:fs'
  fs.writeFileSync(...)
`], { type: 'text/javascript' })

const url = URL.createObjectURL(blob)
import(url)

But sure this could maybe be an option for this.
but i maybe want to avoid this for now just to get out a working prototype and creating a MVP

@jimmywarting
Copy link
Owner

There are some thing that NodeJS is working on about implementing globalThis.navigator.userAgent with push from wintercg minium api: https://common-min-api.proposal.wintercg.org/

there are issues here as well:

but we could implement whatever we feel like a web worker should actually have

@jcbhmr
Copy link
Author

jcbhmr commented May 26, 2023

I just realized Discussions were enabled on this repo. 🤦‍♂️ If you could, would move this issue to a Discussion pls to satisfy my brain 🧠🙏

Repository owner locked and limited conversation to collaborators May 26, 2023
@jimmywarting jimmywarting converted this issue into discussion #18 May 26, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants