Skip to content

[1.15.0] Node 12, Jest 27, TypeScript 4.3, SWC

Compare
Choose a tag to compare
@onigoetz onigoetz released this 07 Jun 12:51
· 1507 commits to master since this release

Highlights

  • Update from Jest 26 to Jest 27
  • TypeScript 4.3
  • Removed Support for Node 10
  • Added support for SWC to replace Babel
  • Babel Update to 7.14
  • Replace eslint-loader with eslint-webpack-plugin

Update from Jest 26 to Jest 27

Jest 27 is out, I'll invite you to read the release blog post to read more about it.

One thing that changes for Crafty users is that by default the test environment is changed from jsdom to node

If you have tests involving DOM elements, I'll invite you to change the following configuration in your crafty.config.js to get the previous behaviour:

jest(crafty, options) {
  options.testEnvironment = "jsdom";
}

The jsdom environment is heavier to start than the node environment, thus if you don't specifically need it, the new default should make your tests run faster.

TypeScript 4.3

TypeScript 4.3 is out, a few new features on this one

Check their release notes for the details

Removed Support for Node 10

Node 10 is out of support, some of our dependencies dropped its support which encouraged us to drop it as well.
Crafty is now tested and works on Node 12, 14 and 16

Added support for SWC to replace Babel

swc is a typescript / javascript compiler. It is similar to Babel but written in Rust, and is ~20x faster than babel on single thread.

swc also supports compiling TypeScript, but this feature isn't implemented in Crafty yet.

Today you can use @swissquote/crafty-preset-swc to replace @swissquote/crafty-preset-babel it works with the Webpack, Rollup and Gulp runners.

Check the documentation

Replace eslint-loader with eslint-webpack-plugin

A mostly internal change, eslint-loader was replaced with eslint-webpack-plugin. It now leverages ESLint's cache and lints only changed files.