An adapter for enabling Rayon-based concurrency on the Web with WebAssembly.
Hi, thanks for a great library. This PR updates the Readme with instructions for Vite and adds Vite to the test suite. --- _Without_ `@surma/rollup-plugin-off-main-thread`, the `vite build` command fails with ``` ❯ npx vite build vite v5.1.4 building for production... transforming (1) index.html <--- Last few GCs ---> [517549:0x572c270] 75048 ms: Mark-sweep 4041.1 (4138.2) -> 4030.7 (4141.4) MB, 1570.5 / 0.0 ms (average mu = 0.195, current mu = 0.041) task; scavenge might not succeed [517549:0x572c270] 77747 ms: Mark-sweep 4045.6 (4142.2) -> 4034.5 (4145.2) MB, 2632.7 / 0.0 ms (average mu = 0.094, current mu = 0.025) task; scavenge might not succeed <--- JS stacktrace ---> FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 1: 0xb7a940 node::Abort() [node] 2: 0xa8e823 [node] 3: 0xd5c940 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node] 4: 0xd5cce7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node] 5: 0xf3a3e5 [node] 6: 0xf4c8cd v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node] 7: 0xfbb924 v8::internal::ScavengeJob::Task::RunInternal() [node] 8: 0xe2c07b non-virtual thunk to v8::internal::CancelableTask::Run() [node] 9: 0xbe6884 [node] 10: 0xbe9cee node::PerIsolatePlatformData::FlushForegroundTasksInternal() [node] 11: 0x165eb16 [node] 12: 0x1671054 [node] 13: 0x165f47e uv_run [node] 14: 0xabda6d node::SpinEventLoop(node::Environment*) [node] 15: 0xbc1164 node::NodeMainInstance::Run() [node] 16: 0xb35bc8 node::LoadSnapshotDataAndRun(node::SnapshotData const**, node::InitializationResult const*) [node] 17: 0xb3976f node::Start(int, char**) [node] 18: 0x7f46b3fb0083 __libc_start_main [/lib/x86_64-linux-gnu/libc.so.6] 19: 0xabbdee _start [node] Aborted ``` However, _with_ `@surma/rollup-plugin-off-main-thread`, the dev server `npx vite dev` causes the page to try to load `http://localhost:5173/pkg/snippets/wasm-bindgen-rayon-3e04391371ad0a8e/src/undefined` which obviously doesn't exist and results in `Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.` [Possibly related.](https://github.com/vitejs/vite/issues/1820) Therefore, we conditionally use `@surma/rollup-plugin-off-main-thread` based on Vite's "mode".
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by AlexErrant and has received 4 comments.