Closed ilyakooo0 closed 2 years ago
ghcjs should do function level tree shaking to remove all the unused parts of lens. Does this really make the final code size smaller? If so it may be that ghcjs tree shaking is broken. Can you please provide an example that demonstrates code size savings?
Turns out it doesn’t make much of a difference.
Feel free to close this
When using the library to develop frontends (compiled with GHCJS) some might want to speed up the page loading time by reducing the size of the generated js.
lens
had a pretty big dependency footprint which might otherwise not be needed in a frontend application.The only thing the
lens
library is really needed for is for generatingIndexPreservingGetter
s. IMO a large portion of the uses of theIndexPreservingGetter
s is just as plainGetter
s.This PR adds a flag that disables the
lens
dependency, regressing allIndexPreservingGetter
s toGetter
s.This is not a breaking change since the default is to preserve the previous behavior.