Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix android queries #428

Merged
merged 7 commits into from Dec 5, 2019
Merged

Fix android queries #428

merged 7 commits into from Dec 5, 2019

Conversation

@JLHwung
Copy link
Contributor

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 JLHwung:fix-android-queries branch from 5bee6f3 to 05a8419 Dec 4, 2019
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

This comment has been minimized.

Copy link
@ai

ai Dec 5, 2019

Member

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',

This comment has been minimized.

Copy link
@ai

ai Dec 5, 2019

Member

Strange new line

This comment has been minimized.

Copy link
@JLHwung

JLHwung Dec 5, 2019

Author Contributor

Good catch, addressed in bd31b51.

@@ -24,6 +30,13 @@ it('selects versions with query out of range', () => {
expect(browserslist('ie 1-12')).toEqual(['ie 11', 'ie 10', 'ie 9', 'ie 8'])
})

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

This comment has been minimized.

Copy link
@ai

ai Dec 5, 2019

Member

You can keep toEqual on previous line to make method smaller

This comment has been minimized.

Copy link
@JLHwung

JLHwung Dec 5, 2019

Author Contributor

😛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.

This comment has been minimized.

Copy link
@ai

ai Dec 5, 2019

Member

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

index.js Outdated
}
return browserslist.data[name]
}

function normalizeAndroidVersions (androidVersions, chromeVersions) {
var firstEvergreen = 37

This comment has been minimized.

Copy link
@ai

ai Dec 5, 2019

Member

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

JLHwung added 2 commits Dec 5, 2019
@ai ai merged commit 6ad589e into browserslist:master Dec 5, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@ai

This comment has been minimized.

Copy link
Member

ai commented Dec 5, 2019

Thanks. Released in 4.8.1.

@JLHwung JLHwung deleted the JLHwung:fix-android-queries branch Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.