Mixpanel Community Icon

Best Practices for Ensuring Code Compatibility with Users’ Browsers

·
·

How are you all making sure that the code/features you are launching will work with your user base? As a Product Manager, Designer and Developer, I am always wondering, after I design something, and I need to code it… what Can I Use? What CSS can I use to make this work? The answer to that question largely depends on what browsers people are using to access my website or app. For example, I want to let content authors use any size photo they have access to but make sure the photo they use is cropped and fills the entire photo space. That is easy to do with modern CSS, specifically aspect-ratio … but some browsers still don’t support modern CSS. My process is to go to Can I Use (https://caniuse.com/) and search for the CSS I want to use to solve the current problem. Now I can see which browsers support my solution. With that information in hand, I now need to know if any of the browsers that do not support the solution are accessing my website/app and, if so, how many. This is the dashboard I am using today on a newer project. Curious if anyone has found a better way in Mixpanel?

  • Avatar of Baffour A.
    Baffour A.
    ·
    ·

    The data on caniuse comes from: https://github.com/mdn/browser-compat-data E.g. for aspect ratio there's this json file: https://github.com/mdn/browser-compat-data/blob/main/css/properties/aspect-ratio.json So there is probably a solution where you transform that data into the appropriate data format to upload to Mixpanel as a lookup table, but almost feels like overkill to automate because of the effort to implement vs benefit. You may be better off looking at setting a cutoff for what browser versions you want to support based on your total user base, and if a certain rule isn't supported by some versions in that range, use a polyfill or avoid the rule to ensure your site still works for them. I think trying to check Mixpanel stats for every individual CSS rule you need will start to feel really tedious!

  • Avatar of Jono Y.
    Jono Y.
    ·
    ·

    Thanks Baffour A.. I agree, it could get tedious. I am curious if anyone else has a better way to find browser stats for their site than how I am currently doing it in Mixpanel - in the dash included in the original post.