fix(@angular-devkit/build-angular): ability to perform DCE but retain symbol names#22379
fix(@angular-devkit/build-angular): ability to perform DCE but retain symbol names#22379alan-agius4 merged 1 commit intoangular:masterfrom alan-agius4:dce-names
Conversation
|
Ummm looks like this breaks the server E2E, will need to continue investigating. |
|
CI failures are unrelated to this change. |
dgp1130
left a comment
There was a problem hiding this comment.
Nit: In the commit message, "Previously we enabled the keepNames esbuild option when mangling was disabled, ...".
The commit message sounds more like a feature to me, but I believe this is for an experimental/debug option, so I'm ok with it going into patch anyways.
|
Maybe I should change the type from fix to something else since this is mostly a private/debug option |
…etain symbol names
Previously, we enabled the `keepNames` esbuild when mangling was disabled, this caused dead code to be retained because of the transformations that esbuild did to the input.
Input
```js
class foo {}
```
Output
```js
var l = Object.defineProperty,
a = (s, c) => l(s, "name", { value: c, configurable: !0 });
class foo {}
a(foo, "foo");
```
Previously we enabled the `keepNames` esbuild option when mangling was disabled, which is actually not needed to retain the name of symbols but is needed for SSR because Domino relies on the `name` property on functions and classes.
Closes #22354
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Previously, we enabled the
keepNamesesbuild when mangling was disabled, this caused dead code to be retained because of the transformations that esbuild did to the input.Input
Output
Previously we enabled the
keepNamesesbuild option when mangling was disabled, which is actually not needed to retain the name of symbols but is needed for SSR because Domino relies on thenameproperty on functions and classes.Closes #22354
Example of output when mangling is disabled
https://gist.github.com/alan-agius4/6b0b50974bc85214cf1e4fb9fd0f7190
//cc @AndrewKushnir