google / google/jsinterop-generator

Add a mechanism for testing whether feature is present

Open
#30 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
85
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Sometimes a particular property/operator is only available on some browsers. The generator will generate the field/methods regardless and the downstream consumer is left to try and feature detect in some other way. The simplest approach may be to just generate a `@JsOverlay boolean supportsMyFeature()` method that will allow caller to detect whether a feature is supported.

It would be too costly to generate `supports*()` methods for every feature so maybe the generator could load the [canisue](https://github.com/Fyrd/caniuse) database and only generate `supports*()` methods if they are not supported compared to a particular base line (IE11?).

See also #29 because these features could be combined and driven by the same data.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.