microbundle icon indicating copy to clipboard operation
microbundle copied to clipboard

Reevaluate exports: 'auto'

Open Andarist opened this issue 7 years ago • 2 comments

It's just a request to evaluate if exports: 'auto' is still today the best solution. I understand its nice to use require('lib') instead of require('lib').default, but imho the BIG problem with having this auto mode by default is that whenever a user adds a named export from his/her library it is automatically a breaking change and one that might easily slip released as patch/minor because its really simple to miss that.

I'll make piece with either decision, just wanted to raise a concern about this.

I've filled this issue at rollup - https://github.com/rollup/rollup/issues/1881 , but whatever they decide does not have to be the same for microbundle, hence "duplicated" issues.

Andarist avatar Jan 16 '18 11:01 Andarist

FWIW I ventured further down this path in 8960114 and I think the output size savings are worth the breakage possibility you mentioned. It's worth us warning about it though, perhaps both in the README and if changing exports.

developit avatar Jan 22 '18 19:01 developit

Need to examine this code later, as I do not understand the idea yet. As to size savings - isnt it just a matter of literally few bytes? I understand the micro craze and goal of this tool, but those few bytes seems like a reasonable tradeoff for me.

Anyway - gonna invest some time in understanding the mentioned commit later and gonna try to see what can be done to prevent (or warn about) accidental breakages.

Andarist avatar Jan 23 '18 12:01 Andarist