mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 00:35:25 +03:00
1623baec4d
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 |
||
---|---|---|
.. | ||
codegen-common | ||
codegen-main | ||
hs/bindings | ||
java | ||
scala | ||
ts |