boa-dev / temporal

A Rust implementation of ECMAScript's Temporal API
Apache License 2.0
25 stars 2 forks source link

Update API for `temporalDateLike`, `temporalDurationLike`, etc. inputs #55

Open nekevss opened 3 months ago

nekevss commented 3 months ago

Currently, parameters on some calls differ a tad from specification. Instead of supporting a "Like" item, we take specific values. Ideally, these should be updated to the below.

jedel1043 commented 2 months ago

From https://github.com/boa-dev/temporal/pull/84#discussion_r1681400717:

I think the spec API is fine, but in my opinion the APIs should be adapted to the explicitness of Rust APIs instead of having a 1-1 equivalent in both, which in this case means having some function that people can call to get the calendar before calling the function, instead of filling the API with generics. This is partly because any APIs that have generics in them will make it really difficult to implement FFI interfaces for them.