Skip to content

Commit

Permalink
update quickjs-ng docs
Browse files Browse the repository at this point in the history
  • Loading branch information
justjake committed Jan 2, 2024
1 parent a26bc19 commit e63adab
Show file tree
Hide file tree
Showing 56 changed files with 147 additions and 58 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ compiled to WebAssembly.
- Create and manipulate values inside the QuickJS runtime ([more][values]).
- Expose host functions to the QuickJS runtime ([more][functions]).
- Execute synchronous code that uses asynchronous functions, with [asyncify][asyncify].
- Supports browsers, NodeJS 16+, Deno, Bun, Cloudflare Workers.

[Github] | [NPM] | [API Documentation][api] | [Variants][core] | [Examples][tests]

Expand Down
2 changes: 1 addition & 1 deletion doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This variant was built with the following settings:

## Library: quickjs-ng

[quickjs-ng](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs with more language features.
[quickjs-ng/quickjs](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs under active community development. It implements more EcmaScript features, and drop some non-standard QuickJS only features like BigFloat. May become the default library in a future version of quickjs-emscripten.

## Release mode: debug

Expand Down
3 changes: 2 additions & 1 deletion doc/@jitl/quickjs-ng-wasmfile-debug-asyncify/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS C

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs-ng | [quickjs-ng/quickjs](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs under active community development. It implements more EcmaScript features, and drop some non-standard QuickJS only features like BigFloat. May become the default library in a future version of quickjs-emscripten. |
| releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |
| syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
| emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |
| exports | require import browser workerd | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-ng-wasmfile-debug-asyncify/src/index.ts#L18)

***

Expand Down
2 changes: 1 addition & 1 deletion doc/@jitl/quickjs-ng-wasmfile-debug-sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This variant was built with the following settings:

## Library: quickjs-ng

[quickjs-ng](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs with more language features.
[quickjs-ng/quickjs](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs under active community development. It implements more EcmaScript features, and drop some non-standard QuickJS only features like BigFloat. May become the default library in a future version of quickjs-emscripten.

## Release mode: debug

Expand Down
3 changes: 2 additions & 1 deletion doc/@jitl/quickjs-ng-wasmfile-debug-sync/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS C

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs-ng | [quickjs-ng/quickjs](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs under active community development. It implements more EcmaScript features, and drop some non-standard QuickJS only features like BigFloat. May become the default library in a future version of quickjs-emscripten. |
| releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |
| syncMode | sync | The default, normal build. Note that both variants support regular async functions. |
| emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |
| exports | require import browser workerd | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-ng-wasmfile-debug-sync/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-ng-wasmfile-debug-sync/src/index.ts#L18)

***

Expand Down
2 changes: 1 addition & 1 deletion doc/@jitl/quickjs-ng-wasmfile-release-asyncify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This variant was built with the following settings:

## Library: quickjs-ng

[quickjs-ng](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs with more language features.
[quickjs-ng/quickjs](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs under active community development. It implements more EcmaScript features, and drop some non-standard QuickJS only features like BigFloat. May become the default library in a future version of quickjs-emscripten.

## Release mode: release

Expand Down
3 changes: 2 additions & 1 deletion doc/@jitl/quickjs-ng-wasmfile-release-asyncify/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS C

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs-ng | [quickjs-ng/quickjs](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs under active community development. It implements more EcmaScript features, and drop some non-standard QuickJS only features like BigFloat. May become the default library in a future version of quickjs-emscripten. |
| releaseMode | release | Optimized for performance; use when building/deploying your application. |
| syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
| emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |
| exports | require import browser workerd | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-ng-wasmfile-release-asyncify/src/index.ts#L18)

***

Expand Down
2 changes: 1 addition & 1 deletion doc/@jitl/quickjs-ng-wasmfile-release-sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This variant was built with the following settings:

## Library: quickjs-ng

[quickjs-ng](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs with more language features.
[quickjs-ng/quickjs](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs under active community development. It implements more EcmaScript features, and drop some non-standard QuickJS only features like BigFloat. May become the default library in a future version of quickjs-emscripten.

## Release mode: release

Expand Down
3 changes: 2 additions & 1 deletion doc/@jitl/quickjs-ng-wasmfile-release-sync/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with separate .WASM file. Supports browser ESM, NodeJS ESM, and NodeJS C

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs-ng | [quickjs-ng/quickjs](https://github.com/quickjs-ng/quickjs) is a newer fork of quickjs under active community development. It implements more EcmaScript features, and drop some non-standard QuickJS only features like BigFloat. May become the default library in a future version of quickjs-emscripten. |
| releaseMode | release | Optimized for performance; use when building/deploying your application. |
| syncMode | sync | The default, normal build. Note that both variants support regular async functions. |
| emscriptenInclusion | wasm | Has a separate .wasm file. May offer better caching in your browser, and reduces the size of your JS bundle. If you have issues, try a 'singlefile' variant. |
| exports | require import browser workerd | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-ng-wasmfile-release-sync/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-ng-wasmfile-release-sync/src/index.ts#L18)

***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with the WASM data embedded into a browser ESModule.

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |
| releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |
| syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
| emscriptenInclusion | singlefile | The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app. |
| exports | browser | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-browser-debug-asyncify/src/index.ts#L18)

***

Expand Down
3 changes: 2 additions & 1 deletion doc/@jitl/quickjs-singlefile-browser-debug-sync/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with the WASM data embedded into a browser ESModule.

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |
| releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |
| syncMode | sync | The default, normal build. Note that both variants support regular async functions. |
| emscriptenInclusion | singlefile | The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app. |
| exports | browser | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-browser-debug-sync/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-browser-debug-sync/src/index.ts#L18)

***

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with the WASM data embedded into a browser ESModule.

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |
| releaseMode | release | Optimized for performance; use when building/deploying your application. |
| syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
| emscriptenInclusion | singlefile | The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app. |
| exports | browser | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-browser-release-asyncify/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-browser-release-asyncify/src/index.ts#L18)

***

Expand Down
3 changes: 2 additions & 1 deletion doc/@jitl/quickjs-singlefile-browser-release-sync/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with the WASM data embedded into a browser ESModule.

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |
| releaseMode | release | Optimized for performance; use when building/deploying your application. |
| syncMode | sync | The default, normal build. Note that both variants support regular async functions. |
| emscriptenInclusion | singlefile | The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app. |
| exports | browser | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-browser-release-sync/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-browser-release-sync/src/index.ts#L18)

***

Expand Down
3 changes: 2 additions & 1 deletion doc/@jitl/quickjs-singlefile-cjs-debug-asyncify/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with the WASM data embedded into a universal (Node and Browser compatibl

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |
| releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |
| syncMode | asyncify | Build run through the ASYNCIFY WebAssembly transform. This imposes substantial size (2x the size of sync) and speed penalties (40% the speed of sync). In return, allows synchronous calls from the QuickJS WASM runtime to async functions on the host. The extra magic makes this variant slower than sync variants. Note that both variants support regular async functions. Only adopt ASYNCIFY if you need to! The [QuickJSAsyncRuntime](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncRuntime.md) and [QuickJSAsyncContext](https://github.com/justjake/quickjs-emscripten/blob/main/doc/quickjs-emscripten/classes/QuickJSAsyncContext.md) classes expose the ASYNCIFY-specific APIs. |
| emscriptenInclusion | singlefile | The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app. |
| exports | require | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-cjs-debug-asyncify/src/index.ts#L18)

***

Expand Down
3 changes: 2 additions & 1 deletion doc/@jitl/quickjs-singlefile-cjs-debug-sync/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Variant with the WASM data embedded into a universal (Node and Browser compatibl

| Variable | Setting | Description |
| -- | -- | -- |
| library | quickjs | The original [bellard/quickjs](https://github.com/bellard/quickjs) library. |
| releaseMode | debug | Enables assertions and memory sanitizers. Try to run your tests against debug variants, in addition to your preferred production variant, to catch more bugs. |
| syncMode | sync | The default, normal build. Note that both variants support regular async functions. |
| emscriptenInclusion | singlefile | The WASM runtime is included directly in the JS file. Use if you run into issues with missing .wasm files when building or deploying your app. |
| exports | require | Has these package.json export conditions |

#### Source

[index.ts:17](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-cjs-debug-sync/src/index.ts#L17)
[index.ts:18](https://github.com/justjake/quickjs-emscripten/blob/main/packages/variant-quickjs-singlefile-cjs-debug-sync/src/index.ts#L18)

***

Expand Down
Loading

0 comments on commit e63adab

Please sign in to comment.