@ardatan/relay-compiler 12.1.0 → 12.1.2
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/bin/relay-compiler +7 -31
- package/codegen/CodegenRunner.js.flow +3 -6
- package/codegen/RelayFileWriter.js.flow +2 -3
- package/core/ASTCache.js.flow +4 -5
- package/core/CompilerContext.js.flow +5 -7
- package/lib/codegen/CodegenRunner.js +1 -5
- package/lib/codegen/RelayFileWriter.js +0 -3
- package/lib/core/ASTCache.js +2 -5
- package/lib/core/CompilerContext.js +3 -7
- package/lib/transforms/SkipRedundantNodesTransform.js +2 -4
- package/package.json +1 -2
- package/relay-compiler.js +1 -1
- package/relay-compiler.min.js +1 -1
- package/transforms/SkipRedundantNodesTransform.js.flow +3 -4
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
const IRTransformer = require('../core/IRTransformer');
|
|
16
16
|
|
|
17
17
|
import type CompilerContext from '../core/CompilerContext';
|
|
18
|
-
const IMap = require('immutable').Map;
|
|
19
18
|
const partitionArray = require('../util/partitionArray');
|
|
20
19
|
const getIdentifierForSelection = require('../core/getIdentifierForSelection');
|
|
21
20
|
const invariant = require('invariant');
|
|
@@ -31,7 +30,7 @@ import type {Fragment, Node, Root, SplitOperation, Selection} from '../core/IR';
|
|
|
31
30
|
* etc).
|
|
32
31
|
*/
|
|
33
32
|
// $FlowFixMe[value-as-type]
|
|
34
|
-
type SelectionMap =
|
|
33
|
+
type SelectionMap = Map<string, ?SelectionMap>;
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* A transform that removes redundant fields and fragment spreads. Redundancy is
|
|
@@ -139,7 +138,7 @@ function visitNode<T: Fragment | Root | SplitOperation>(node: T): ?T {
|
|
|
139
138
|
cache = new Map();
|
|
140
139
|
// $FlowFixMe[incompatible-use]
|
|
141
140
|
const context: CompilerContext = this.getContext();
|
|
142
|
-
return transformNode(context.getSchema(), node, new
|
|
141
|
+
return transformNode(context.getSchema(), node, new Map()).node;
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
/**
|
|
@@ -197,7 +196,7 @@ function transformNode<T: Node>(
|
|
|
197
196
|
const transformed = transformNode(
|
|
198
197
|
schema,
|
|
199
198
|
selection,
|
|
200
|
-
selectionMap.get(identifier) || new
|
|
199
|
+
selectionMap.get(identifier) || new Map(),
|
|
201
200
|
);
|
|
202
201
|
if (transformed.node) {
|
|
203
202
|
selections.push(transformed.node);
|