You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was curious how big the basic bundle is, so I ran an webpack-bundle-size-analyzer on Homepage.js from the basic react-server yo scaffold. I posted the results here. The file sizes shown are minified, ungzipped.
There are a few interesting things, but the thing that most sticks out to me is the amount of space mobile-detect takes: 36.2kB out of 307kB, or 11.8%.
As far as I can tell, mobile-detect is only used to see if the user is mobile/phone/tablet. If that's right, it'd probably be better to figure out a way to run mobile-detect on the server and then just send down the string "mobile"/"phone"/"tablet", while excluding mobile-detect from the client build. Thoughts?
The text was updated successfully, but these errors were encountered:
run mobile-detect on the server and then just send down the string "mobile"/"phone"/"tablet",
@aickin Ooh! Good idea! I think we're currently exposing a full mobile-detect instance, so that would probably be a breaking change. Or maybe... we could send down a thin dummy that implements the interface with values hard-coded by the server? 🤔
I think this is a great idea. Every page starts with a response form the server, moving as many bits as possible and letting the output be a bool just nails it.
I was curious how big the basic bundle is, so I ran an webpack-bundle-size-analyzer on
Homepage.js
from the basic react-serveryo
scaffold. I posted the results here. The file sizes shown are minified, ungzipped.There are a few interesting things, but the thing that most sticks out to me is the amount of space
mobile-detect
takes: 36.2kB out of 307kB, or 11.8%.As far as I can tell, mobile-detect is only used to see if the user is mobile/phone/tablet. If that's right, it'd probably be better to figure out a way to run
mobile-detect
on the server and then just send down the string "mobile"/"phone"/"tablet", while excludingmobile-detect
from the client build. Thoughts?The text was updated successfully, but these errors were encountered: