Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"config": {
"entry": [
{
"import": "input/index.tsx",
"name": "main",
"library": {
"name": "ClassicJsxProvider"
}
}
],
"react": {
"runtime": "classic"
},
"provider": {
"React": ["./react.js", "providedReact"],
"h": ["./react.js", "providedFactory"]
}
},
"runtimeType": "dummy"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const React: any;

export const ambient = <section>ambient declaration</section>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function jsx(type, props) {
return { factory: "automatic", type, children: [props.children] };
}

export { jsx as jsxs };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/** @jsxRuntime automatic */
/** @jsxImportSource ./automatic-runtime */
export const automatic = <section>automatic directive</section>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const bareJsx = <section>jsx</section>;
export const fragmentJsx = <>jsx fragment</>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if (1 < 2) {
module.exports = 42;
return;
}
module.exports = 0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @jsx factory */
/** @jsxFrag fragment */
const fragment = "custom-fragment";
function factory(type, props, ...children) {
return { factory: "custom", type, children };
}

export const custom = <>custom pragma</>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @jsx h */
export const providedFactory = <section>provided factory</section>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { importedReact as React } from "./react";

export const imported = <section>imported binding</section>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const bareTsx = <section>tsx</section>;
export const fragmentTsx = <>tsx fragment</>;
export { bareJsx, fragmentJsx } from "./bare";
export { imported } from "./imported";
export { typeImport } from "./type-import";
export { typeNamespace } from "./type-namespace";
export { valueNamespace } from "./value-namespace";
export { ambient } from "./ambient";
export { custom } from "./custom";
export { providedFactory } from "./factory";
export { automatic } from "./automatic";
export { default as commonJS } from "./commonjs";
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function createReact(factory) {
return {
Fragment: `${factory}-fragment`,
createElement(type, props, ...children) {
return { factory, type, children };
},
};
}

export const providedReact = createReact("provider");
export const importedReact = createReact("imported");

export function providedFactory(type, props, ...children) {
return { factory: "provided factory", type, children };
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type React from "./react";

export const typeImport = <section>type import</section>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace React {
export interface Props {}
}

export const typeNamespace = <section>type namespace</section>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace React {
export function createElement(type, props, ...children) {
return { factory: "namespace", type, children };
}
}

export const valueNamespace = <section>value namespace</section>;

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

Loading
Loading