-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: removed Vite WebAssembly plugins
- Loading branch information
1 parent
91fbadd
commit 3312ad7
Showing
16 changed files
with
113 additions
and
163 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
{ | ||
"name": "harper.js", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"test": "vitest run" | ||
}, | ||
"dependencies": { | ||
"wasm": "link:../../harper-wasm/pkg" | ||
}, | ||
"devDependencies": { | ||
"@vitest/browser": "^2.1.8", | ||
"playwright": "^1.49.1", | ||
"typescript": "~5.6.2", | ||
"vite": "^5.1.8", | ||
"vite-plugin-dts": "^4.3.0", | ||
"vite-plugin-top-level-await": "^1.4.4", | ||
"vite-plugin-wasm": "^3.3.0", | ||
"vitest": "^2.1.8" | ||
}, | ||
"main": "dist/harper.js", | ||
"types": "dist/harper.d.ts" | ||
"name": "harper.js", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"test": "vitest run" | ||
}, | ||
"dependencies": { | ||
"wasm": "link:../../harper-wasm/pkg" | ||
}, | ||
"devDependencies": { | ||
"@vitest/browser": "^2.1.8", | ||
"playwright": "^1.49.1", | ||
"typescript": "~5.6.2", | ||
"vite": "^5.1.8", | ||
"vite-plugin-dts": "^4.3.0", | ||
"vitest": "^2.1.8" | ||
}, | ||
"main": "dist/harper.js", | ||
"types": "dist/harper.d.ts" | ||
} |
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
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,9 @@ | ||
import wasmUrl from 'wasm/harper_wasm_bg.wasm?url'; | ||
|
||
/** Load the WebAssembly manually and dynamically, making sure to setup infrastructure. */ | ||
export default async function loadWasm() { | ||
const wasm = await import('wasm'); | ||
await wasm.default(wasmUrl); | ||
|
||
return wasm; | ||
} |
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,8 @@ | ||
import { expect, test } from 'vitest'; | ||
import { SuggestionKind as WasmSuggestionKind } from 'wasm'; | ||
import { SuggestionKind } from './main'; | ||
|
||
test('Wasm and JS SuggestionKinds agree', async () => { | ||
expect(SuggestionKind.Remove).toBe(WasmSuggestionKind.Remove); | ||
expect(SuggestionKind.Replace).toBe(WasmSuggestionKind.Replace); | ||
}); |
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
Oops, something went wrong.