transpilation
Translating source code into equivalent code in another form of the same language level, such as turning JSX into plain JavaScript.
In more detail
A tool reads source files at build time and writes out code the target environment can run, for example removing TypeScript types or rewriting new syntax for older browsers. Babel, the TypeScript compiler and bundler plugins all transpile.
Example
For React this mainly means replacing every JSX tag with a call to the jsx function.Related terms
- JSX — The HTML-like syntax used in React code, such as <Button size="lg">Save</Button>, which compiles to JavaScript function calls.
- Babel — A widely used JavaScript compiler that rewrites modern syntax, JSX and TypeScript into JavaScript that browsers can run.
- JSX runtime — The small module that compiled JSX calls, so each tag becomes a jsx function call imported automatically from react/jsx-runtime.
- compiler — A program that translates source code a person wrote into a form a machine or runtime can execute, checking it for errors on the way.
Taught in
- JSX Transpilation: createElement, JSX Runtime, React Elements — React 19 & Modern Component Architecture