evanw/esbuild
### [`v0.14.38`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01438)
[Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.37...v0.14.38)
- Further fixes to TypeScript 4.7 instantiation expression parsing ([#2201](https://togithub.com/evanw/esbuild/issues/2201))
This release fixes some additional edge cases with parsing instantiation expressions from the upcoming version 4.7 of TypeScript. Previously it was allowed for an instantiation expression to precede a binary operator but with this release, that's no longer allowed. This was sometimes valid in the TypeScript 4.7 beta but is no longer allowed in the latest version of TypeScript 4.7. Fixing this also fixed a regression that was introduced by the previous release of esbuild:
| Code | TS 4.6.3 | TS 4.7.0 beta | TS 4.7.0 nightly | esbuild 0.14.36 | esbuild 0.14.37 | esbuild 0.14.38 |
|----------------|--------------|---------------|------------------|-----------------|-----------------|-----------------|
| `a == c` | Invalid | `a == c` | Invalid | `a == c` | `a == c` | Invalid |
| `a in c` | Invalid | Invalid | Invalid | Invalid | `a in c` | Invalid |
| `a>=c` | Invalid | Invalid | Invalid | Invalid | `a >= c` | Invalid |
| `a=c` | Invalid | `a < b >= c` | `a = c` | `a < b >= c` | `a = c` | `a = c` |
| `a>c` | `a < b >> c` | `a < b >> c` | `a < b >> c` | `a < b >> c` | `a > c` | `a < b >> c` |
This table illustrates some of the more significant changes between all of these parsers. The most important part is that esbuild 0.14.38 now matches the behavior of the latest TypeScript compiler for all of these cases.
### [`v0.14.37`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01437)
[Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.36...v0.14.37)
- Add support for TypeScript's `moduleSuffixes` field from TypeScript 4.7
The upcoming version of TypeScript adds the `moduleSuffixes` field to `tsconfig.json` that introduces more rules to import path resolution. Setting `moduleSuffixes` to `[".ios", ".native", ""]` will try to look at the the relative files `./foo.ios.ts`, `./foo.native.ts`, and finally `./foo.ts` for an import path of `./foo`. Note that the empty string `""` in `moduleSuffixes` is necessary for TypeScript to also look-up `./foo.ts`. This was announced in the [TypeScript 4.7 beta blog post](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#resolution-customization-with-modulesuffixes).
- Match the new ASI behavior from TypeScript nightly builds ([#2188](https://togithub.com/evanw/esbuild/pull/2188))
This release updates esbuild to match some very recent behavior changes in the TypeScript parser regarding automatic semicolon insertion. For more information, see TypeScript issues [#48711](https://togithub.com/evanw/esbuild/issues/48711) and [#48654](https://togithub.com/evanw/esbuild/issues/48654) (I'm not linking to them directly to avoid Dependabot linkback spam on these issues due to esbuild's popularity). The result is that the following TypeScript code is now considered valid TypeScript syntax:
```ts
class A {}
new A /* ASI now happens here */
if (0) {}
interface B {
(a: number): typeof a /* ASI now happens here */
(): void
}
```
This fix was contributed by [@g-plane](https://togithub.com/g-plane).
Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, click this checkbox.
This PR contains the following updates:
0.14.36
->0.14.38
Release Notes
evanw/esbuild
### [`v0.14.38`](https://togithub.com/evanw/esbuild/blob/HEAD/CHANGELOG.md#01438) [Compare Source](https://togithub.com/evanw/esbuild/compare/v0.14.37...v0.14.38) - Further fixes to TypeScript 4.7 instantiation expression parsing ([#2201](https://togithub.com/evanw/esbuild/issues/2201)) This release fixes some additional edge cases with parsing instantiation expressions from the upcoming version 4.7 of TypeScript. Previously it was allowed for an instantiation expression to precede a binary operator but with this release, that's no longer allowed. This was sometimes valid in the TypeScript 4.7 beta but is no longer allowed in the latest version of TypeScript 4.7. Fixing this also fixed a regression that was introduced by the previous release of esbuild: | Code | TS 4.6.3 | TS 4.7.0 beta | TS 4.7.0 nightly | esbuild 0.14.36 | esbuild 0.14.37 | esbuild 0.14.38 | |----------------|--------------|---------------|------------------|-----------------|-----------------|-----------------| | `a == cConfiguration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.