Skip to content

Commit 8b6d7ef

Browse files
committed
Updated coincident to its latest v4
1 parent fa3e02c commit 8b6d7ef

File tree

9 files changed

+63
-50
lines changed

9 files changed

+63
-50
lines changed

docs/index.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.js.map

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/toml-DiUM0_qs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

esm/interpreter/_python.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as FLATTED from 'coincident/flatted';
2-
const JSON = { parse: FLATTED.decode, stringify: FLATTED.encode };
1+
import * as DIRECT from 'reflected-ffi/direct';
2+
const JSON = { parse: DIRECT.decode, stringify: DIRECT.encode };
33

44
import { fetchFiles, fetchJSModules, fetchPaths } from './_utils.js';
55
import { IDBMapSync, dedent } from '../utils.js';

esm/interpreter/webr.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
import { create } from 'gc-hook';
21
import { dedent } from '../utils.js';
32
import { fetchFiles, fetchJSModules, fetchPaths } from './_utils.js';
43
import { io, stdio } from './_io.js';
54

65
const type = 'webr';
76
const r = new WeakMap();
7+
const fr = new FinalizationRegistry(fn => fn());
88

99
// REQUIRES INTEGRATION TEST
1010
/* c8 ignore start */
1111
const run = async (interpreter, code) => {
1212
const { shelter, destroy, io } = r.get(interpreter);
1313
const { output, result } = await shelter.captureR(dedent(code));
1414
for (const { type, data } of output) io[type](data);
15-
// this is a double proxy but it's OK as the consumer
16-
// of the result here needs to invoke explicitly a conversion
17-
// or trust the `(await p.toJs()).values` returns what's expected.
18-
return create(result, destroy, { token: false });
15+
fr.register(result, destroy);
16+
return result;
1917
};
2018

2119
export default {

esm/worker/_template.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import IDBMap from '@webreflection/idb-map';
88
import IDBMapSync from '@webreflection/idb-map/sync';
99

10-
import { decoder } from 'coincident/flatted/decoder';
1110
import coincident from 'coincident/window/worker';
1211

1312
import { assign, create, createFunction, createOverload, createResolved, dispatch, registerJSModules } from '../utils.js';
@@ -39,7 +38,6 @@ const {
3938
window,
4039
isWindowProxy
4140
} = await coincident({
42-
decoder,
4341
transfer: false,
4442
transform: value => transform ? transform(value) : value
4543
});

package-lock.json

Lines changed: 43 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@zip.js/zip.js": "^2.7.62",
5454
"c8": "^10.1.3",
5555
"chokidar": "^4.0.3",
56-
"eslint": "^9.28.0",
56+
"eslint": "^9.29.0",
5757
"linkedom": "^0.18.11",
5858
"rollup": "^4.43.0",
5959
"static-handler": "^0.5.3",
@@ -88,14 +88,13 @@
8888
"@webreflection/utils": "^0.1.0",
8989
"basic-devtools": "^0.1.6",
9090
"codedent": "^0.1.2",
91-
"coincident": "^3.0.5",
92-
"gc-hook": "^0.4.1",
91+
"coincident": "^4.0.2",
9392
"html-escaper": "^3.0.3",
94-
"proxy-target": "^3.0.2",
93+
"reflected-ffi": "^0.4.4",
9594
"sticky-module": "^0.1.1",
9695
"to-json-callback": "^0.1.1"
9796
},
9897
"worker": {
99-
"blob": "sha256-7Vekg72V1f88zbmKk3QIOtZBpAaNhuN6u0Y3dowIGYw="
98+
"blob": "sha256-ECxGYRAlWEn3lACwZTBKGjOO8NIyJ+XojyTUmr0bubg="
10099
}
101100
}

0 commit comments

Comments
 (0)