lukeed / pwa

(WIP) Universal PWA Builder
https://pwa.cafe
3.13k stars 100 forks source link

Change default browsers #48

Closed ai closed 5 years ago

ai commented 5 years ago

It is me again with the issue about Browserslist. Hope I didn’t bother you with it 😅

Current browsers are (according to Jamie’s article)

>0.25%, not ie 11, not op_mini all

Unfortunately, this article was not created with good analysis behind.

Here I bring developers around the world and they say that Jamie’s target browsers settings could cut the whole countries from the Internet https://github.com/browserslist/browserslist/issues/250

Personally, I see people use Opera Mini everyday here. In the streets, in cafes, in buses, everywhere you can think of.

Here are Browserslist’s official recommendations

  1. Select browsers directly (last 2 Chrome versions) only if you are making a web app for a kiosk with one browser. There are a lot of browsers on the market. If you are making general web app you should respect browsers diversity.
  2. If you want to change the default set of browsers we recommend to combine last 1 version, not dead with > 0.2% (or > 1% in US, > 1% in my stats). last n versions adds too many dead browsers and does not add popular old versions. > 0.2% make popular browsers even more popular, so we will have a monopoly and stagnation, as we had with Internet Explorer 6.
  3. Don’t remove browsers just because you don’t know them. Opera Mini has 100 million users in Africa and it is more popular in the global market than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox and desktop Safari altogether.

The default query defaults (or > 0.5%, last 2 versions, Firefox ESR, not dead) is very balanced. If you want to keep bundle smaller, but still be open for everyone in the world, I can suggest:

> 1%, last 1 version, not ie 11, not ie_mob 11, not dead
lukeed commented 5 years ago

Hey, no worries! 😆

I know there was a lot of discussion/controversy about his article. I read some of it at the time.

Not sure if this is an "official" tool, but these are the results I get when comparing your recommendation to the current value. TBH, I know I don't fully understand, but I find it odd that your settings yield lesser global coverage and that some browsers with 0% usage are included.

screen shot 2018-10-06 at 1 26 02 pm screen shot 2018-10-06 at 1 30 54 pm
ai commented 5 years ago

Hm, 0% looks like broken data (we are taking it from Can I Use). Another reason to avoid statistics only queries.

According statcounter QQ is one of most popular browsers in China http://gs.statcounter.com/browser-market-share/all/china

(BTW, of course your can change > 1% back to > 0.25%. There is no recommend limit.)

lukeed commented 5 years ago

Okay, my tentative list right now is this:

> 0.25%, last 1 version, not ie 11, not ie_mob 11, not dead

I'm concerned about "dead" – I know it's one of your core terms, but I've had issues with it in the past where tool integrations threw an error with it.

For example, even now, the Babel REPL throws an error.

ai commented 5 years ago

Oh, yeap. I had crazy time because of dead.

It happens because some tool has very old Browserslist (free years old) in dependencies. It is very temporary problem. I try to force everyone to update dependencies. So if default set works with dead, I think you can use it.

But if you want to be sure, you can avoid it for a while.

Thanks for REPL issue. I will write them to update Browserslist.

lukeed commented 5 years ago

Yeah, understandable 👍 Starting from what major version should that be fixed?

I'll add it in now, but for future reference, I'd like to know this version constraint in case related issues arise.

Thanks!

ai commented 5 years ago

@lukeed dead query was introduced in Browserslist 3.0 (current is 4.2).

lukeed commented 5 years ago

Got it – thanks @ai 👍

ai commented 5 years ago

I found the problem with Babel REPL. It still Used Babel 6, instead of 7 (which is based on top of the latest Browserslist). There are already a few issues related to that.