From 404def54b0ee14731ba6f611cc0233801dc27bc6 Mon Sep 17 00:00:00 2001 From: Tpt Date: Sat, 23 Mar 2024 08:01:11 +0100 Subject: [PATCH] JS: Drop older NodeJS and WebBrowsers support Requires WASM reference types and JS WeakRef --- .github/workflows/tests.yml | 2 +- js/README.md | 2 +- js/package.json | 4 ++-- python/src/dataset.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4bbefbcf..4a87542e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -268,7 +268,7 @@ jobs: with: { tool: wasm-pack } - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: npm cache-dependency-path: "js/package.json" - run: npm install diff --git a/js/README.md b/js/README.md index 94a2847d..8178261c 100644 --- a/js/README.md +++ b/js/README.md @@ -13,7 +13,7 @@ Oxigraph for JavaScript is a work in progress and currently offers a simple in-m The store is also able to load RDF serialized in [Turtle](https://www.w3.org/TR/turtle/), [TriG](https://www.w3.org/TR/trig/), [N-Triples](https://www.w3.org/TR/n-triples/), [N-Quads](https://www.w3.org/TR/n-quads/) and [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/). -It is distributed using a [a NPM package](https://www.npmjs.com/package/oxigraph) that should work with Node.JS 12+ and modern web browsers compatible with WebAssembly. +It is distributed using a [a NPM package](https://www.npmjs.com/package/oxigraph) that should work with Node.JS 18+ and [modern web browsers compatible with WebAssembly reference types and JavaScript `WeakRef`](https://caniuse.com/wasm-reference-types,mdn-javascript_builtins_weakref). To install: ```bash diff --git a/js/package.json b/js/package.json index 5a81afa5..0a87368d 100644 --- a/js/package.json +++ b/js/package.json @@ -9,8 +9,8 @@ }, "scripts": { "fmt": "biome format . --write && biome check . --apply-unsafe && biome format . --write", - "test": "biome ci . && wasm-pack build --debug --target nodejs && mocha", - "build": "wasm-pack build --release --target web --out-name web && wasm-pack build --release --target nodejs --out-name node && node build_package.js", + "test": "biome ci . && wasm-pack build --debug --target nodejs --weak-refs --reference-types && mocha", + "build": "wasm-pack build --release --target web --out-name web --weak-refs --reference-types && wasm-pack build --release --target nodejs --out-name node --weak-refs --reference-types && node build_package.js", "release": "npm run build && npm publish ./pkg", "pack": "npm run build && npm pack ./pkg" }, diff --git a/python/src/dataset.rs b/python/src/dataset.rs index 1b9d038c..944fd5d4 100644 --- a/python/src/dataset.rs +++ b/python/src/dataset.rs @@ -14,7 +14,7 @@ use pyo3::prelude::*; /// if you insert and remove a lot of different terms, memory will grow without any reduction. /// /// :param quads: some quads to initialize the dataset with. -/// :type quads: collections.abc.Iterable[Quad] +/// :type quads: collections.abc.Iterable[Quad] or None, optional /// /// The :py:class:`str` function provides an N-Quads serialization: ///