JS: Drop older NodeJS and WebBrowsers support

Requires WASM reference types and JS WeakRef
pull/833/head
Tpt 9 months ago committed by Thomas Tanon
parent dcfcdd359c
commit 4c27b43e41
  1. 2
      .github/workflows/tests.yml
  2. 2
      js/README.md
  3. 4
      js/package.json
  4. 2
      python/src/dataset.rs

@ -268,7 +268,7 @@ jobs:
with: { tool: wasm-pack } with: { tool: wasm-pack }
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 18
cache: npm cache: npm
cache-dependency-path: "js/package.json" cache-dependency-path: "js/package.json"
- run: npm install - run: npm install

@ -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/). 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: To install:
```bash ```bash

@ -9,8 +9,8 @@
}, },
"scripts": { "scripts": {
"fmt": "biome format . --write && biome check . --apply-unsafe && biome format . --write", "fmt": "biome format . --write && biome check . --apply-unsafe && biome format . --write",
"test": "biome ci . && wasm-pack build --debug --target nodejs && mocha", "test": "biome ci . && wasm-pack build --debug --target nodejs --weak-refs --reference-types && mocha",
"build": "wasm-pack build --release --target web --out-name web && wasm-pack build --release --target nodejs --out-name node && node build_package.js", "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", "release": "npm run build && npm publish ./pkg",
"pack": "npm run build && npm pack ./pkg" "pack": "npm run build && npm pack ./pkg"
}, },

@ -14,7 +14,7 @@ use pyo3::prelude::*;
/// if you insert and remove a lot of different terms, memory will grow without any reduction. /// 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. /// :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: /// The :py:class:`str` function provides an N-Quads serialization:
/// ///

Loading…
Cancel
Save