Skip to content
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0a49990
Create app token, and use it to push docs to gh-pages
Thahara Sep 12, 2025
4e78147
rm whitespace from comment
Thahara Sep 12, 2025
bba2129
Merge pull request #511 from Concordium/doc-release-use-app-token
Thahara Sep 30, 2025
69a6bf5
Fix broken links and linkcheck in docs
soerenbf Oct 3, 2025
75514b3
Merge pull request #520 from Concordium/fix-broken-links
soerenbf Oct 6, 2025
04f041a
Update wasm pack + rust version (#519)
soerenbf Oct 6, 2025
da75297
changing tar fs version as per dependabot suggestion
Oct 7, 2025
a4477d7
removed the entry from resolutions package.json
Oct 7, 2025
bc05197
Merge pull request #522 from Concordium/COR-1931-tar-fs-upgrade
rbaconcordium Oct 7, 2025
f1d3844
Updated babel traverse using yarn up @babel/traverse -R
Oct 7, 2025
54c5070
ran yarn up form-data -R
Oct 7, 2025
e5d0539
updated path-to-regexp version
Oct 7, 2025
394079b
upgraded body-parser version to 1.20.3
Oct 7, 2025
2d99e9b
Merge pull request #525 from Concordium/COR-1931-babel-upgrade
rbaconcordium Oct 8, 2025
aa6fdd0
Merge pull request #526 from Concordium/COR-1931-form-data-upgrade
rbaconcordium Oct 8, 2025
e4f75ee
Merge pull request #527 from Concordium/COR-1931-path-to-regexp
rbaconcordium Oct 8, 2025
fffdcb2
removed path-to-regexp and body-parser from resolutions
Oct 8, 2025
36ae826
Merge pull request #528 from Concordium/COR-1931-body-parser
rbaconcordium Oct 8, 2025
214ab29
ran yarn upd ws -R to make sure no version of ws between 8 and 8.17.1
Oct 8, 2025
8aeab93
Merge pull request #531 from Concordium/COR-1931-ws-second-attempt
rbaconcordium Oct 8, 2025
bb2d4f2
ran yarn upd -R rollup
Oct 8, 2025
32399b9
Merge pull request #532 from Concordium/COR-1931-rollup-second-attempt
rbaconcordium Oct 8, 2025
1b45595
updated http-proxy-middleware to 2.0.9
Oct 8, 2025
77124c9
Merge pull request #533 from Concordium/COR-1931-http-proxy-middleware
rbaconcordium Oct 8, 2025
b7cc484
Merge branch 'main' into sdk-11-merge-main
soerenbf Oct 8, 2025
101a12b
Add migration guide
soerenbf Oct 8, 2025
7c50fc3
Merge branch 'release/sdk/11' into forward-comp/migration-guide
soerenbf Oct 8, 2025
b0152c6
Fix md lint
soerenbf Oct 8, 2025
3d574cc
Update docs/pages/misc-pages/upgrade-guide.md
soerenbf Oct 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions docs/pages/misc-pages/upgrade-guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
## web SDK version 11

This version of the web SDK focuses on forward compatibility, i.e. making it easier to keep applications and services
running through updates to the integration point (Concordium nodes).

### Motivation

Up until this release, certain extensions to the Concordium Node API have resulted in the SDK failing to parse query
responses, resulting in the entire query failing. This is the case even for the larger queries where the unknown/missing
information is only a small part of the response preventing the application to access the entire response.
Usually the fix was to update the SDK to a newer version which know how to parse the new information, but this imposes
work for the ecosystem for every change in the API (usually part of protocol version updates).

This major release introduces `Upward<A>` a type wrapper representing information which might be extended in future version
of the API, providing a variant representing unknown information such that queries can provide partial information.
It makes potentially extended information explicit in the types and allows each application to decide how to handle the
case of new unknown data on a case by case basis.

### Handling `Upward`

Handling upward depends on what you want to achieve. If you're running a service that integrates with a Concordium node,
you might want to fail safely by handling unknown variants gracefully. If you're writing a script it's probably easier
to fail fast.

#### Fail safe

```ts
import { isKnown, type TransactionHash } from '@concordium/web-sdk';
...

const transactionSummary: Upward<BlockItemSummary> = ...

// branch on unknown
if (isKnown(transactionSummary)) {
// transactionSummary is statically known at this point
} else {
// handle the unknown case
console.warn('Encountered unknown transaction type.');
}

// Handle as optional
// `Unknown` variant is simply represented as `null` underneath.
const transactionHash: TransactionHash.Type | undefined = transactionSummary?.hash;
```

#### Fail fast

```ts
import { assertError, type TransactionHash } from '@concordium/web-sdk';
...

const transactionSummary: Upward<BlockItemSummary> = ...

// fail with an error message in case of the unexpected happening.
assertKnown(transctionSummary, 'Expected transaction type to be known');
// transactionSummary is known at this point on.

// or handle by simple null assertion, e.g. in the case where you just sent
// the transaction to a node.
handleKnownTransaction(transactionSummary!);
```

#### Optional + Unknown values

In the SDK, `undefined` is used to represent when an optional value is _not_ present and `null` is used to represent
unknown values. If you want to branch on these different cases, it can be handled by targeting thesee specific types:

```ts
const optionalUnknown: Upward<Value> | undefined = ...
switch (optionalUnknown) {
case undefined: ... // handle optionality
case null: ... // handle unknown variant
default: ... // at this point, we know the type is `Value`
}
```

## web SDK version 7

Several types have been replaced with a module containing the type itself together with functions for constructing and
Expand Down
Loading