-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasm-tbb: increase stack size and add CI (#1079)
* update dependencies and run wasm-tbb build * update stack size... * update * format * fix compilation error * format * fix * idk what happened * change emscripten version back * don't test for wasm-tbb * readme changes
- Loading branch information
Showing
10 changed files
with
85 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// https://gist.github.com/jamsinclair/6ad148d0590291077a4ce389c2b274ea | ||
import {createFilter} from 'vite'; | ||
|
||
function isEmscriptenFile(code) { | ||
return /var\s+Module\s*=|WebAssembly\.instantiate/.test(code) && | ||
/var\s+workerOptions\s*=/.test(code); | ||
} | ||
|
||
/** | ||
* Vite plugin that replaces Emscripten workerOptions with static object literal | ||
* to fix error with Vite See project issue: | ||
* https://github.com/emscripten-core/emscripten/issues/22394 | ||
* | ||
* Defaults to running for all .js and .ts files. If there are any issues you | ||
* can use the include/exclude options. | ||
* | ||
* @param {Object} options | ||
* @property {string[]} [include] - Glob patterns to include | ||
* @property {string[]} [exclude] - Glob patterns to exclude | ||
* @returns {import('vite').Plugin} | ||
*/ | ||
export default function emscriptenStaticWorkerOptions(options = {}) { | ||
const filter = createFilter(options.include || /\.[jt]s$/, options.exclude); | ||
|
||
return { | ||
name: 'emscripten-static-worker-options', | ||
enforce: 'pre', | ||
transform(code, id) { | ||
if (!filter(id)) return null; | ||
|
||
if (!isEmscriptenFile(code)) return null; | ||
|
||
const workerOptionsMatch = | ||
code.match(/var\s+workerOptions\s*=\s*({[^}]+})/); | ||
if (!workerOptionsMatch) return null; | ||
|
||
const optionsObjectStr = workerOptionsMatch[1]; | ||
const optionsDeclarationStr = workerOptionsMatch[0]; | ||
|
||
const modifiedCode = | ||
code.replace(optionsDeclarationStr, '') | ||
.replace( | ||
new RegExp('workerOptions(?![\\w$])', 'g'), optionsObjectStr); | ||
|
||
return {code: modifiedCode, map: null}; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters