A "fun" implementation of a JSX rendering engine similar to React's ... in the TypeScript type system.
MIT License
A "fun" implementation of a JSX rendering engine similar to React's ... in the TypeScript type system.
export type ComponentRegistry = {
Emoji: "💖";
Heading: "<h1>{children}</h1>";
};
export type Result = Render<"<Heading>Hello, world! <Emoji /></Heading>">;
export type PrintMe = Result;
// ^? type PrintMe = "<h1>Hello, world! 💖</h1>"
This walkthrough includes:
{children}
It does not include:
children
src/foundations
: Building up most of the general TypeScript syntax features we'll use to implement our JSX renderersrc/fun
: Building up the JSX renderer using the foundational featuresSee the README.md
files within each step, such as src/foundations/0-types/README.md
.