-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Babel recently introduced a support for the Record and Tuple ECMAScript proposal. Babel currently uses @bloomberg/record-tuple-polyfill as the underling implementation. But I was wondering how this compares to @wry/record and @wry/tuple and wether they would be usable as an alternative polyfill?
I'm favoring @wry/record and @wry/tuple from an implementation perspective. Correct me if I'm wrong, but @bloomberg/record-tuple-polyfill seems to be unnecessary complex and convoluted in comparison.
I'd like to propose a new package @wry/record-tuple-polyfill if semantic-, API- and formal compatibility are given.
(Non exhaustive) list of requirements for this proposed package:
- re-exports of
Tuplefrom@wry/tupleandRecordfrom@wry/record - additional tests to ensure formal, semantic and API compatibility with
@bloomberg/record-tuple-polyfill - (stretch goal or pre-condition?) a benchmark suite (that also covers memory consumption)
Requirement 1. should be trivial to do. It will be something like this:
export Record from "@wry/record";
export Tuple from "@wry/tuple";Meeting the second requirement might be a little bit more tricky. I think a property based testing approach could give the strongest guarantees here.
Not sure if the benchmark suite should be rather a precondition for publishing the new package or if is a rather a stretch goal.
(any input/discussion is very appreciated)