rescript-webapi icon indicating copy to clipboard operation
rescript-webapi copied to clipboard

Temporal bindings

Open tom-sherman opened this issue 3 years ago • 1 comments

https://tc39.es/proposal-temporal/docs

Currently incomplete, need to clean the rest up before committing them.

Couple of questions on approach:

  • Is there a way to more directly type functions that type option bags? I assume no and we have to wait for this RFC
  • Many modules share a lot of functions, is it worth segmenting these out into functors? Or is a more direct approach, as in this PR currently, more valuable?

I've skipped APIs that rely on bigints, I think official support need to land for these (at least in the form of a type in the stdlib) before adding bindings. See https://github.com/rescript-lang/rescript-compiler/issues/4677

I've also skipped toLocaleString bindings as I think we should add general Intl bindings first (#77)

tom-sherman avatar Dec 30 '21 10:12 tom-sherman

Regarding BigInt, maybe we consider pulling in rescript-js. That might be a bit heavy-handed, though, to force webapi users to adopt the alternative Js implementation as well if they want to make use of the BigInt functions.

TheSpyder avatar Dec 31 '21 04:12 TheSpyder