Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 0 additions & 5 deletions .changeset/lucky-turkeys-wash.md

This file was deleted.

10 changes: 10 additions & 0 deletions examples/benchmark-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# example-benchmark-react

## 0.1.11

### Patch Changes

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190), [`adb82f1`](https://github.com/reactive/data-client/commit/adb82f15c1959ecfc09565a519d2672a2d63178c)]:
- @data-client/core@0.18.1
- @data-client/react@0.18.1
- @data-client/rest@0.18.1
- @data-client/endpoint@0.18.0

## 0.1.10

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "example-benchmark-react",
"version": "0.1.10",
"version": "0.1.11",
"private": true,
"description": "React rendering benchmark comparing @data-client/react against other data libraries",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions examples/benchmark/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# example-benchmark

## 0.4.86

### Patch Changes

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190)]:
- @data-client/core@0.18.1
- @data-client/normalizr@0.18.1
- @data-client/endpoint@0.18.0

## 0.4.85

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "example-benchmark",
"version": "0.4.85",
"version": "0.4.86",
"description": "Benchmark for normalizr",
"main": "index.js",
"author": "Nathaniel Tucker",
Expand Down
8 changes: 8 additions & 0 deletions examples/coin-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# coinbase-lite

## 0.0.26

### Patch Changes

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190), [`adb82f1`](https://github.com/reactive/data-client/commit/adb82f15c1959ecfc09565a519d2672a2d63178c)]:
- @data-client/react@0.18.1
- @data-client/rest@0.18.1

## 0.0.25

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions examples/coin-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coinbase-lite",
"version": "0.0.25",
"version": "0.0.26",
"packageManager": "yarn@4.14.1",
"description": "Coin App",
"scripts": {
Expand Down Expand Up @@ -45,8 +45,8 @@
"@anansi/router": "0.10.23",
"@babel/runtime-corejs3": "7.29.2",
"@data-client/img": "0.18.0",
"@data-client/react": "0.18.0",
"@data-client/rest": "0.18.0",
"@data-client/react": "0.18.1",
"@data-client/rest": "0.18.1",
"core-js": "3.49.0",
"d3": "7.9.0",
"history": "*",
Expand Down
8 changes: 8 additions & 0 deletions examples/normalizr-github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# normalizr-github-example

## 0.1.60

### Patch Changes

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190)]:
- @data-client/normalizr@0.18.1
- @data-client/endpoint@0.18.0

## 0.1.59

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/normalizr-github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "normalizr-github-example",
"version": "0.1.59",
"version": "0.1.60",
"description": "And example of using Normalizr with github",
"main": "index.js",
"author": "Paul Armstrong",
Expand Down
8 changes: 8 additions & 0 deletions examples/normalizr-redux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# normalizr-redux-example

## 0.1.58

### Patch Changes

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190)]:
- @data-client/normalizr@0.18.1
- @data-client/endpoint@0.18.0

## 0.1.57

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/normalizr-redux/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "normalizr-redux-example",
"version": "0.1.57",
"version": "0.1.58",
"description": "And example of using Normalizr with Redux",
"main": "index.js",
"author": "Paul Armstrong",
Expand Down
8 changes: 8 additions & 0 deletions examples/normalizr-relationships/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# normalizr-relationships

## 0.1.60

### Patch Changes

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190)]:
- @data-client/normalizr@0.18.1
- @data-client/endpoint@0.18.0

## 0.1.59

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/normalizr-relationships/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "normalizr-relationships",
"version": "0.1.59",
"version": "0.1.60",
"description": "And example of using Normalizr with relationships",
"main": "index.js",
"author": "Paul Armstrong",
Expand Down
9 changes: 9 additions & 0 deletions examples/test-bundlesize/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# test-bundlesize

## 0.1.18

### Patch Changes

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190), [`adb82f1`](https://github.com/reactive/data-client/commit/adb82f15c1959ecfc09565a519d2672a2d63178c)]:
- @data-client/react@0.18.1
- @data-client/rest@0.18.1
- @data-client/img@0.18.0

## 0.1.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/test-bundlesize/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "test-bundlesize",
"version": "0.1.17",
"version": "0.1.18",
"packageManager": "yarn@4.14.1",
"description": "Testing Bundled Size",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @data-client/core

## 0.18.1

### Patch Changes

- [#3960](https://github.com/reactive/data-client/pull/3960) [`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190) - Endpoints that resolve to falsy values (`''`, `0`, `false`, or `null`) no longer trigger infinite refetches.

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190)]:
- @data-client/normalizr@0.18.1

## 0.18.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-client/core",
"version": "0.18.0",
"version": "0.18.1",
"description": "Async State Management without the Management. REST, GraphQL, SSE, Websockets, Fetch",
"sideEffects": false,
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/controller/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export default class Controller<
return {
data: cacheEndpoints,
expiryStatus: this.getExpiryStatus(
!cacheEndpoints,
cacheEndpoints === undefined,
!!endpoint.invalidIfStale,
meta,
),
Expand Down
47 changes: 47 additions & 0 deletions packages/core/src/controller/__tests__/getResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,53 @@ describe('Controller.getResponse() with Scalar', () => {
);
});

describe('Controller.getResponse() with schema-less endpoints', () => {
it.each([
['empty string', ''],
['zero', 0],
['false', false],
['null', null],
])('treats cached %s as valid data', (_name, cachedValue) => {
const controller = new Contoller();
const endpoint = new Endpoint(() => Promise.resolve(), {
key: () => 'falsy-endpoint',
});
const key = endpoint.key();
const fetchedAt = Date.now();
const state = {
...initialState,
endpoints: {
[key]: cachedValue,
},
meta: {
[key]: {
date: fetchedAt,
fetchedAt,
expiresAt: fetchedAt + 1000,
},
},
};

const { data, expiryStatus } = controller.getResponse(endpoint, state);
expect(data).toBe(cachedValue);
expect(expiryStatus).toBe(ExpiryStatus.Valid);
});

it('treats undefined cache entries as invalid', () => {
const controller = new Contoller();
const endpoint = new Endpoint(() => Promise.resolve(), {
key: () => 'missing-endpoint',
});

const { data, expiryStatus } = controller.getResponse(
endpoint,
initialState,
);
expect(data).toBeUndefined();
expect(expiryStatus).toBe(ExpiryStatus.Invalid);
});
});

describe('Snapshot.getResponseMeta()', () => {
it('denormalizes schema with extra members but not set', () => {
const controller = new Contoller();
Expand Down
6 changes: 6 additions & 0 deletions packages/normalizr/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 0.18.1

### Patch Changes

- [#3960](https://github.com/reactive/data-client/pull/3960) [`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190) - Endpoints that resolve to falsy values (`''`, `0`, `false`, or `null`) no longer trigger infinite refetches.

## 0.18.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/normalizr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-client/normalizr",
"version": "0.18.0",
"version": "0.18.1",
"description": "Normalizes and denormalizes JSON according to schema for Redux and Flux applications",
"homepage": "https://dataclient.io/docs/concepts/normalization",
"keywords": [
Expand Down
9 changes: 9 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @data-client/react

## 0.18.1

### Patch Changes

- [#3960](https://github.com/reactive/data-client/pull/3960) [`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190) - Endpoints that resolve to falsy values (`''`, `0`, `false`, or `null`) no longer trigger infinite refetches.

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190)]:
- @data-client/core@0.18.1

## 0.18.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-client/react",
"version": "0.18.0",
"version": "0.18.1",
"description": "Async State Management without the Management. REST, GraphQL, SSE, Websockets, Fetch",
"homepage": "https://dataclient.io",
"repository": {
Expand Down
6 changes: 6 additions & 0 deletions packages/rest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @data-client/rest

## 0.18.1

### Patch Changes

- [`adb82f1`](https://github.com/reactive/data-client/commit/adb82f15c1959ecfc09565a519d2672a2d63178c) - RestEndpoint.remove.name is 'partialUpdate' since it uses 'PATCH'

## 0.18.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/rest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-client/rest",
"version": "0.18.0",
"version": "0.18.1",
"description": "Quickly define typed REST resources and endpoints",
"homepage": "https://dataclient.io/rest",
"repository": {
Expand Down
9 changes: 9 additions & 0 deletions packages/vue/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @data-client/vue

## 0.18.1

### Patch Changes

- [#3960](https://github.com/reactive/data-client/pull/3960) [`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190) - Endpoints that resolve to falsy values (`''`, `0`, `false`, or `null`) no longer trigger infinite refetches.

- Updated dependencies [[`dfa657e`](https://github.com/reactive/data-client/commit/dfa657eb419641845bc7c39abe52189905773190)]:
- @data-client/core@0.18.1

## 0.18.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-client/vue",
"version": "0.18.0",
"version": "0.18.1",
"description": "Async State Management without the Management. REST, GraphQL, SSE, Websockets, Fetch",
"homepage": "https://dataclient.io",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3257,7 +3257,7 @@ __metadata:
languageName: unknown
linkType: soft

"@data-client/react@npm:0.18.0, @data-client/react@workspace:*, @data-client/react@workspace:packages/react":
"@data-client/react@npm:0.18.1, @data-client/react@workspace:*, @data-client/react@workspace:packages/react":
version: 0.0.0-use.local
resolution: "@data-client/react@workspace:packages/react"
dependencies:
Expand Down Expand Up @@ -3301,7 +3301,7 @@ __metadata:
languageName: unknown
linkType: soft

"@data-client/rest@npm:0.18.0, @data-client/rest@workspace:*, @data-client/rest@workspace:packages/rest":
"@data-client/rest@npm:0.18.1, @data-client/rest@workspace:*, @data-client/rest@workspace:packages/rest":
version: 0.0.0-use.local
resolution: "@data-client/rest@workspace:packages/rest"
dependencies:
Expand Down Expand Up @@ -11001,8 +11001,8 @@ __metadata:
"@babel/core": "npm:7.29.0"
"@babel/runtime-corejs3": "npm:7.29.2"
"@data-client/img": "npm:0.18.0"
"@data-client/react": "npm:0.18.0"
"@data-client/rest": "npm:0.18.0"
"@data-client/react": "npm:0.18.1"
"@data-client/rest": "npm:0.18.1"
"@linaria/core": "npm:*"
"@linaria/react": "npm:*"
"@linaria/shaker": "npm:*"
Expand Down
Loading