summaryrefslogtreecommitdiff
path: root/cli/tests/import_blob_url_jsx.ts
diff options
context:
space:
mode:
authorLuca Casonato <lucacasonato@yahoo.com>2021-04-07 15:22:14 +0200
committerGitHub <noreply@github.com>2021-04-07 15:22:14 +0200
commit966ce7de8a23f63d0f30b1748fe69ccaf07519e0 (patch)
tree3275ca96a835fe91a62a73d5a4c83bf6ca917b66 /cli/tests/import_blob_url_jsx.ts
parent2865f39bec6da135a2d2d679a65e7ff139131bd7 (diff)
feat: blob URL support (#10045)
This commit adds blob URL support. Blob URLs are stored in a process global storage, that can be accessed from all workers, and the module loader. Blob URLs can be created using `URL.createObjectURL` and revoked using `URL.revokeObjectURL`. This commit does not add support for `fetch`ing blob URLs. This will be added in a follow up commit.
Diffstat (limited to 'cli/tests/import_blob_url_jsx.ts')
-rw-r--r--cli/tests/import_blob_url_jsx.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/tests/import_blob_url_jsx.ts b/cli/tests/import_blob_url_jsx.ts
new file mode 100644
index 000000000..8d645796a
--- /dev/null
+++ b/cli/tests/import_blob_url_jsx.ts
@@ -0,0 +1,16 @@
+const blob = new Blob(
+ ["export default function() {\n return <div>Hello Deno!</div>\n}\n"],
+ { type: "text/jsx" },
+);
+const url = URL.createObjectURL(blob);
+
+const { default: render } = await import(url);
+
+// deno-lint-ignore no-explicit-any
+(globalThis as any).React = {
+ createElement(...args: unknown[]) {
+ console.log(...args);
+ },
+};
+
+render();