So this post made me look up[1][2] COOP/COEP, but as far as i can tell this seems to be a security measure. Seemingly because they don't know, at this point in time, how else to enable shared memory in WASM without this limitation.
So what in your mind could have been done better? I agree it really sucks having your WASM apps live in two camps, single and multithreaded, but it seems like we, as users conceptually have two choices:
1. Don't get shared memory at all. Or, 2. Get shared memory in limited scenarios
#2 still seems better than #1, no?
Or do you perhaps think the performance Opt-In is overly aggressive. Ie if we just enabled shared memory always we'd reduce the WASM split with minimal issues. Alternatively we could do the reverse, Opt-Out, such that for resource constrained environments the phone/whatever could connect to `mobile.example.com`.
[1]: https://web.dev/coop-coep/ [2]: https://www.youtube.com/watch?v=XLNJYhjA-0c&t=4s
The underlying problem is that this is a classic finger-pointing-situation that will probably never be fixed, because the web security people point the finger at the web hosters, and the web hosters shrug it off because 99% of their customers don't need the features because they just host their static blog there.
If it's a security risk, there shouldn't be an option. Setting up a web server is a low bar for malicious actors.
The more relevant question here is why so few (if at all) web hosting solutions allow the user to configure custom server rules?
Why would communicating sequential processes be crippled by this?
Something like
<head>
<meta http-equiv="Cross-Origin-Embedder-Policy" content="require-corp" />
<meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin" />
...
</head>https://stackoverflow.com/questions/67259043/can-coop-coep-h...
Just like CORS proxies maybe someone can make a public COOP/COEP proxy.
Stupid requirements will lead to stupid workarounds.
Actually you could probably just use CloudFront if you don't mind spending a couple bucks a month and configure it to add some headers.
I could use something like Netlify, but I like the convenience of the gh-pages branch and deployment.
HTTP headers should not affect app functionality in this way.
This means WASM threads can't be used with popular hosting solutions like Github Pages, which in turn means that for library authors like me the feature is nearly useless because it splits the audience into people who have control over their web servers, and those who don't, which in turn means maintaining two code paths, one with and one without threading support. And even if you theoretically have control over the web server configuration it's still more hassle because the people who write the code are usually not the same people who configure the web servers. So instead of just dumping a couple of WASM files to IT you also need to find and ask the right people to tweak the web server configuration just for your use case.
Sometimes I don't understand what's going on in the heads of the people thinking this stuff up :/