Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sucrase

alangpierce51.2mMIT3.35.0TypeScript support: included

Super-fast alternative to Babel for when you can target modern JS runtimes

babel, jsx, typescript, flow

readme

Sucrase

Build Status npm version Install Size MIT License Join the chat at https://gitter.im/sucrasejs

Try it out

Quick usage

yarn add --dev sucrase  # Or npm install --save-dev sucrase
node -r sucrase/register main.ts

Using the ts-node integration:

yarn add --dev sucrase ts-node typescript
./node_modules/.bin/ts-node --transpiler sucrase/ts-node-plugin main.ts

Project overview

Sucrase is an alternative to Babel that allows super-fast development builds. Instead of compiling a large range of JS features to be able to work in Internet Explorer, Sucrase assumes that you're developing with a recent browser or recent Node.js version, so it focuses on compiling non-standard language extensions: JSX, TypeScript, and Flow. Because of this smaller scope, Sucrase can get away with an architecture that is much more performant but less extensible and maintainable. Sucrase's parser is forked from Babel's parser (so Sucrase is indebted to Babel and wouldn't be possible without it) and trims it down to a focused subset of what Babel solves. If it fits your use case, hopefully Sucrase can speed up your development experience!

Sucrase has been extensively tested. It can successfully build the Benchling frontend code, Babel, React, TSLint, Apollo client, and decaffeinate with all tests passing, about 1 million lines of code total.

Sucrase is about 20x faster than Babel. Here's one measurement of how Sucrase compares with other tools when compiling the Jest codebase 3 times, about 360k lines of code total:

            Time            Speed
Sucrase     0.57 seconds    636975 lines per second
swc         1.19 seconds    304526 lines per second
esbuild     1.45 seconds    248692 lines per second
TypeScript  8.98 seconds    40240 lines per second
Babel       9.18 seconds    39366 lines per second

Details: Measured on July 2022. Tools run in single-threaded mode without warm-up. See the benchmark code for methodology and caveats.

Transforms

The main configuration option in Sucrase is an array of transform names. These transforms are available:

  • jsx: Enables JSX syntax. By default, JSX is transformed to React.createClass, but may be preserved or transformed to _jsx() by setting the jsxRuntime option. Also adds createReactClass display names and JSX context information.
  • typescript: Compiles TypeScript code to JavaScript, removing type annotations and handling features like enums. Does not check types. Sucrase transforms each file independently, so you should enable the isolatedModules TypeScript flag so that the typechecker will disallow the few features like const enums that need cross-file compilation. The Sucrase option keepUnusedImports can be used to disable all automatic removal of imports and exports, analogous to TS verbatimModuleSyntax.
  • flow: Removes Flow type annotations. Does not check types.
  • imports: Transforms ES Modules (import/export) to CommonJS (require/module.exports) using the same approach as Babel and TypeScript with --esModuleInterop. If preserveDynamicImport is specified in the Sucrase options, then dynamic import expressions are left alone, which is particularly useful in Node to load ESM-only libraries. If preserveDynamicImport is not specified, import expressions are transformed into a promise-wrapped call to require.
  • react-hot-loader: Performs the equivalent of the react-hot-loader/babel transform in the react-hot-loader project. This enables advanced hot reloading use cases such as editing of bound methods.
  • jest: Hoist desired jest method calls above imports in the same way as babel-plugin-jest-hoist. Does not validate the arguments passed to jest.mock, but the same rules still apply.

When the imports transform is not specified (i.e. when targeting ESM), the injectCreateRequireForImportRequire option can be specified to transform TS import foo = require("foo"); in a way that matches the TypeScript 4.7 behavior with module: nodenext.

These newer JS features are transformed by default:

If your target runtime supports these features, you can specify disableESTransforms: true so that Sucrase preserves the syntax rather than trying to transform it. Note that transpiled and standard class fields behave slightly differently; see the TypeScript 3.7 release notes for details. If you use TypeScript, you can enable the TypeScript option useDefineForClassFields to enable error checking related to these differences.

Unsupported syntax

All JS syntax not mentioned above will "pass through" and needs to be supported by your JS runtime. For example:

  • Decorators, private fields, throw expressions, generator arrow functions, and do expressions are all unsupported in browsers and Node (as of this writing), and Sucrase doesn't make an attempt to transpile them.
  • Object rest/spread, async functions, and async iterators are all recent features that should work fine, but might cause issues if you use older versions of tools like webpack. BigInt and newer regex features may or may not work, based on your tooling.

