-
Notifications
You must be signed in to change notification settings - Fork 571
Description
As part of #2207, the issue of name mangling came up in post-processing conversion to ES modules. Currently, exports like on' (the invalid ES character in the identifier) break when converted straight to ES Module export syntax. The name mangler I (and @Pauan concurrently) have written gets around on' becoming on$prime.
This doesn't work well if output object properties (as opposed to exports) have reserved words or apostrophes in them unfortunately. We've had to code around that locally.
As @paf31 has noted, there are tooling concerns for folks using pulp and psci. Improving name mangling has no effect on these tools, but allows folks using JS based bundling a safer way to output smaller code than what psc-bundle currently offers.
Edit: As @michaelficarra has pointed out, the spec does allow reserved words as export names, and @Pauan was recently responsible for patching acorn (which is used by both rollup and webpack) to allow this.