Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): 28.0.0 #3490

Merged
merged 1 commit into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 9 additions & 55 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,18 @@
# [28.0.0-next.3](https://github.com/kulshekhar/ts-jest/compare/v28.0.0-next.2...v28.0.0-next.3) (2022-04-29)
# [28.0.0](https://github.com/kulshekhar/ts-jest/compare/v28.0.0-next.3...v28.0.0) (2022-05-02)


### Bug Fixes

* **compiler:** bring back compiled output with inline sourcemap ([#3483](https://github.com/kulshekhar/ts-jest/issues/3483)) ([e96d5b3](https://github.com/kulshekhar/ts-jest/commit/e96d5b3c94348774011ac76e91bf746a3429ade0)), closes [#3482](https://github.com/kulshekhar/ts-jest/issues/3482)



# [28.0.0-next.2](https://github.com/kulshekhar/ts-jest/compare/v28.0.0-next.1...v28.0.0-next.2) (2022-04-27)


### Bug Fixes

* revert deprecation message for `TsJestTransformer` ([#3466](https://github.com/kulshekhar/ts-jest/issues/3466)) ([cefa0da](https://github.com/kulshekhar/ts-jest/commit/cefa0da660c4f99cf6595e253981af6855bcc80c))
* **legacy** invoke Babel `processAsync` for `babel-jest` in ESM mode instead of `process` ([#3430](https://github.com/kulshekhar/ts-jest/issues/3430)) ([0d7356c](https://github.com/kulshekhar/ts-jest/commit/0d7356cd767a924e5b57e3a93679eef4ca8fae51))


### Features

* **presets:** add presets for legacy mode ([#3465](https://github.com/kulshekhar/ts-jest/issues/3465)) ([543b4ad](https://github.com/kulshekhar/ts-jest/commit/543b4ad729d20fbd46a2de5cd4660dc50b94ebe7))



# [28.0.0-next.1](https://github.com/kulshekhar/ts-jest/compare/v28.0.0-next.0...v28.0.0-next.1) (2022-04-26)


### Features

* mark `ConfigSet` as legacy ([#3456](https://github.com/kulshekhar/ts-jest/issues/3456)) ([a986729](https://github.com/kulshekhar/ts-jest/commit/a98672977a679d1ed882605a3e71ed405432ffdc))
* mark `TsCompiler` and `TsJestCompiler` as legacy ([#3457](https://github.com/kulshekhar/ts-jest/issues/3457)) ([0f2fe30](https://github.com/kulshekhar/ts-jest/commit/0f2fe306762d8549bd29737becd4aed14a650427))
* remove `path-mapping` AST transformer ([#3455](https://github.com/kulshekhar/ts-jest/issues/3455)) ([f566869](https://github.com/kulshekhar/ts-jest/commit/f5668698f8fab78b3008d936aa5001f134f530e2))
* set Jest peer dependencies to v28 ([#3454](https://github.com/kulshekhar/ts-jest/issues/3454)) ([1e880ff](https://github.com/kulshekhar/ts-jest/commit/1e880fffe82bca231d1d23f6508f4ab4bc31e03e))


### BREAKING CHANGES

* `path-mapping` AST transformer is no longer shipped in `ts-jest` v28. Please use an alternative one like https://github.com/LeDDGroup/typescript-transform-paths instead.
* Any imports `ts-jest/dist/compiler/ts-compiler` should change to `ts-jest/dist/legacy/compiler/ts-compiler`
* Any imports `ts-jest/dist/compiler/ts-jest-compiler` should change to `ts-jest/dist/legacy/compiler/ts-jest-compiler`
* Any imports `ts-jest/dist/config/config-set` should change to `ts-jest/dist/legacy/config/config-set



# [28.0.0-next.0](https://github.com/kulshekhar/ts-jest/compare/v27.1.3...v28.0.0-next.0) (2022-04-24)


### Bug Fixes

* **legacy** invoke Babel `processAsync` for `babel-jest` in ESM mode instead of `process` ([#3430](https://github.com/kulshekhar/ts-jest/issues/3430)) ([0d7356c](https://github.com/kulshekhar/ts-jest/commit/0d7356cd767a924e5b57e3a93679eef4ca8fae51))


### Features

* **core:** drop support for Node.js 10 ([#3332](https://github.com/kulshekhar/ts-jest/issues/3332)) ([7a9aa61](https://github.com/kulshekhar/ts-jest/commit/7a9aa615ea0be881105676a17d5bd655afdc27f5))
* **core:** remove `mocked` testing util ([#3333](https://github.com/kulshekhar/ts-jest/issues/3333)) ([2d9017d](https://github.com/kulshekhar/ts-jest/commit/2d9017ddfea39f45aa991876b314d1dbe4a36aad))
* **core:** remove `ts-jest/utils` sub path export ([#3334](https://github.com/kulshekhar/ts-jest/issues/3334)) ([9f253d3](https://github.com/kulshekhar/ts-jest/commit/9f253d31dfcefa35ae00049d0d2dc4a3fe1b2f34))
Expand All @@ -59,23 +21,15 @@

### BREAKING CHANGES

* Minimum support TypeScript version is now **4.3** since Jest 28 requires it
* Jest 28 is required
* `path-mapping` AST transformer is no longer shipped in `ts-jest` v28. Please use an alternative one like https://github.com/LeDDGroup/typescript-transform-paths instead.
* Any imports `ts-jest/dist/compiler/ts-compiler` should change to `ts-jest/dist/legacy/compiler/ts-compiler`
* Any imports `ts-jest/dist/compiler/ts-jest-compiler` should change to `ts-jest/dist/legacy/compiler/ts-jest-compiler`
* Any imports `ts-jest/dist/config/config-set` should change to `ts-jest/dist/legacy/config/config-set`
* Minimum support `TypeScript` version is now **4.3** since Jest 28 requires it.
* **Jest 28** is required.
* **core:** Any imports `ts-jest/utils` should be replaced with `ts-jest`.
* **core:** Starting from Jest 27.4, `mocked` has been integrated into Jest repo.
* **core:** Support for Node.js v10 has been removed as Jest drops support for it
* All presets now will they are preserved for refactored codes. If you wish to use the old codes, please do the following
*
```diff
// jest.config.js
module.exports = {
// [...]
- preset: 'ts-jest', // or 'js-with-babel'/'js-with-ts'
+ transform: {
'^.+\\.tsx?$': 'ts-jest/legacy' // or '^.+\\.[tj]sx?$': 'ts-jest' to use legacy codes
}
}
```
* **core:** Support for Node.js v10 has been removed as Jest drops support for it.



Expand Down
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-jest",
"version": "28.0.0-next.3",
"version": "28.0.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/getting-started/presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Presets

:::important

Starting from **v28.0.0**, `ts-jest` will gradually switch to `esbuild`/`swc` to transform `ts` to `js`. To make the transition smoothly, we introduce `legacy` presets as a fallback when the new codes don't work yet.
Starting from **v28.0.0**, `ts-jest` will gradually opt in adoption of `esbuild`/`swc` more to improve the performance. To make the transition smoothly, we introduce `legacy` presets as a fallback when the new codes don't work yet.

:::

Expand Down
76 changes: 76 additions & 0 deletions website/versioned_docs/version-28.0/babel7-or-ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
id: babel7-or-ts
title: Babel7 or TypeScript
---

In Sept. 2018 Babel7 got released with an interesting preset: `@babel/preset-typescript`.

The goal is to make it easy for users using Babel to try TypeScript without moving out from Babel, just by adding a preset in their Babel config (here is the [MSDN blog post](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/) about TypeScript and Babel 7).

## Limitations

While `@babel/preset-typescript` is a great preset, you must know the limitation of it. Here is what is possible with TypeScript (and `ts-jest`), which is not with Babel7 and `@babel/preset-typescript`:

#### No type-checking

This is the big **PRO** of using TypeScript vs Babel, you have type-checking out of the box.

You'll get a more fluent TDD experience (when using `ts-jest`) since files will be type-checked at the same time they're compiled and ran.

Here TypeScript will throw while Babel won't:

```ts
const str: string = 42
```

With Babel, files are transpiled as isolated modules, there is no notion of "project". With TypeScript, files are part of a project and are compiled in that scope.

---

#### No `namespace`

```ts
namespace app {
export const VERSION = '1.0.0'
export class App {
/* ... */
}
}
```

---

#### No `const enum`

```ts
const enum Directions {
Up,
Down,
Left,
Right,
}
```

---

#### No declaration merging (`enum`, `namespace`, ...)

You won't be able to do [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html).

---

#### No legacy `import`/`export`

```ts
import lib = require('lib')
// ...
export = myVar
```

---

#### No caret type-casting with JSX enabled

```ts
const val = <string>input
```