You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With property name mangling being added in 47773fc I was looking into if we could replace our terser build setup with esbuild for Preact. In our current setup we use the name cache feature of terser to mangle property names in a consistent way for our core library and addons that interface with each other. Without consistent mangling the names would not match up and it would break the code.
This features is currently missing as indicated in the docs for mangling for esbuild. I'm curious if it would be possible to add some sort of name mapping to esbuild similar to the name cache feature in terser.
Yes, this sounds reasonable to add. Right now I'm trying to figure out how the JS and Go APIs should work.
I could make it a file name, but that relies on the file system which means it wouldn't work in the browser. That would also be somewhat problematic from a determinism standpoint as it's essentially a database but multiple concurrent API calls could write to it in different orders, causing nondeterministic builds.
Making it an input map and an output map to each API call would let it work in the browser and would avoid nondeterminism issues with multiple concurrent API calls, but would mean the map wouldn't automatically be updated for every incremental build when in incremental build mode.
With property name mangling being added in 47773fc I was looking into if we could replace our terser build setup with esbuild for Preact. In our current setup we use the name cache feature of terser to mangle property names in a consistent way for our core library and addons that interface with each other. Without consistent mangling the names would not match up and it would break the code.
This features is currently missing as indicated in the docs for mangling for esbuild. I'm curious if it would be possible to add some sort of name mapping to esbuild similar to the name cache feature in terser.
Here is an example of the name cache in our build: https://github.com/preactjs/preact/blob/1b6fbc723020f66b74581e9eea067f74380eb1f9/mangle.json#L28-L77
Terser doc: https://terser.org/docs/cli-usage#cli-mangling-property-names-mangle-props
The text was updated successfully, but these errors were encountered: