-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
128 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
'@data-client/normalizr': minor | ||
'@data-client/endpoint': minor | ||
'@data-client/graphql': minor | ||
'@data-client/rest': minor | ||
'@data-client/react': patch | ||
'@data-client/core': patch | ||
--- | ||
|
||
Change Schema.normalize + Schema.denormalize interface | ||
|
||
```ts | ||
interface SchemaSimple { | ||
normalize( | ||
input: any, | ||
parent: any, | ||
key: any, | ||
args: any[], | ||
visit: (schema: any, value: any, parent: any, key: any, args: readonly any[]) => any, | ||
addEntity: (...args: any) => any, | ||
getEntity: (...args: any) => any, | ||
checkLoop: (...args: any) => any, | ||
): any; | ||
denormalize( | ||
input: {}, | ||
args: readonly any[], | ||
unvisit: (schema: any, input: any) => any, | ||
): T; | ||
} | ||
``` | ||
|
||
This results in a 10% normalize performance boost. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
'@data-client/normalizr': minor | ||
--- | ||
|
||
Change normalize() interface | ||
|
||
```ts | ||
function normalize( | ||
schema, | ||
input, | ||
{ date, expiresAt, fetchedAt, args }, | ||
{ entities, indexes, entityMeta }, | ||
); | ||
``` | ||
|
||
#### Usage | ||
|
||
```ts | ||
const { result, entities, indexes, entityMeta } = normalize( | ||
action.endpoint.schema, | ||
payload, | ||
action.meta, | ||
state, | ||
); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
'@data-client/normalizr': minor | ||
--- | ||
|
||
Change denormalize() interface | ||
|
||
```ts | ||
function denormalize(schema, input, entities, args); | ||
``` | ||
|
||
#### Usage | ||
|
||
```ts | ||
const value = denormalize(endpoint.schema, input, state.entities, args); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@data-client/test': patch | ||
'@data-client/img': patch | ||
'@data-client/ssr': patch | ||
--- | ||
|
||
Expand peerdep support range to include ^0.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
'@data-client/normalizr': minor | ||
--- | ||
|
||
Change MemoCache methods interface | ||
|
||
```ts | ||
class MemoCache { | ||
denormalize(schema, input, entities, args): { data, paths }; | ||
query(schema, args, entities, indexes): data; | ||
buildQueryKey(schema, args, entities, indexes): normalized; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters