Further fixes to TypeScript 4.7 instantiation expression parsing (#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<b> == c<d>
Invalid
a == c
Invalid
a == c
a == c
Invalid
a<b> in c<d>
Invalid
Invalid
Invalid
Invalid
a in c
Invalid
a<b>>=c<d>
Invalid
Invalid
Invalid
Invalid
a >= c
Invalid
a<b>=c<d>
Invalid
a < b >= c
a = c
a < b >= c
a = c
a = c
a<b>>c<d>
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
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.
Match the new ASI behavior from TypeScript nightly builds (#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 and #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:
class A<T> {}
new A<number> /* ASI now happens here */
if (0) {}
interface B {
(a: number): typeof a /* ASI now happens here */
<T>(): void
}
This release reverts the path metadata validation that was introduced in the previous release. This validation has uncovered a potential issue with how esbuild handles onResolve callbacks in plugins that will need to be fixed before path metadata validation is re-enabled.
v0.14.35
Add support for parsing typeof on #private fields from TypeScript 4.7 (#2174)
The upcoming version of TypeScript now lets you use #private fields in typeof type expressions:
Further fixes to TypeScript 4.7 instantiation expression parsing (#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<b> == c<d>
Invalid
a == c
Invalid
a == c
a == c
Invalid
a<b> in c<d>
Invalid
Invalid
Invalid
Invalid
a in c
Invalid
a<b>>=c<d>
Invalid
Invalid
Invalid
Invalid
a >= c
Invalid
a<b>=c<d>
Invalid
a < b >= c
a = c
a < b >= c
a = c
a = c
a<b>>c<d>
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.
0.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.
Match the new ASI behavior from TypeScript nightly builds (#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 and #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:
class A<T> {}
new A<number> /* ASI now happens here */
if (0) {}
interface B {
(a: number): typeof a /* ASI now happens here */
<T>(): void
}
This release reverts the path metadata validation that was introduced in the previous release. This validation has uncovered a potential issue with how esbuild handles onResolve callbacks in plugins that will need to be fixed before path metadata validation is re-enabled.
0.14.35
Add support for parsing typeof on #private fields from TypeScript 4.7 (#2174)
The upcoming version of TypeScript now lets you use #private fields in typeof type expressions:
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps esbuild from 0.13.12 to 0.14.38.
Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
e7a9572
publish 0.14.38 to npm1a57168
fix #2201: more ts instantiation expression fixes980c9ae
publish 0.14.37 to npm1d71dff
Make TS InstantiationExpr parsing more permissive (#2188)ba3f604
allow ASI before<
in typescript type parameters0818e03
supportmoduleSuffixes
intsconfig.json
962eed8
publish 0.14.36 to npma6d80fc
fix #2177: Revert "check for consistent path metadata from plugins"757d7d9
quoted comma separated string array helperebcb111
publish 0.14.35 to npmDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)