From 3acdd07b373a479c09f0fd660a982e8774137e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Thu, 30 Nov 2023 17:35:39 +0100 Subject: [PATCH 1/2] revert work-around from https://github.com/observablehq/cli/commit/262d2ef73c8e966fa9284c611735aa741b787c65#diff-3c1c78fbccf841ecda30fc632b85abd36bd1a172918d5cad21fcbfea3f74a321 --- src/client/main.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/client/main.js b/src/client/main.js index a331c2799..3ac26b5e9 100644 --- a/src/client/main.js +++ b/src/client/main.js @@ -11,9 +11,8 @@ const runtime = new Runtime(library); export const main = runtime.module(); const attachedFiles = new Map(); -function resolveFile(name) { - return attachedFiles.get(name); -} +const resolveFile = (name) => attachedFiles.get(name); +main.builtin("FileAttachment", runtime.fileAttachments(resolveFile)); const databaseTokens = new Map(); async function resolveDatabaseToken(name) { @@ -22,11 +21,6 @@ async function resolveDatabaseToken(name) { return token; } -// https://github.com/observablehq/cli/issues/190 -const FileAttachment = runtime.fileAttachments(resolveFile); -FileAttachment.prototype.url = async function() { return String(new URL(await this._url, location)); }; // prettier-ignore -main.builtin("FileAttachment", FileAttachment); - export const cellsById = new Map(); // TODO hide export function define(cell) { From 28c58e4d784a5a83e78c9836faf67f59198fc7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Thu, 30 Nov 2023 18:14:18 +0100 Subject: [PATCH 2/2] upgrade runtime closes #190 --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index dea127d09..1f9513efd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -252,17 +252,17 @@ isoformat "^0.2.0" "@observablehq/runtime@^5.9.4": - version "5.9.4" - resolved "https://registry.yarnpkg.com/@observablehq/runtime/-/runtime-5.9.4.tgz#2436ced2ab09b27959dcc07ace96307d86902981" - integrity sha512-r+2TjUH4oZlTkmZnk0tj4kgAe1C2O+KVPjWqxH/6G5fF38UAYlUf/+ONFmLotsXs0BkqHKXIui5U8dMdeMkncw== + version "5.9.5" + resolved "https://registry.yarnpkg.com/@observablehq/runtime/-/runtime-5.9.5.tgz#96032d2e0fb8d3c0cb35fbc84229e21b710e70d8" + integrity sha512-cVjqjhwiDBsX9TokNCsg/+H+74JvneX58ExF8mUAtNVkBN7+eaiqYP450xaObruSwEbdm3+IuJe/gTrcET98dg== dependencies: "@observablehq/inspector" "^5.0.0" "@observablehq/stdlib" "^5.0.0" "@observablehq/stdlib@^5.0.0": - version "5.8.3" - resolved "https://registry.yarnpkg.com/@observablehq/stdlib/-/stdlib-5.8.3.tgz#5ddd760c60aa9102c9b1323230cbe4c9da248d3d" - integrity sha512-XmuwqzAMZ8H0ICJfzd5wV3WD6nLlC2XwhMIdu2QDZppTSxGafATMSbgZ2JaiNPCejenkpERGmoC3W83FUGuNeg== + version "5.8.4" + resolved "https://registry.yarnpkg.com/@observablehq/stdlib/-/stdlib-5.8.4.tgz#31db8c79559cb707347656f87975a030d6dbc687" + integrity sha512-AcYclKQPLv9JJTinZ9kbEYYMGM+hGf2qpZ6nr41FjbZdF6+sxFdFNnW3l9reZ+xJ8iOpp0UHa4MvN08v5FtcRQ== dependencies: d3-array "^3.2.0" d3-dsv "^3.0.1"