Skip to content

Commit 80a6e18

Browse files
internal: Publish new version (#3853)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e93e820 commit 80a6e18

10 files changed

Lines changed: 72 additions & 48 deletions

File tree

.changeset/fix-pathargs-widened-string.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

examples/benchmark-react/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# example-benchmark-react
22

3+
## 0.1.3
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`e93e820`](https://github.com/reactive/data-client/commit/e93e820a112683badd4020c7c04c2284a0f6d8bf)]:
8+
- @data-client/rest@0.16.2
9+
- @data-client/react@0.16.0
10+
311
## 0.1.2
412

513
### Patch Changes

examples/benchmark-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "example-benchmark-react",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"private": true,
55
"description": "React rendering benchmark comparing @data-client/react against other data libraries",
66
"scripts": {

examples/coin-app/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# coinbase-lite
22

3+
## 0.0.18
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`e93e820`](https://github.com/reactive/data-client/commit/e93e820a112683badd4020c7c04c2284a0f6d8bf)]:
8+
- @data-client/rest@0.16.2
9+
310
## 0.0.17
411

512
### Patch Changes

examples/coin-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coinbase-lite",
3-
"version": "0.0.17",
3+
"version": "0.0.18",
44
"packageManager": "yarn@4.13.0",
55
"description": "Coin App",
66
"scripts": {
@@ -46,7 +46,7 @@
4646
"@babel/runtime-corejs3": "7.29.2",
4747
"@data-client/img": "0.16.0",
4848
"@data-client/react": "0.16.0",
49-
"@data-client/rest": "0.16.1",
49+
"@data-client/rest": "0.16.2",
5050
"core-js": "3.49.0",
5151
"d3": "7.9.0",
5252
"history": "*",

examples/test-bundlesize/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# test-bundlesize
22

3+
## 0.1.10
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`e93e820`](https://github.com/reactive/data-client/commit/e93e820a112683badd4020c7c04c2284a0f6d8bf)]:
8+
- @data-client/rest@0.16.2
9+
- @data-client/react@0.16.0
10+
311
## 0.1.9
412

513
### Patch Changes

examples/test-bundlesize/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "test-bundlesize",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"packageManager": "yarn@4.13.0",
55
"description": "Testing Bundled Size",
66
"scripts": {

packages/rest/CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# @data-client/rest
22

3+
## 0.16.2
4+
5+
### Patch Changes
6+
7+
- [#3847](https://github.com/reactive/data-client/pull/3847) [`e93e820`](https://github.com/reactive/data-client/commit/e93e820a112683badd4020c7c04c2284a0f6d8bf) - Fix TypeScript for `RestEndpoint` subclasses when the path is inferred as `string`
8+
9+
If you extend `RestEndpoint` with a generic such as `O extends RestGenerics = any`, TypeScript can widen a path literal to `string`. Constructor callbacks like `getOptimisticResponse`, `key`, `url`, and `process` could then get the wrong parameter types (or unusable unions), even though calling the endpoint still worked at runtime.
10+
11+
The same problem could show up when you set `searchParams: undefined` explicitly next to a `body` and a widened path. Both cases now type-check as you would expect.
12+
13+
```typescript
14+
import { Entity } from '@data-client/endpoint';
15+
import { RestEndpoint, RestGenerics } from '@data-client/rest';
16+
17+
class Item extends Entity {
18+
readonly id = '';
19+
}
20+
21+
class AppRestEndpoint<O extends RestGenerics = any> extends RestEndpoint<O> {}
22+
23+
new AppRestEndpoint({
24+
path: '/items' as string,
25+
schema: Item,
26+
body: {} as { name: string },
27+
getOptimisticResponse(_snap, body) {
28+
body.name;
29+
return body;
30+
},
31+
});
32+
33+
new AppRestEndpoint({
34+
path: '/search' as string,
35+
searchParams: undefined,
36+
schema: Item,
37+
body: {} as { q: string },
38+
getOptimisticResponse(_snap, body) {
39+
body.q;
40+
return body;
41+
},
42+
});
43+
```
44+
345
## 0.16.1
446

547
### Patch Changes

packages/rest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@data-client/rest",
3-
"version": "0.16.1",
3+
"version": "0.16.2",
44
"description": "Quickly define typed REST resources and endpoints",
55
"homepage": "https://dataclient.io/rest",
66
"repository": {

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3352,7 +3352,7 @@ __metadata:
33523352
languageName: unknown
33533353
linkType: soft
33543354

3355-
"@data-client/rest@npm:0.16.1, @data-client/rest@workspace:*, @data-client/rest@workspace:packages/rest":
3355+
"@data-client/rest@npm:0.16.2, @data-client/rest@workspace:*, @data-client/rest@workspace:packages/rest":
33563356
version: 0.0.0-use.local
33573357
resolution: "@data-client/rest@workspace:packages/rest"
33583358
dependencies:
@@ -11464,7 +11464,7 @@ __metadata:
1146411464
"@babel/runtime-corejs3": "npm:7.29.2"
1146511465
"@data-client/img": "npm:0.16.0"
1146611466
"@data-client/react": "npm:0.16.0"
11467-
"@data-client/rest": "npm:0.16.1"
11467+
"@data-client/rest": "npm:0.16.2"
1146811468
"@linaria/core": "npm:*"
1146911469
"@linaria/react": "npm:*"
1147011470
"@linaria/shaker": "npm:*"

0 commit comments

Comments
 (0)