lock icon indicating copy to clipboard operation
lock copied to clipboard

Switch to preact to reduce bundle size

Open motin opened this issue 9 years ago • 3 comments

https://preactjs.com/

Good case study of where this was done and bundle size (raw) was reduced dramatically: https://github.com/ui-router/visualizer/issues/15

Many things already work after installing ´yarn add preact preact-compat preact-css-transition-group´ and using the following aliasing in webpack:

        resolve: {
            alias: {
                'react': 'preact-compat',
                'react-dom': 'preact-compat',
                'preact-compat/lib/ReactCSSTransitionGroup': 'preact-css-transition-group',
            },
            extensions: ['', '.js']
        },

However, the social login buttons are no longer rendered and the login field area is empty if one has pressed "Not your account?". Seems like minor things to fix (sorry if I am mistaken), and could reduce bundle size drastically.

motin avatar Apr 01 '17 05:04 motin

Yeah. This is an area we're interested in, but this would be a major breaking change for anyone depending on our package. We thought about preact/inferno and we take the bundle size issue very seriously, but we can't break people's code just like that. For our next major version, we'll try preact, inferno and react-lite and see what happens. I'll close this in favor of #113, since it's the same issue. Thanks for taking the time to try preact with our code base!

luisrudge avatar Apr 01 '17 16:04 luisrudge

@luisrudge any update on a fix for this? It really is a massive library for no reason

cg-rsands avatar Nov 13 '18 22:11 cg-rsands

There are no plans to tackle this issue in the short/mid term future

luisrudge avatar Nov 13 '18 22:11 luisrudge