Skip to content

Updated coincident to its latest v4 #136

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion docs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/service-worker.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import s from"https://cdn.jsdelivr.net/npm/sabayon/dist/polyfill.js";if(!globalThis.crossOriginIsolated){const{isArray:r}=Array,t=s=>s.length&&"object"==typeof s[0]&&null!==s[0];globalThis.Blob=class extends Blob{constructor(s,...e){t(e)&&"text/javascript"===e[0].type&&r(s)&&"string"==typeof s.at(0)&&(s[0]=s[0].replace(/^\/\*@\*\//,'import "https://cdn.jsdelivr.net/npm/sabayon/dist/polyfill.js";')),super(s,...e)}},globalThis.Worker=class extends Worker{constructor(r,...e){if(t(e)){const r=e[0].serviceWorker||e[0].service_worker;r&&s(r)}super(r,...e)}}}

3 changes: 3 additions & 0 deletions docs/toml-BK2RWy-G.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/toml-BK2RWy-G.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion docs/toml-CkEFU7ly.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,3 @@ const parse = toml => {
/* c8 ignore stop */

export { parse };
//# sourceMappingURL=toml-CkEFU7ly.js.map
2 changes: 1 addition & 1 deletion docs/toml-DiUM0_qs.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/zip-BKVoQflw.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/zip-BKVoQflw.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/zip-CAMAhqMX.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/zip-CAMAhqMX.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions esm/interpreter/_python.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as FLATTED from 'coincident/flatted';
const JSON = { parse: FLATTED.decode, stringify: FLATTED.encode };
import * as DIRECT from 'reflected-ffi/direct';
const JSON = { parse: DIRECT.decode, stringify: DIRECT.encode };

import { fetchFiles, fetchJSModules, fetchPaths } from './_utils.js';
import { IDBMapSync, dedent } from '../utils.js';
Expand Down
10 changes: 4 additions & 6 deletions esm/interpreter/webr.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
import { create } from 'gc-hook';
import { dedent } from '../utils.js';
import { fetchFiles, fetchJSModules, fetchPaths } from './_utils.js';
import { io, stdio } from './_io.js';

const type = 'webr';
const r = new WeakMap();
const fr = new FinalizationRegistry(fn => fn());

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

export default {
type,
experimental: true,
module: (version = '0.5.0') =>
module: (version = '0.5.1') =>
`https://cdn.jsdelivr.net/npm/webr@${version}/dist/webr.mjs`,
async engine(module, config, _, baseURL) {
const { get } = stdio();
Expand Down
Loading