liveBook · Manning

Transpilation

As explained in Acing the Frontend Interview

Transpilation is the translation of source code from one programming language or language level into another compatible form.

Transpilation turns source syntax into code its target environment can execute. A practical interview question is: “Can browsers understand JSX directly?” No. Tools such as Babel or esbuild convert JSX into plain JavaScript, usually calls to React’s createElement function. section 4.1

Explain the JSX build step

Given `const App = <h1>Hello, World!</h1>;`, explain that the HTML-like syntax is for developers, not browser execution. The transpilation step produces JavaScript; generated source maps link that output back to the JSX so browser developer tools can show the original code while debugging. section 4.1

TypeScript presents a different follow-up: is transpilation always a required manual step? Traditionally, tools such as `tsc` produced JavaScript. Newer Node.js versions can instead execute supported TypeScript syntax using type stripping. Syntax that requires transformation, such as enums, has a separate experimental option. Describe the version and syntax involved rather than claiming every TypeScript file runs unchanged. section 3.11

Two Node.js flags make that distinction concrete:

  • `node --experimental-strip-types example.ts` uses experimental type stripping, introduced in Node.js v22.6.0; the flag is enabled by default starting in v23. section 3.11
  • `node --experimental-transform-types example.ts` uses the transformation option added in v22.7.0 for TypeScript-only syntax such as enums. section 3.11

How Acing the Frontend Interview covers it

How deep it goes
Explains JSX output, source maps, and version-specific TypeScript alternatives, but does not walk through a transpiler’s implementation.
Examples
Uses a JSX heading, Babel or esbuild output, and Node.js commands for stripping or transforming TypeScript syntax.
What it assumes
Assumes familiarity with JSX and TypeScript while supplying the browser-compatibility explanation rather than teaching compiler construction from zero.
What you can do after
Evaluate/understand when JSX requires transpilation and when supported TypeScript syntax can run through Node.js type stripping or transformation.
How it connects
Connects transpilation to JSX, React elements, source maps, TypeScript type stripping, and JavaScript execution.

Also explained in

Compare how 6 books explain transpilation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Frontend Interview. The section links point to the parts of the book it draws on.