Skip to content

Commit b645067

Browse files
committed
Updated coincident to its latest v4
1 parent 0276e9a commit b645067

File tree

9 files changed

+110
-114
lines changed

9 files changed

+110
-114
lines changed

docs/index.js

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

docs/index.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.

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
});

0 commit comments

Comments
 (0)