google / jsinterop-base

Utilities for GWT and J2CL to interact with JavaScript beyond JsInterop
Apache License 2.0
67 stars 16 forks source link

Add support for JsPropertyMap.keys() #15

Closed realityforge closed 3 years ago

realityforge commented 3 years ago

Would you consider an addition of a method like JsArrayLike<T> keys() added to the JsPropertyMap<T> class?

I was looking through our projects, and a lot of them only use the elemental2-core library to make use of the JsObject.keys() method. It looks like it would be possible to remove the elemental2-core with this small addition to JsPropertyMap and it seems to make sense.

gkdn commented 3 years ago

The main reason it wasn't include was because it wasn't clear where to put a line on which method to include from jsinterop-base classes so we sticked with things that require writing JS by hand. However I don't mind if this makes big difference for our users.

realityforge commented 3 years ago

After further investigation it seems that this change is of less value for use (at least for use). We usually invoke JsArray methods on the result and thus would need to bind to elemental2-core anyway. So I am going to close this for now