We want this instead of just setting it true.
We'll want to use this utility.
I think an approach like this will work just fine. I'm not sure if there's a better way to query if a browser is included in that threshold, but that should be a reasonable solution.
Please check issue attached to the PR - https://github.com/gatsbyjs/gatsby/issues/10513 for some context. We were doing checks on bundle sizes for this and there is no difference in actual output for default starter (like actual content is the same, not only bundle size).
the mangle.safari10 options targets specific scenario:
safari10 (default false) -- Pass true to work around the Safari 10 loop iterator bug "Cannot declare a let variable twice"
mangling is renaming variables to those single characters names. So this is very rare when this would actually increase bundle size - and if it does it would be by few bytes.
We also don't use browserlist to cover IE11 currently (just do it by default). We definitely can look into using browserlist for configuring terser options, but it would be some breaking changes I think and also require us to maintain the browserlist -> terserOptions "mapping".
I do think as long as there are no changes in bundle sizes and bundles works providing support for safari10 by default is good idea
Ah cool 馃憤 as long as that's all the option is doing then yeah, turning it on by default seems fine.
Most helpful comment
Please check issue attached to the PR - https://github.com/gatsbyjs/gatsby/issues/10513 for some context. We were doing checks on bundle sizes for this and there is no difference in actual output for default starter (like actual content is the same, not only bundle size).
the
mangle.safari10options targets specific scenario:mangling is renaming variables to those single characters names. So this is very rare when this would actually increase bundle size - and if it does it would be by few bytes.
We also don't use browserlist to cover IE11 currently (just do it by default). We definitely can look into using browserlist for configuring terser options, but it would be some breaking changes I think and also require us to maintain the browserlist -> terserOptions "mapping".
I do think as long as there are no changes in bundle sizes and bundles works providing support for safari10 by default is good idea