daml/language-support
Gary Verhaegen 1623baec4d
add multi-{key,query} stream to daml-ledger (#7066)
This is an attempt to address #7034 & #7036. Strictly speaking, this
does not match their acceptance criteria, as this only supports multiple
queries, not mixed templates.

Because the two new functions can cover the exact same use cases (and
more) as the existing `streamQuery` and `streamFetchByKey`, the latter
are deprecated. The deprecation cycle I suggest is to deprecate them
immediately by annotating them as such in the documentation (done on
this PR).

That's it. I do not think we ever need to actually remove them, nor to
make them print annoying warnings or anything. There is nothing wrong
with the functions as they stand, they just don't fit in the API
anymore.

We could, at some point, move them to a separate documentation page, or
to the boottm of the existing one, but I feel even removing them from
the documentation is unnecessary.

CHANGELOG_BEGIN

- [JavaScript Client Libraries] Two new methods have been added to
  `daml-ledger`: `streamQueries` and `streamFetchByKeys`. They are
  similar to the existing singular versions, except they can take
  multiple queries and multiple keys, respectively, and return a union
  of what the corresponding individual queries/keys would have. Because
  these new functions can do everything the existing ones can, we are
  deprecating the latter, though there is no plan to remove them.

  Upgrade path is straightforward:

  ```
  streamQuery(t); => streamQueries(t, []);
  streamQuery(t, undefined); => streamQueries(t, []);
  streamQuery(t, q); => streamQueries(t, [q]);
  streamFetchByKey(t, k); => streamFetchByKey(t, [k]);
  ```

  There is one caveat, though: `streamFetchByKeys` is a little bit less
  lenient in the format in which it expects the key. If your existing
  code was conforming to the generated TypeScript code we provide,
  everything should keep working, but if you were using plain JS or
  bypassing the TS type system, it is possible that you used to
  construct keys that will no longer be accepted. The new function
  requires all keys to be given in the _output_ format of the JSON API,
  which is a little bit more strict than the general JSON <-> LF
  conversion rules.

CHANGELOG_END
2020-09-08 19:17:49 +02:00
..
codegen-common set scalac -Xsource:2.13 -Ypartial-unification globally (#6469) 2020-06-24 16:51:24 -04:00
codegen-main Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
hs/bindings Split sandbox code into separate packages (#6695) 2020-07-17 17:06:06 +02:00
java Use Future.unit instead of Future.successful(()). (#7080) 2020-08-11 09:18:50 +00:00
scala Migrate leftover scenario in quickstart to DAML Script (#7338) 2020-09-08 13:15:45 +02:00
ts add multi-{key,query} stream to daml-ledger (#7066) 2020-09-08 19:17:49 +02:00