Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade napi-rs to 2.10.0 and Node.js v18 #157

Merged
merged 3 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['12', '14', '16']
node: ['14', '16', '18']
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -260,9 +260,9 @@ jobs:
- host: windows-latest
target: x86_64-pc-windows-msvc
node:
- '12'
- '14'
- '16'
- '18'
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -297,9 +297,9 @@ jobs:
fail-fast: false
matrix:
node:
- '12'
- '14'
- '16'
- '18'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -334,9 +334,9 @@ jobs:
fail-fast: false
matrix:
node:
- '12'
- '14'
- '16'
- '18'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -373,9 +373,9 @@ jobs:
fail-fast: false
matrix:
node:
- '12'
- '14'
- '16'
- '18'
runs-on: ubuntu-latest
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
Expand Down Expand Up @@ -450,9 +450,9 @@ jobs:
fail-fast: false
matrix:
node:
- '12'
- '14'
- '16'
- '18'
runs-on: ubuntu-latest
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
Expand Down
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,35 @@ version = "1.0.0"
crate-type = ["cdylib"]

[dependencies]
env_logger = "0.9.0"
env_logger = "0.9.1"
fontdb = "0.9.1"
log = "0.4"

serde = { version = "1", features = ["derive"] }
serde_json = "1"
svgtypes = "0.8.1"
thiserror = "1.0.30"
png = "0.17.5"
svgtypes = "0.8.2"
thiserror = "1.0.37"
png = "=0.17.5"
pathfinder_geometry = "0.5.1"
pathfinder_content = { version = "0.5.0", default-features = false }
pathfinder_simd = { version = "0.5.1", features = ["pf-no-simd"] }
futures = "0.3.21"
infer = "0.9.0"
infer = "0.11.0"

[target.'cfg(all(not(all(target_os = "linux", target_arch = "aarch64", target_env = "musl")), not(all(target_os = "windows", target_arch = "aarch64")), not(target_arch = "wasm32")))'.dependencies]
mimalloc-rust = { version = "0.2" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2.81"
js-sys = "0.3.58"
wasm-bindgen = "0.2.83"
js-sys = "0.3.60"
resvg = { version = "0.25.0", default-features = false, features = [
"filter",
"dump-svg",
] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
napi = { version = "2.7.0", features = ["serde-json", "async"] }
napi-derive = "2.6.0"
napi = { version = "2.10.0", features = ["serde-json", "async"] }
napi-derive = "2.9.1"
resvg = { version = "0.25.0", default-features = false, features = [
"filter",
"dump-svg",
Expand Down
Binary file modified example/text-out-async.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/text-out.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 20 additions & 14 deletions wasm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function takeObject(idx) {
return ret;
}
var WASM_VECTOR_LEN = 0;
var cachedUint8Memory0;
var cachedUint8Memory0 = new Uint8Array();
function getUint8Memory0() {
if (cachedUint8Memory0.byteLength === 0) {
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
Expand Down Expand Up @@ -104,7 +104,7 @@ function passStringToWasm0(arg, malloc, realloc) {
function isLikeNone(x) {
return x === void 0 || x === null;
}
var cachedInt32Memory0;
var cachedInt32Memory0 = new Int32Array();
function getInt32Memory0() {
if (cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
Expand Down Expand Up @@ -342,31 +342,37 @@ async function load(module2, imports) {
function getImports() {
const imports = {};
imports.wbg = {};
imports.wbg.__wbg_new_651776e932b7e9c7 = function(arg0, arg1) {
imports.wbg.__wbg_new_8d2af00bc1e329ee = function(arg0, arg1) {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};
imports.wbg.__wbindgen_memory = function() {
const ret = wasm.memory;
return addHeapObject(ret);
};
imports.wbg.__wbg_buffer_de1150f91b23aa89 = function(arg0) {
imports.wbg.__wbg_buffer_3f3d764d4747d564 = function(arg0) {
const ret = getObject(arg0).buffer;
return addHeapObject(ret);
};
imports.wbg.__wbg_newwithbyteoffsetandlength_9ca61320599a2c84 = function(arg0, arg1, arg2) {
imports.wbg.__wbg_newwithbyteoffsetandlength_d9aa266703cb98be = function(arg0, arg1, arg2) {
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
takeObject(arg0);
};
imports.wbg.__wbg_new_97cf52648830a70d = function(arg0) {
imports.wbg.__wbg_new_8c3f0052272a457a = function(arg0) {
const ret = new Uint8Array(getObject(arg0));
return addHeapObject(ret);
};
imports.wbg.__wbg_instanceof_Uint8Array_fd17ec67c77de602 = function(arg0) {
const ret = getObject(arg0) instanceof Uint8Array;
imports.wbg.__wbg_instanceof_Uint8Array_971eeda69eb75003 = function(arg0) {
let result;
try {
result = getObject(arg0) instanceof Uint8Array;
} catch (e) {
result = false;
}
const ret = result;
return ret;
};
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
Expand All @@ -377,23 +383,23 @@ function getImports() {
getInt32Memory0()[arg0 / 4 + 1] = len0;
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
};
imports.wbg.__wbg_new_2ab697f1555e0dbc = function() {
imports.wbg.__wbg_new_1d9a920c6bfc44a8 = function() {
const ret = new Array();
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};
imports.wbg.__wbg_push_811c8b08bf4ff9d5 = function(arg0, arg1) {
imports.wbg.__wbg_push_740e4b286702d964 = function(arg0, arg1) {
const ret = getObject(arg0).push(getObject(arg1));
return ret;
};
imports.wbg.__wbg_length_e09c0b925ab8de5d = function(arg0) {
imports.wbg.__wbg_length_9e1ae1900cb0fbd5 = function(arg0) {
const ret = getObject(arg0).length;
return ret;
};
imports.wbg.__wbg_set_a0172b213e2469e9 = function(arg0, arg1, arg2) {
imports.wbg.__wbg_set_83db9690f9353e79 = function(arg0, arg1, arg2) {
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
};
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
Expand All @@ -406,8 +412,8 @@ function initMemory(imports, maybe_memory) {
function finalizeInit(instance, module2) {
wasm = instance.exports;
init.__wbindgen_wasm_module = module2;
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
cachedInt32Memory0 = new Int32Array();
cachedUint8Memory0 = new Uint8Array();
return wasm;
}
async function init(input) {
Expand Down
Loading