Transfiler is quite unfamiliar to me. As a big fan of Rust, I never heard about the Transfiler (But it doesn't mean that I understand the compiler very wellㅠ). Let's look around the Transfiler.
Transfiler converts from programming language(or version) to similar level of language. Different with Compiler, Transfiler converts high level language -> high level language
Newest ESNext JS -> Old version of ES5 codeJSX -> React.createElementTypeScript -> Vanilla JSoptional chaining(?.) -> code with IF branchesAST(Abstract Syntax Tree)CallExpression(React.createElement, ...) nodePrettier to insert spaces, line breaks, and semicolons
function Title() {
return <h1 className="title">Hello</h1>;
}
JSXElement node foundJSXElement -> React.createElement(
"h1",
{ className: "title" },
"Hello"
);
function Title() {
return React.createElement("h1", { className: "title" }, "Hello");
}