summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/jsx
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-11-01 21:30:23 +0100
committerGitHub <noreply@github.com>2023-11-01 20:30:23 +0000
commit587f2e0800a55e58b2579758d4278a4129b609c0 (patch)
treeafc3763fd3bd9f7bec35914b961cbb2877a4001f /cli/tests/testdata/jsx
parent658f958fb860e9ad3ea531f26f628f18f3bff63e (diff)
feat: precompile JSX (#20962)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
Diffstat (limited to 'cli/tests/testdata/jsx')
-rw-r--r--cli/tests/testdata/jsx/deno-jsx-precompile.jsonc6
-rw-r--r--cli/tests/testdata/jsx/import-map.json3
-rw-r--r--cli/tests/testdata/jsx/jsx-precompile/index.ts23
3 files changed, 31 insertions, 1 deletions
diff --git a/cli/tests/testdata/jsx/deno-jsx-precompile.jsonc b/cli/tests/testdata/jsx/deno-jsx-precompile.jsonc
new file mode 100644
index 000000000..95ae1b9f3
--- /dev/null
+++ b/cli/tests/testdata/jsx/deno-jsx-precompile.jsonc
@@ -0,0 +1,6 @@
+{
+ "compilerOptions": {
+ "jsx": "precompile",
+ "jsxImportSource": "jsx-precompile"
+ }
+}
diff --git a/cli/tests/testdata/jsx/import-map.json b/cli/tests/testdata/jsx/import-map.json
index baab76f20..1bfa04e2f 100644
--- a/cli/tests/testdata/jsx/import-map.json
+++ b/cli/tests/testdata/jsx/import-map.json
@@ -1,6 +1,7 @@
{
"imports": {
"jsx/jsx-runtime": "http://localhost:4545/jsx/jsx-runtime/index.ts",
- "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts"
+ "jsx/jsx-dev-runtime": "http://localhost:4545/jsx/jsx-dev-runtime/index.ts",
+ "jsx-precompile/jsx-runtime": "http://localhost:4545/jsx/jsx-precompile/index.ts"
}
}
diff --git a/cli/tests/testdata/jsx/jsx-precompile/index.ts b/cli/tests/testdata/jsx/jsx-precompile/index.ts
new file mode 100644
index 000000000..0d56095e0
--- /dev/null
+++ b/cli/tests/testdata/jsx/jsx-precompile/index.ts
@@ -0,0 +1,23 @@
+// deno-lint-ignore-file no-explicit-any
+export function jsx(
+ _type: any,
+ _props: any,
+ _key: any,
+ _source: any,
+ _self: any,
+) {}
+// deno-lint-ignore-file no-explicit-any
+export const jsxAttr = (name: string, value: any) => `${name}="${value}"`;
+// deno-lint-ignore-file no-explicit-any
+export const jsxTemplate = (_template: string[], ..._exprs: any[]) => "";
+// deno-lint-ignore-file no-explicit-any
+export const jsxEscape = (_value: any) => "";
+console.log("imported", import.meta.url);
+
+declare global {
+ namespace JSX {
+ interface IntrinsicElements {
+ [tagName: string]: Record<string, any>;
+ }
+ }
+}