Skip to content
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

isSupported reporting false negatives #82

Open
acalvo opened this issue May 30, 2019 · 1 comment
Open

isSupported reporting false negatives #82

acalvo opened this issue May 30, 2019 · 1 comment

Comments

@acalvo
Copy link

acalvo commented May 30, 2019

It seems that isSupported is reporting false whenever a version has a "note".

Take for example ES6: https://caniuse.com/#feat=es6
caniuse.isSupported('es6', 'chrome 74') returns false (as does caniuse.isSupported('es6', 'firefox 66')) which makes little sense. I'd expect to always return true if the version is marked in CanIUse as supported (dark green). Someone could argue that if that there is a note it means that something happens with it (in this example, missing tail call optimization), but that's what partially support (light green) means, doesn't it? If the note was important enough not to consider the feature as supported, it wouldn't be marked in dark green.

@alan-agius4
Copy link

The problem is in this line

.every((browser) => data.stats[browser[0]] && data.stats[browser[0]][browser[1]] === "y")

To be precise the y switch, for partial support the switch value is a.

Would the maintainer be open to accept a PR?

kyliau pushed a commit to angular/angular-cli that referenced this issue Jun 11, 2019
…S6 modules are being marked as not supported

`caniuse-api` only returns `true` for a feature when it's fully supported. This might causes redundant ES5 builds if users opt to support only browsers which do support ES6 modules but either require polyfills such as Safari 10.1 or when both bundles will be downloaded such as `Edge 18`

See: https://github.com/Nyalab/caniuse-api/blob/1b74c10257e36877709da4f6630513db10203a78/src/index.js#L49 and Nyalab/caniuse-api#82

Fixes #14580
kyliau pushed a commit to angular/angular-cli that referenced this issue Jun 11, 2019
…s6 modules are being marked as not supported

caniuse-api only returns true for a feature when it's fully supported. This might causes redundant ES5 builds if users opt to support only browsers which do support ES6 modules but either require polyfills such as Safari 10.1 or when both bundles will be downloaded such as Edge 18

See: https://github.com/Nyalab/caniuse-api/blob/1b74c10257e36877709da4f6630513db10203a78/src/index.js#L49 and Nyalab/caniuse-api#82

Fixes #14580
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

No branches or pull requests

2 participants