Support property name mangling with some TypeScript syntax features
The newly-released --mangle-props= feature previously only affected JavaScript syntax features. This release adds support for using mangle props with certain TypeScript syntax features:
TypeScript parameter properties
Parameter properties are a TypeScript-only shorthand way of initializing a class field directly from the constructor argument list. Previously parameter properties were not treated as properties to be mangled. They should now be handled correctly:
// Original code
class Foo {
constructor(public foo_) {}
}
new Foo().foo_;
// Old output (with --minify --mangle-props=)
class Foo{constructor(c){this.foo=c}}new Foo().o;
// New output (with --minify --mangle-props=_)
class Foo{constructor(o){this.c=o}}new Foo().c;
TypeScript namespaces
Namespaces are a TypeScript-only way to add properties to an object. Previously exported namespace members were not treated as properties to be mangled. They should now be handled correctly:
// Original code
namespace ns {
export let foo_ = 1;
export function bar_(x) {}
}
ns.bar_(ns.foo_);
// Old output (with --minify --mangle-props=)
var ns;(e=>{e.foo=1;function t(a){}e.bar_=t})(ns||={}),ns.e(ns.o);
// New output (with --minify --mangle-props=_)
var ns;(e=>{e.e=1;function o(p){}e.t=o})(ns||={}),ns.t(ns.e);
Fix property name mangling for lowered class fields
This release fixes a compiler crash with --mangle-props= and class fields that need to be transformed to older versions of JavaScript. The problem was that doing this is an unusual case where the mangled property name must be represented as a string instead of as a property name, which previously wasn't implemented. This case should now work correctly:
Support property name mangling with some TypeScript syntax features
The newly-released --mangle-props= feature previously only affected JavaScript syntax features. This release adds support for using mangle props with certain TypeScript syntax features:
TypeScript parameter properties
Parameter properties are a TypeScript-only shorthand way of initializing a class field directly from the constructor argument list. Previously parameter properties were not treated as properties to be mangled. They should now be handled correctly:
// Original code
class Foo {
constructor(public foo_) {}
}
new Foo().foo_;
// Old output (with --minify --mangle-props=)
class Foo{constructor(c){this.foo=c}}new Foo().o;
// New output (with --minify --mangle-props=_)
class Foo{constructor(o){this.c=o}}new Foo().c;
TypeScript namespaces
Namespaces are a TypeScript-only way to add properties to an object. Previously exported namespace members were not treated as properties to be mangled. They should now be handled correctly:
// Original code
namespace ns {
export let foo_ = 1;
export function bar_(x) {}
}
ns.bar_(ns.foo_);
// Old output (with --minify --mangle-props=)
var ns;(e=>{e.foo=1;function t(a){}e.bar_=t})(ns||={}),ns.e(ns.o);
// New output (with --minify --mangle-props=_)
var ns;(e=>{e.e=1;function o(p){}e.t=o})(ns||={}),ns.t(ns.e);
Fix property name mangling for lowered class fields
This release fixes a compiler crash with --mangle-props= and class fields that need to be transformed to older versions of JavaScript. The problem was that doing this is an unusual case where the mangled property name must be represented as a string instead of as a property name, which previously wasn't implemented. This case should now work correctly:
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.16.
Release notes
Sourced from esbuild's releases.
... (truncated)
Changelog
Sourced from esbuild's changelog.
... (truncated)
Commits
8da1c79
publish 0.14.16 to npm8b7fab9
s/fix/support/2f922be
fix compiler panic with lowered class fieldsfb510ff
mangle props uses object shorthand if possible8814ba2
update changelog508dc70
add test for mangle props and ts enum values46ad234
fix mangle props with exported namespace members6946e6d
helper methods for mangle props372bafa
fix mangle props with TS parameter propertiesb6344e1
publish 0.14.15 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)