Skip to content

Fix android queries#428

Merged
ai merged 7 commits intobrowserslist:masterfrom
JLHwung:fix-android-queries
Dec 5, 2019
Merged

Fix android queries#428
ai merged 7 commits intobrowserslist:masterfrom
JLHwung:fix-android-queries

Conversation

@JLHwung
Copy link
Copy Markdown
Contributor

@JLHwung JLHwung commented Dec 4, 2019

I recommend to review this PR by commits.

The first commits merge chrome >= 37 data to android under the mobileToDesktop flag

The second commits fixed result sorting issues occured when I wrote test for the first commit.

I propose in In the next major release we should set the defaults of opts.mobileToDesktop to be true so that the returned mobile browsers are complete. People can disable this feature if they find things are not going well.

@JLHwung JLHwung force-pushed the fix-android-queries branch from 5bee6f3 to 05a8419 Compare December 4, 2019 21:49
index.js Outdated
}
// here we assume that caniuse version ranges never overlaps,
// so it is safe to use the left of the range
// eslint-disable-next-line max-len
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, you can't just disable the rule. Try to reorganize the code to make it more readable.

},
android: {
name: 'android',
released: ['4.2-4.3', '4.4',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange new line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, addressed in bd31b51.


it('selects a range of android browsers', () => {
expect(browserslist('android 4.3-37'))
.toEqual([
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can keep toEqual on previous line to make method smaller

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😛I am really not good at formatting without the help of prettier. If you are okay with prettier, I would suggest we leave it as-is. I can introduce prettier in a separate PR.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry, fix the logic and // eslint-disable and I will fix the formatting.

index.js Outdated
}

function normalizeAndroidVersions (androidVersions, chromeVersions) {
var firstEvergreen = 37
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use this bar in multiple places, we need to move it to var ANDROID_FIRST_EVERGREEN constant.

@ai ai merged commit 6ad589e into browserslist:master Dec 5, 2019
@ai
Copy link
Copy Markdown
Member

ai commented Dec 5, 2019

Thanks. Released in 4.8.1.

@JLHwung JLHwung deleted the fix-android-queries branch December 5, 2019 15:01
zhouyu9527 pushed a commit to zhouyu9527/browserslist that referenced this pull request Jul 5, 2022
* fix: use chrome>=37 data for android

* fix browser sorting

* refactor: tune android browser versions regex

* chore: refine testcase

* add testcase

* address review comments

* oops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants