Fix a panic with const enum inside parentheses (#3205)
This release fixes an edge case where esbuild could potentially panic if a TypeScript const enum statement was used inside of a parenthesized expression and was followed by certain other scope-related statements. Here's a minimal example that triggers this edge case:
(() => {
const enum E { a };
() => E.a
})
Allow a newline in the middle of TypeScript export type statement (#3225)
Previously esbuild incorrectly rejected the following valid TypeScript code:
export type
{ T };
export type
as foo from 'bar';
Code that uses a newline after export type is now allowed starting with this release.
A refactoring typo in version 0.18.9 accidentally introduced a regression with cross-module inlining of string enums when combined with computed property accesses. This regression has been fixed.
Rewrite .js to .ts inside packages with exports (#3201)
Packages with the exports field are supposed to disable node's path resolution behavior that allows you to import a file with a different extension than the one in the source code (for example, importing foo/bar to get foo/bar.js). And TypeScript has behavior where you can import a non-existent .js file and you will get the .ts file instead. Previously the presence of the exports field caused esbuild to disable all extension manipulation stuff which included both node's implicit file extension searching and TypeScript's file extension swapping. However, TypeScript appears to always apply file extension swapping even in this case. So with this release, esbuild will now rewrite .js to .ts even inside packages with exports.
Fix a redirect edge case in esbuild's development server (#3208)
The development server canonicalizes directory URLs by adding a trailing slash. For example, visiting /about redirects to /about/ if /about/index.html would be served. However, if the requested path begins with two slashes, then the redirect incorrectly turned into a protocol-relative URL. For example, visiting //about redirected to //about/ which the browser turns into http://about/. This release fixes the bug by canonicalizing the URL path when doing this redirect.
v0.18.11
Fix a TypeScript code generation edge case (#3199)
This release fixes a regression in version 0.18.4 where using a TypeScript namespace that exports a class declaration combined with --keep-names and a --target of es2021 or earlier could cause esbuild to export the class from the namespace using an incorrect name (notice the assignment to X2._Y vs. X2.Y):
// Original code
// Old output (with --keep-names --target=es2021)
var X;
((X2) => {
const _Y = class _Y {
Fix a panic with const enum inside parentheses (#3205)
This release fixes an edge case where esbuild could potentially panic if a TypeScript const enum statement was used inside of a parenthesized expression and was followed by certain other scope-related statements. Here's a minimal example that triggers this edge case:
(() => {
const enum E { a };
() => E.a
})
Allow a newline in the middle of TypeScript export type statement (#3225)
Previously esbuild incorrectly rejected the following valid TypeScript code:
export type
{ T };
export type
as foo from 'bar';
Code that uses a newline after export type is now allowed starting with this release.
A refactoring typo in version 0.18.9 accidentally introduced a regression with cross-module inlining of string enums when combined with computed property accesses. This regression has been fixed.
Rewrite .js to .ts inside packages with exports (#3201)
Packages with the exports field are supposed to disable node's path resolution behavior that allows you to import a file with a different extension than the one in the source code (for example, importing foo/bar to get foo/bar.js). And TypeScript has behavior where you can import a non-existent .js file and you will get the .ts file instead. Previously the presence of the exports field caused esbuild to disable all extension manipulation stuff which included both node's implicit file extension searching and TypeScript's file extension swapping. However, TypeScript appears to always apply file extension swapping even in this case. So with this release, esbuild will now rewrite .js to .ts even inside packages with exports.
Fix a redirect edge case in esbuild's development server (#3208)
The development server canonicalizes directory URLs by adding a trailing slash. For example, visiting /about redirects to /about/ if /about/index.html would be served. However, if the requested path begins with two slashes, then the redirect incorrectly turned into a protocol-relative URL. For example, visiting //about redirected to //about/ which the browser turns into http://about/. This release fixes the bug by canonicalizing the URL path when doing this redirect.
0.18.11
Fix a TypeScript code generation edge case (#3199)
This release fixes a regression in version 0.18.4 where using a TypeScript namespace that exports a class declaration combined with --keep-names and a --target of es2021 or earlier could cause esbuild to export the class from the namespace using an incorrect name (notice the assignment to X2._Y vs. X2.Y):
// Original code
// Old output (with --keep-names --target=es2021)
var X;
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.17.17 to 0.18.12.
Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
d196e4c
publish 0.18.12 to npm33933c4
fix #3210: cross-module inlining of string enumsaad8818
fix #3205: panic withconst enum
inside parensbf165fc
fix #3225: allow a newline afterexport type
cc25614
fix #3201: rewrite.js
to.ts
withexports
5b50684
add a level of indentation838f90d
fix #3208: avoid protocol-relative url redirects5949e5c
tests: force npm ignore-scripts=false2703f90
publish 0.18.11 to npmcd23ee5
fix #3199: keep names + namespace + export classDependabot 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)