JSX Options

By default, JSX is compiled to React functions in development mode. This can be configured with a few options:

  • jsxRuntime: A string specifying the transform mode, which can be one of three values:
    • "classic" (default): The original JSX transform that calls React.createElement by default. To configure for non-React use cases, specify:
      • jsxPragma: Element creation function, defaults to React.createElement.
      • jsxFragmentPragma: Fragment component, defaults to React.Fragment.
    • "automatic": The new JSX transform introduced with React 17, which calls jsx functions and auto-adds import statements. To configure for non-React use cases, specify:
      • jsxImportSource: Package name for auto-generated import statements, defaults to react.
    • "preserve": Don't transform JSX, and instead emit it as-is in the output code.
  • production: If true, use production version of functions and don't include debugging information. When using React in production mode with the automatic transform, this must be set to true to avoid an error about jsxDEV being missing.

Legacy CommonJS interop

Two legacy modes can be used with the imports transform:

  • enableLegacyTypeScriptModuleInterop: Use the default TypeScript approach to CommonJS interop instead of assuming that TypeScript's --esModuleInterop flag is enabled. For example, if a CJS module exports a function, legacy TypeScript interop requires you to write import * as add from './add';, while Babel, Webpack, Node.js, and TypeScript with --esModuleInterop require you to write import add from './add';. As mentioned in the docs, the TypeScript team recommends you always use --esModuleInterop.
  • enableLegacyBabel5ModuleInterop: Use the Babel 5 approach to CommonJS interop, so that you can run require('./MyModule') instead of require('./MyModule').default. Analogous to babel-plugin-add-module-exports.

Usage

Tool integrations

Usage in Node

The most robust way is to use the Sucrase plugin for ts-node, which has various Node integrations and configures Sucrase via tsconfig.json:

ts-node --transpiler sucrase/ts-node-plugin

For projects that don't target ESM, Sucrase also has a require hook with some reasonable defaults that can be accessed in a few ways:

  • From code: require("sucrase/register");
  • When invoking Node: node -r sucrase/register main.ts
  • As a separate binary: sucrase-node main.ts

Options can be passed to the require hook via a SUCRASE_OPTIONS environment variable holding a JSON string of options.

Compiling a project to JS

For simple use cases, Sucrase comes with a sucrase CLI that mirrors your directory structure to an output directory:

sucrase ./srcDir -d ./outDir --transforms typescript,imports

Usage from code

For any advanced use cases, Sucrase can be called from JS directly:

import {transform} from "sucrase";
const compiledCode = transform(code, {transforms: ["typescript", "imports"]}).code;

What Sucrase is not

Sucrase is intended to be useful for the most common cases, but it does not aim to have nearly the scope and versatility of Babel. Some specific examples:

  • Sucrase does not check your code for errors. Sucrase's contract is that if you give it valid code, it will produce valid JS code. If you give it invalid code, it might produce invalid code, it might produce valid code, or it might give an error. Always use Sucrase with a linter or typechecker, which is more suited for error-checking.
  • Sucrase is not pluginizable. With the current architecture, transforms need to be explicitly written to cooperate with each other, so each additional transform takes significant extra work.
  • Sucrase is not good for prototyping language extensions and upcoming language features. Its faster architecture makes new transforms more difficult to write and more fragile.
  • Sucrase will never produce code for old browsers like IE. Compiling code down to ES5 is much more complicated than any transformation that Sucrase needs to do.
  • Sucrase is hesitant to implement upcoming JS features, although some of them make sense to implement for pragmatic reasons. Its main focus is on language extensions (JSX, TypeScript, Flow) that will never be supported by JS runtimes.
  • Like Babel, Sucrase is not a typechecker, and must process each file in isolation. For example, TypeScript const enums are treated as regular enums rather than inlining across files.
  • You should think carefully before using Sucrase in production. Sucrase is mostly beneficial in development, and in many cases, Babel or tsc will be more suitable for production builds.

See the Project Vision document for more details on the philosophy behind Sucrase.

Motivation

