@khanacademy/wonder-blocks-data 11.0.3 → 11.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/components/data.d.ts +1 -1
- package/dist/components/data.js.flow +1 -2
- package/dist/components/gql-router.js.flow +1 -2
- package/dist/components/intercept-context.js.flow +1 -2
- package/dist/components/intercept-requests.js.flow +1 -2
- package/dist/components/track-data.js.flow +1 -2
- package/dist/hooks/use-cached-effect.js.flow +1 -2
- package/dist/hooks/use-gql-router-context.js.flow +1 -2
- package/dist/hooks/use-gql.js.flow +1 -2
- package/dist/hooks/use-hydratable-effect.js.flow +1 -2
- package/dist/hooks/use-request-interception.js.flow +1 -2
- package/dist/hooks/use-server-effect.js.flow +1 -2
- package/dist/hooks/use-shared-cache.js.flow +1 -2
- package/dist/index.js.flow +1 -2
- package/dist/util/data-error.js.flow +1 -2
- package/dist/util/get-gql-data-from-response.js.flow +1 -2
- package/dist/util/get-gql-request-id.js.flow +1 -2
- package/dist/util/gql-error.js.flow +1 -2
- package/dist/util/gql-router-context.js.flow +1 -2
- package/dist/util/gql-types.js.flow +1 -2
- package/dist/util/graphql-document-node-parser.js.flow +1 -2
- package/dist/util/graphql-types.js.flow +28 -24
- package/dist/util/hydration-cache-api.js.flow +1 -2
- package/dist/util/merge-gql-context.js.flow +1 -2
- package/dist/util/purge-caches.js.flow +1 -2
- package/dist/util/request-api.js.flow +1 -2
- package/dist/util/request-fulfillment.js.flow +1 -2
- package/dist/util/request-tracking.js.flow +1 -2
- package/dist/util/result-from-cache-response.js.flow +1 -2
- package/dist/util/scoped-in-memory-cache.js.flow +1 -2
- package/dist/util/serializable-in-memory-cache.js.flow +1 -2
- package/dist/util/ssr-cache.js.flow +1 -2
- package/dist/util/status.js.flow +1 -2
- package/dist/util/to-gql-operation.js.flow +1 -2
- package/dist/util/types.js.flow +1 -2
- package/package.json +2 -2
- package/src/components/__tests__/data.test.tsx +0 -34
- package/src/components/data.ts +4 -4
- package/src/util/graphql-types.js.flow +30 -0
- package/src/util/graphql-types.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @khanacademy/wonder-blocks-data
|
|
2
2
|
|
|
3
|
+
## 11.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 43155769: Fix DocumentNode type definition
|
|
8
|
+
|
|
9
|
+
## 11.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- bedcbcf8: Update <Data>'s 'children' prop to allow a ReactNode to be returned
|
|
14
|
+
|
|
3
15
|
## 11.0.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -41,7 +41,7 @@ TData extends ValidCacheData> = {
|
|
|
41
41
|
* loading state and data or error that gets retrieved from cache or loaded
|
|
42
42
|
* via the request if no cached value is available.
|
|
43
43
|
*/
|
|
44
|
-
children: (result: Result<TData>) => React.
|
|
44
|
+
children: (result: Result<TData>) => React.ReactNode;
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
47
|
* This component is the main component of Wonder Blocks Data. With this, data
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import { WhenClientSide } from "../hooks/use-hydratable-effect";
|
|
10
9
|
import type { Result, ValidCacheData } from "../util/types";
|
|
@@ -51,7 +50,7 @@ declare type Props<TData: ValidCacheData> = {|
|
|
|
51
50
|
* loading state and data or error that gets retrieved from cache or loaded
|
|
52
51
|
* via the request if no cached value is available.
|
|
53
52
|
*/
|
|
54
|
-
children: (result: Result<TData>) => React.
|
|
53
|
+
children: (result: Result<TData>) => React.Node,
|
|
55
54
|
|};
|
|
56
55
|
/**
|
|
57
56
|
* This component is the main component of Wonder Blocks Data. With this, data
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import type { GqlContext, GqlFetchFn } from "../util/gql-types";
|
|
10
9
|
declare type Props<TContext: GqlContext> = {|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import type { ValidCacheData } from "../util/types";
|
|
10
9
|
declare type InterceptContextData = $ReadOnlyArray<
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import type { ValidCacheData } from "../util/types";
|
|
10
9
|
declare type Props<TData: ValidCacheData> = {|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
declare type TrackDataProps = {|
|
|
10
9
|
children: React.Node,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { Result, ValidCacheData } from "../util/types";
|
|
9
8
|
import { FetchPolicy } from "../util/types";
|
|
10
9
|
declare type CachedEffectOptions<TData: ValidCacheData> = {|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { GqlRouterConfiguration, GqlContext } from "../util/gql-types";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { Result, ValidCacheData } from "../util/types";
|
|
9
8
|
declare type ServerEffectOptions = {|
|
|
10
9
|
/**
|
package/dist/index.js.flow
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for data
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import { KindError } from "@khanacademy/wonder-stuff-core";
|
|
9
8
|
import type { ErrorOptions } from "./types";
|
|
10
9
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import { KindError } from "@khanacademy/wonder-stuff-core";
|
|
9
8
|
import type { ErrorOptions } from "./types";
|
|
10
9
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import type { GqlRouterConfiguration } from "./gql-types";
|
|
10
9
|
declare export var GqlRouterContext: React.Context<GqlRouterConfiguration<any> | null | void>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { DocumentNode, VariableDefinitionNode } from "./graphql-types";
|
|
9
8
|
declare export var DocumentTypes: $ReadOnly<{|
|
|
10
9
|
query: "query",
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
// @flow
|
|
2
|
+
// NOTE(somewhatabstract):
|
|
3
|
+
// These types are bare minimum to support document parsing. They're derived
|
|
4
|
+
// from graphql@14.5.8, the last version that provided flow types.
|
|
5
|
+
// Doing this avoids us having to take a dependency on that library just for
|
|
6
|
+
// these types.
|
|
8
7
|
export interface DefinitionNode {
|
|
9
|
-
|
|
8
|
+
+kind: string;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
+
|
|
20
|
-
+
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
|
|
11
|
+
export type VariableDefinitionNode = {
|
|
12
|
+
+kind: "VariableDefinition",
|
|
13
|
+
...
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export interface OperationDefinitionNode extends DefinitionNode {
|
|
17
|
+
+kind: "OperationDefinition";
|
|
18
|
+
+operation: string;
|
|
19
|
+
+variableDefinitions: $ReadOnlyArray<VariableDefinitionNode>;
|
|
20
|
+
+name?: {|
|
|
21
|
+
+kind: mixed,
|
|
22
|
+
+value: string,
|
|
23
|
+
|};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type DocumentNode = {
|
|
27
|
+
+kind: "Document",
|
|
28
|
+
+definitions: $ReadOnlyArray<DefinitionNode>,
|
|
29
|
+
...
|
|
30
|
+
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { ValidCacheData, CachedResponse, ResponseCache } from "./types";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { Result, ValidCacheData } from "./types";
|
|
9
8
|
declare type RequestCache = {
|
|
10
9
|
[id: string]: Promise<Result<any>>,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import { SsrCache } from "./ssr-cache";
|
|
10
9
|
import { RequestFulfillment } from "./request-fulfillment";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { ValidCacheData, CachedResponse, Result } from "./types";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { ScopedCache, RawScopedCache, ValidCacheData } from "./types";
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import { ScopedInMemoryCache } from "./scoped-in-memory-cache";
|
|
9
8
|
import type { ValidCacheData, RawScopedCache } from "./types";
|
|
10
9
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import { SerializableInMemoryCache } from "./serializable-in-memory-cache";
|
|
9
8
|
import type { ValidCacheData, CachedResponse, ResponseCache } from "./types";
|
|
10
9
|
|
package/dist/util/status.js.flow
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flowtype definitions for
|
|
2
|
+
* Flowtype definitions for data
|
|
3
3
|
* Generated by Flowgen from a Typescript Definition
|
|
4
4
|
* Flowgen v1.21.0
|
|
5
5
|
* @flow
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
import type { GqlOperation } from "./gql-types";
|
|
9
8
|
import type { DocumentNode } from "./graphql-types";
|
|
10
9
|
|
package/dist/util/types.js.flow
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@khanacademy/wonder-blocks-data",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.5",
|
|
4
4
|
"design": "v1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"react": "16.14.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"wb-dev-build-settings": "^0.9.
|
|
24
|
+
"wb-dev-build-settings": "^0.9.4"
|
|
25
25
|
},
|
|
26
26
|
"author": "",
|
|
27
27
|
"license": "MIT"
|