What is Transpilation? An Intro to Transpilers vs Compilers

You may have heard the term transpilation before, but just to be sure that everyone is on the same page I'll explain what it is and why it's needed.

Transpilation is a process of transforming one code into another code, mostly human-readable code in one version of a language into another version or another language. Many people prefer using the word "compile", which is also correct, but let's stick to "transpilation" for this lesson.

Examples of use cases for transpilation would be:

  • from one programming language into equivalent code in another programming language

  • from older versions to newer version of a language - for example a transpiler that supports Python could transpile code from Python 2 into Python 3

  • from modern syntax towards an older version of syntax for backward compatibility

  • refactorings, migrations etc can be automated in some cases when you have a proper transpiler at hand

So what are the common examples of transpilers in the JavaScript ecosystem?

This lesson preview is part of the The newline Guide to Creating a React Hooks Library course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

Unlock This Course

Get unlimited access to The newline Guide to Creating a React Hooks Library, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course The newline Guide to Creating a React Hooks Library