As JavaScript implementations mature, it becomes more and more reasonable to disable Babel transforms, especially in development when you know that you're targeting a modern runtime. You might hope that you could simplify and speed up the build step by eventually disabling Babel entirely, but this isn't possible if you're using a non-standard language extension like JSX, TypeScript, or Flow. Unfortunately, disabling most transforms in Babel doesn't speed it up as much as you might expect. To understand, let's take a look at how Babel works:

  1. Tokenize the input source code into a token stream.
  2. Parse the token stream into an AST.
  3. Walk the AST to compute the scope information for each variable.
  4. Apply all transform plugins in a single traversal, resulting in a new AST.
  5. Print the resulting AST.

Only step 4 gets faster when disabling plugins, so there's always a fixed cost to running Babel regardless of how many transforms are enabled.

Sucrase bypasses most of these steps, and works like this:

  1. Tokenize the input source code into a token stream using a trimmed-down fork of the Babel parser. This fork does not produce a full AST, but still produces meaningful token metadata specifically designed for the later transforms.
  2. Scan through the tokens, computing preliminary information like all imported/exported names.
  3. Run the transform by doing a pass through the tokens and performing a number of careful find-and-replace operations, like replacing <Foo with React.createElement(Foo.

Because Sucrase works on a lower level and uses a custom parser for its use case, it is much faster than Babel.

Contributing

Contributions are welcome, whether they be bug reports, PRs, docs, tests, or anything else! Please take a look through the Contributing Guide to learn how to get started.

License and attribution

Sucrase is MIT-licensed. A large part of Sucrase is based on a fork of the Babel parser, which is also MIT-licensed.

Why the name?

Sucrase is an enzyme that processes sugar. Get it?

changelog

3.34.0 (2023-07-19)

  • Add CLI options for all remaining Sucrase options, e.g. --disable-es-transforms for disableESTransforms. (<<-ArS, Alan Pierce) (#670, #812)
  • Add SUCRASE_OPTIONS environment variable for configuring sucrase/register, sucrase-node, and any programmatic require hook usages. The value must be a valid JSON object of Sucrase options that will be merged with the usual options. (#813)

3.33.0 (2023-07-14)

  • Add an option keepUnusedImports that disables all automatic import/export elision, equivalent to the TypeScript option verbatimModuleSyntax. (#811, #615) (Kotaro Chikuba, Alan Pierce)
  • Add support for the await using proposal and the updated import attributes proposal. Both are preserved in the output code, not transformed. (#798)
  • Fix some issues with TypeScript automatic export elision in export {...} from statements. (#806)
    • Type names from the current file are no longer removed.
    • When all exports are type exports, the entire statement is now removed.
  • Fix bug where fn(x < y, x >= y) was incorrectly parsed as type arguments. (#798)
  • Fix a few bugs in enableLegacyBabel5ModuleInterop: properly handle as default, and properly ignore type exports. (#804, #807) (三咲智子 Kevin Deng, Alan Pierce)
  • Fix bug where parameters inside function types could be misinterpreted as declarations and result in imports being incorrectly marked as unused. (#809)
  • Fix bug where import {} and export {} statements were removed with the TypeScript transform disabled. (#810)
  • Make the transform behavior more forgiving when code accidentally has a return type annotation on a constructor. (#800)

3.32.0 (2023-04-08)

  • Improve source map quality by adding column information. This fixes several source map use cases, such as Jest inline snapshots, source map composition, and some debugger features. (#759) (Emily Marigold Klassen)
    • Unfortunately, this change comes at some performance cost. Previously, the slowdown from enabling source maps was about 10%, and now it is about 30%. In most cases, the more detailed source maps are probably still preferable, so for configuration simplicity, there is currently no option to switch back to source maps without column information. If you would like to still use the faster but less accurate implementation, feel free to file an issue to request a new config option, or create the source map yourself in wrapper code by copying the original simple implementation.

3.31.0 (2023-03-26)

  • Add option to recognize and preserve JSX syntax. (#788)
  • Fix default export interop behavior when using transpiled dynamic import() to import a plain CJS module. For example, if foo.js has module.exports = 1;, then await import('foo.js') will now evaluate to {default: 1} rather than just 1. Named exports behave the same as before. This change matches the behavior of Node.js and other transpilers, so it is considered a bug fix rather than breaking. If you relied on the old behavior, feel free to file an issue and it may be possible to roll back until the next semver-major release. (#789, #790)

3.30.0 (2023-03-20)

  • Add support for new syntax in TypeScript 5.0:
    • export type *. (#786)
    • const on type parameters. (#786)
  • Implement parsing for several ES proposals. These are preserved in the output code, not transformed.
    • Import reflection: import module. (#785)
    • Explicit resource management: using. (#785)
    • Decorator after export keyword: export @foo class .... (#786)
  • Fix parsing of << within a type. (#769)

3.29.0 (2022-11-16)

  • Add support for the TypeScript 4.9 satisfies operator. (#766)

3.28.0 (2022-10-05)

  • Add ts-node transpiler plugin, available as sucrase/ts-node-plugin. This makes it possible to use Sucrase with all ts-node features such as an ESM loader, a REPL, and configuration via tsconfig.json. (#729)

3.27.0 (2022-09-15)

  • Add support for assert {type: 'json'} in import statements. (#746)

3.26.0 (2022-09-12)

  • Add support for the JSX automatic runtime, also known as the React 17 transform. It can be enabled using jsxRuntime: true and configured using the production and jsxImportSource configs. (#738, #739, #742, #740)

3.25.0 (2022-08-01)

  • Add two new options to more closely match the module: nodenext option from TypeScript 4.7:
    • When using the imports transform, the new flag preserveDynamicImport will leave dynamic import() calls alone rather than compiling them to promise-wrapped require. This makes it possible to load ESM modules from CommonJS. (#727)
    • When not using the imports transform, the new flag injectCreateRequireForImportRequire will compile import foo = require("foo"); to use createRequire so that can work in a Node ES module. (#728)
  • When disableESTransforms is enabled, remove abstract fields in the same way that declare fields are removed. This matches TypeScript's behavior. (#732)

3.24.0 (2022-07-14)

  • Add support for all new syntax in TypeScript 4.7: (#719)
    • Instantiation expressions: const NumberSet = Set<number>;
    • extends on infer: T extends [infer S extends string, ...unknown[]] ? S : never;
    • Variance annotations: type Getter<out T> = () => T;
  • Add parsing support for the accessor keyword in ES decorators. (#716)
  • Fix invalid ESM output that sometimes happened when eliding TS star imports. (#723)
  • Fix lots of parser edge case bugs. Examples of code that confused the parser before but now works:
    • a as b ?? c (#721)
    • const a: Array<number>=[]; (#717)
    • f<<T>() => void>() (#716)
    • Some additional cases involving line break handling. (#714)
  • Fix some edge cases with JSX entity transformation. (#717)

3.23.0 (2022-07-01)

  • Add support for TS 4.5 import/export type modifiers. (#713)
  • Fix parsing bug that failed on scientific notation with dot access. (#711)

3.22.0 (2022-06-27)

  • Add support for Flow enums. (#708, #709)
  • Fix some parser bugs when detecting arrow functions. (#673)

3.21.1 (2022-06-21)

  • Allow re-export after star export of same name. (#698) (Cameron Pitt)

3.21.0 (2022-04-06)

  • Restructure package directory layout to better support ESM. (#684) (Neo Nie)

3.20.3 (2021-10-18)

  • Allow the names true, false, and null as TS enum keys. (#656, #657) (pushkine, Alan Pierce)
  • Properly handle TS definite assignment assertions for private fields and when disabling the class transform. (#658)

3.20.2 (2021-10-07)

  • Fix ASI issue that broke function declarations immediately following a default export. (#648) (Ben Lambert)

3.20.1 (2021-08-09)

  • Fix transformation of anonymous "export default" classes. (#614) (Matthieu Gicquel)
  • Handle shadowed globals when they are JSX names. (#642) (Matthieu Gicquel)

3.20.0 (2021-07-07)

  • Various small bug fixes and upcoming JS feature support in the parser. (#632, #635, #637)
  • Add support for TypeScript 4.2 abstract constructor signatures. (#635)
  • Add support for TypeScript 4.3 override, static index signatures, and get/set type members. (#636) (Lucas Garron, Alan Pierce)
  • Add support for Flow indexed access types and optional indexed access types. (#636, #637)

3.19.0 (2021-06-23)

  • Add option to disable ES transforms. (#623, #624, #625) (Denys Kniazevych, Alan Pierce)

3.18.2 (2021-06-07)

  • Properly handle imports like import {default as myFunc} from './myFunc'; when importing from files that are not ES modules. (#619) (Patrik Oldsberg)
  • Fix bug where other transforms were not being applied to enum value expressions, so enum declarations like A = EnumInOtherFile.A didn't work. (#621)

3.18.1 (2021-04-12)

  • Fix regression causing incomplete nullish coalescing and optional chaining in some cases. (#610)

3.18.0 (2021-04-11)

  • Add jest transform analogous to babel-plugin-jest-hoist. (#540) (Patrik Oldsberg)
  • When calling a register function or addHook, return a function that reverts the hook. (#604) (Anthony Fu)

3.17.1 (2021-01-31)

  • Fix bug where TS method overloads in a class would cause later class fields to not be handled properly. (#593)

3.17.0 (2020-12-29)

  • Fix incorrect export removal when exporting a variable defined using a destructure declaration. (#564)
  • Add support for new type syntax in TypeScript 4.1: template interpolations in string literal types and as to remap keys in mapped types. Also add parsing for static blocks and pass them through in the output. (#567)
  • Allow passing pirates options matcher and ignoreNodeModules when directly calling registerJS and related functions. (#571, #573) (Gordon Leigh)
  • Properly emit private class field declarations in the output code so that private fields can be used when they're supported by the target JS engine. (#574)
  • Fix parse error when a method or field has the name declare. (#575)

3.16.0 (2020-10-12)

  • Add support for TypeScript 4.0 type syntax: labeled tuples, catch clause unknown. (#556) (Patrik Oldsberg)

3.15.0 (2020-05-18)

  • Add support for declare class fields in TypeScript. (#537)

3.14.1 (2020-05-17)

  • Add support for export type {T} from './T'; type-only export syntax. (#533) (Patrik Oldsberg)

3.14.0 (2020-05-10)

  • Add support for TypeScript 3.8 type-only imports and exports. (#523, #532)
  • Add a --production flag to the CLI. (#529) (Matthew Phillips)
  • Fix crash when using + or - in constructor parameter defaults. (#531)

3.13.0 (2020-03-28)

  • Properly escape file paths in the react-hot-loader transform. (#512) (Jan Zípek)
  • Fix nullish coalescing when the RHS is an object literal. (#516)
  • Support reading CLI configuration from tsconfig.json. (#509, #519) (Jake Verbaten)

3.12.1 (2020-01-13)

  • Fix crash when parsing asserts b TypeScript return signatures. (#504)

3.12.0 (2020-01-01)

3.11.0 (2019-12-22)

  • Add runtime validation for options. (#468)
  • Allow .tsx and .jsx options when running sucrase from the command line. (#448) (Ricardo Tomasi, Alexander Mextner)
  • Fix bug where generator markers in methods were removed. (#463) (Bjørn Tore Håvie)

3.10.1 (2019-03-31)

  • Fix parsing of a<b>c in TypeScript. (#438)
  • Add support for new TypeScript 3.4 syntax, other parser improvements. (#439, #440)
  • Elide TS import = statements that are only used as a type. (#441)
  • Properly handle async arrow functions with multiline type parameters. (#443)

3.10.0 (2019-03-11)

  • Fix bug where /*/ was being parsed incorrectly. (#430)
  • Properly parse and compile JSX spread children. (#431)
  • Implement TypeScript export elision for exported types. (#433)

3.9.6 (2019-03-01)

  • Fix Flow bug where implements caused the class name to be incorrectly recognized. (#409)
  • Correctly handle !: in TS variable declarations. (#410)
  • Move more import code into helper functions in prep for some upcoming changes.
  • Fix bug where some JSX component names were incorrectly turned into strings. (#425) (Yang Zhang)

3.9.5 (2019-01-13)

  • Fix bug when processing a declaration that looks like an export assignment. (#402)
  • Fix TS import elision for JSX fragments and custom pragmas. (#403)
  • Treat reserved words as invalid identifiers when handling enums. (#405)

3.9.4 (2019-01-07)

  • Avoid false positive when detecting if a class has a superclass. (#399)

3.9.3 (2019-01-06)

  • Fix syntax error on arrow functions with multiline return types. (#393)

3.9.2 (2019-01-02)

  • Fix crash on optional arrow function params without type annotations. (#389)
  • Usability bug fixes for website. (#390)

3.9.1 (2018-12-31)

  • Fix react-hot-loader transform syntax error with some export styles. (#384)
  • Fix website to properly show react-hot-loader Babel transform output. (#386)

3.9.0 (2018-12-30)

  • Add a react-hot-loader transform. (#376)
  • Add support for dynamic import() syntax in TS types. (#380)
  • Many improvements to the website, including faster initial pageloads.
  • Small performance improvements.

3.8.1 (2018-12-03)

  • Fix infinite loop when a file ends with a short identifier (#363)
  • Small perf improvements.

3.8.0 (2018-11-25)

  • Various simplifications in prep for compiling the project with AssemblyScript.
  • Performance improvements, varying from 10% to 70% better performance depending on use case.
  • Fix infinite loop in flow declare module parsing (#359)

3.7.1 (2018-11-18)

  • Fix crash on empty export expressions (#338)
  • Fix crash on TypeScript declare global (#339)
  • Fix crash when using overloaded constructors in TypeScript (#340)
  • Fix TypeScript import elision when imported names are shadowed by variables (#342)
  • Fix import name transform to work in code without semicolons (#337) (Alec Larson)

3.7.0 (2018-11-11)

  • Fix perf regression in TypeScript parsing (#327)
  • Fix broken line numbers in syntax errors, improve parser backtracking performance (#331)
  • Add Parser features and bugfixes from the Babel parser, including TypeScript 3.0 support (#333)

3.6.0 (2018-10-29)

  • Add CLI support for jsx pragmas (#321) (Josiah Savary)
  • Allow super.method() calls in constructor (#324) (Erik Arvidsson)

3.5.0 (2018-09-30)

  • Change class field implementation to use initializer methods (#313)
  • Update TypeScript and Flow support to include new language features recently supported by Babel. (#314, #315, #316)
  • Properly handle function name inference in named exports (#317)

3.4.2 (2018-08-27)

  • Implement destructuring in export declarations (#305)
  • Properly handle function name inference in named exports (#308)

3.4.1 (2018-07-06)

  • Quote shorthand prop keys that contain a hyphen (#292) (Kevin Gao)
  • Fix infinite loop on incomplete JSX. (#296)

3.4.0 (2018-07-01)

  • Add a sucrase-node CLI that wraps node. (#288)
  • Allow exported generator functions. (#290)

3.3.0 (2018-06-28)

  • Add a --out-extension option to the CLI. (#282)
  • Add a -q/--quiet option in the CLI and use it in the build script. (#284)
  • Don't emit semicolons in class bodies. (#285)
  • Fix ugly emitted comments when removing code between tokens. (#286)

3.2.1 (2018-06-27)

  • Allow TS type parameters on object member methods. (#276)
  • Simplify identity source map generator. (#265)
  • Fix crash on destructured params in arrow function types. (#278)
  • Remove @flow directives from comments when the flow transform is enabled. (#279)

3.2.0 (2018-06-25)

  • Fix crash when using JSX elements as props. (#268) (Erik Arvidsson)
  • Fix incorrect compilation of TypeScript optional class properties with an initializer. (#264)
  • Fix crash on class fields that don't end in a semicolon. (#271)
  • Allow trailing commas after rest elements. (#272)
  • Don't crash on class bodies with an index signature. (#273)
  • Allow member expression identifiers when determining React displayName. (#274)
  • Add production option and use it for JSX. (#270) (Erik Arvidsson)
  • Fix off-by-one error in parsing JSX fragments. (#275)

3.1.0 (2018-06-18)

  • Add basic support for source maps (#257, #261)

3.0.1 (2018-06-11)

  • Fix crash in getVersion.

3.0.0 (2018-06-10)

Breaking Changes

  • transform now returns an object (#244). You now should write transform(...).code instead of just transform(...). code is the only property for now, but this allows Sucrase to return source maps and possibly other values.
  • The package's dist folder has been restructured, so direct internal module imports may break.

Other changes

  • Overhaul build system to use Sucrase for everything (#243)
  • Omit import helpers when unused (#237) (Alec Larson)
  • Fix files accidentally included in final package (#233)
  • Various refactors and performance improvements.

2.2.0 (2018-05-19)

  • Add support for JSX fragment syntax.
  • Add support for custom JSX pragmas rather than defaulting to React.createElement and React.Fragment.