@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.
@@ -1177,12 +1177,6 @@ module.exports = require("fs");
1177
1177
 
1178
1178
  module.exports = require("crypto");
1179
1179
 
1180
- /***/ }),
1181
- /* 15 */
1182
- /***/ (function(module, exports) {
1183
-
1184
- module.exports = require("immutable");
1185
-
1186
1180
  /***/ }),
1187
1181
  /* 16 */
1188
1182
  /***/ (function(module, exports, __webpack_require__) {
@@ -1978,10 +1972,6 @@ var invariant = __webpack_require__(6);
1978
1972
  var _require = __webpack_require__(1),
1979
1973
  createUserError = _require.createUserError; // $FlowFixMe[untyped-import] - immutable.js is not flow-typed
1980
1974
 
1981
-
1982
- var _require2 = __webpack_require__(15),
1983
- ImmutableOrderedMap = _require2.OrderedMap;
1984
-
1985
1975
  /**
1986
1976
  * An immutable representation of a corpus of documents being compiled together.
1987
1977
  * For each document, the context stores the IR and any validation errors.
@@ -1990,7 +1980,7 @@ var CompilerContext = /*#__PURE__*/function () {
1990
1980
  // $FlowFixMe[value-as-type]
1991
1981
  function CompilerContext(schema) {
1992
1982
  this._isMutable = false;
1993
- this._documents = new ImmutableOrderedMap();
1983
+ this._documents = new Map();
1994
1984
  this._withTransform = new WeakMap();
1995
1985
  this._schema = schema;
1996
1986
  }
@@ -2101,12 +2091,11 @@ var CompilerContext = /*#__PURE__*/function () {
2101
2091
  };
2102
2092
 
2103
2093
  _proto.withMutations = function withMutations(fn) {
2104
- var mutableCopy = this._update(this._documents.asMutable());
2094
+ var mutableCopy = this._update(this._documents);
2105
2095
 
2106
2096
  mutableCopy._isMutable = true;
2107
2097
  var result = fn(mutableCopy);
2108
2098
  result._isMutable = false;
2109
- result._documents = result._documents.asImmutable();
2110
2099
  return this._documents === result._documents ? this : result;
2111
2100
  };
2112
2101
 
@@ -2521,10 +2510,6 @@ module.exports = CodegenDirectory;
2521
2510
 
2522
2511
  var Profiler = __webpack_require__(7); // $FlowFixMe[untyped-import] : Immutable is not typed
2523
2512
 
2524
-
2525
- var _require = __webpack_require__(15),
2526
- ImmutableMap = _require.Map;
2527
-
2528
2513
  var ASTCache = /*#__PURE__*/function () {
2529
2514
  function ASTCache(config) {
2530
2515
  this._documents = new Map();
@@ -2537,14 +2522,14 @@ var ASTCache = /*#__PURE__*/function () {
2537
2522
  var _proto = ASTCache.prototype;
2538
2523
 
2539
2524
  _proto.documents = function documents() {
2540
- return ImmutableMap(this._documents);
2525
+ return new Map(this._documents);
2541
2526
  } // parse should return the set of changes
2542
2527
  ;
2543
2528
 
2544
2529
  _proto.parseFiles = function parseFiles(files) {
2545
2530
  var _this = this;
2546
2531
 
2547
- var documents = ImmutableMap();
2532
+ var documents = new Map();
2548
2533
  files.forEach(function (file) {
2549
2534
  if (!file.exists) {
2550
2535
  _this._documents["delete"](file.relPath);
@@ -8530,10 +8515,6 @@ var _require = __webpack_require__(59),
8530
8515
  /* $FlowFixMe[untyped-import] - importing immutable, which is untyped (and flow
8531
8516
  * is sad about it) */
8532
8517
 
8533
-
8534
- var _require2 = __webpack_require__(15),
8535
- ImmutableMap = _require2.Map;
8536
-
8537
8518
  var CodegenRunner = /*#__PURE__*/function () {
8538
8519
  // parser => writers that are affected by it
8539
8520
  function CodegenRunner(options) {
@@ -8750,7 +8731,7 @@ var CodegenRunner = /*#__PURE__*/function () {
8750
8731
  _parser2 = _this5$writerConfigs$.parser,
8751
8732
  baseParsers = _this5$writerConfigs$.baseParsers,
8752
8733
  isGeneratedFile = _this5$writerConfigs$.isGeneratedFile;
8753
- var baseDocuments = ImmutableMap();
8734
+ var baseDocuments = new Map();
8754
8735
 
8755
8736
  if (baseParsers) {
8756
8737
  baseParsers.forEach(function (baseParserName) {
@@ -11279,9 +11260,6 @@ var _require = __webpack_require__(76),
11279
11260
  var _require2 = __webpack_require__(10),
11280
11261
  isExecutableDefinitionAST = _require2.isExecutableDefinitionAST;
11281
11262
 
11282
- var _require3 = __webpack_require__(15),
11283
- ImmutableMap = _require3.Map;
11284
-
11285
11263
  function compileAll(_ref) {
11286
11264
  var baseDir = _ref.baseDir,
11287
11265
  baseDocuments = _ref.baseDocuments,
@@ -17414,8 +17392,6 @@ var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(5));
17414
17392
 
17415
17393
  var IRTransformer = __webpack_require__(3);
17416
17394
 
17417
- var IMap = __webpack_require__(15).Map;
17418
-
17419
17395
  var partitionArray = __webpack_require__(16);
17420
17396
 
17421
17397
  var getIdentifierForSelection = __webpack_require__(41);
@@ -17527,7 +17503,7 @@ function visitNode(node) {
17527
17503
  cache = new Map(); // $FlowFixMe[incompatible-use]
17528
17504
 
17529
17505
  var context = this.getContext();
17530
- return transformNode(context.getSchema(), node, new IMap()).node;
17506
+ return transformNode(context.getSchema(), node, new Map()).node;
17531
17507
  }
17532
17508
  /**
17533
17509
  * The most straightforward approach would be two passes: one to record the
@@ -17583,7 +17559,7 @@ function transformNode(schema, node, selectionMap) {
17583
17559
  case 'InlineDataFragmentSpread':
17584
17560
  case 'LinkedField':
17585
17561
  {
17586
- var transformed = transformNode(schema, selection, selectionMap.get(identifier) || new IMap());
17562
+ var transformed = transformNode(schema, selection, selectionMap.get(identifier) || new Map());
17587
17563
 
17588
17564
  if (transformed.node) {
17589
17565
  selections.push(transformed.node);
@@ -21,9 +21,6 @@ const invariant = require('invariant');
21
21
  const path = require('path');
22
22
 
23
23
  const {create: createSchema} = require('../core/Schema');
24
- /* $FlowFixMe[untyped-import] - importing immutable, which is untyped (and flow
25
- * is sad about it) */
26
- const {Map: ImmutableMap} = require('immutable');
27
24
 
28
25
  import type ASTCache from '../core/ASTCache';
29
26
  import type {Schema} from '../core/Schema';
@@ -62,8 +59,8 @@ type WriterConfigs = {[writer: string]: WriterConfig, ...};
62
59
  export type WriteFilesOptions = {|
63
60
  onlyValidate: boolean,
64
61
  schema: Schema,
65
- documents: ImmutableMap<string, DocumentNode>,
66
- baseDocuments: ImmutableMap<string, DocumentNode>,
62
+ documents: Map<string, DocumentNode>,
63
+ baseDocuments: Map<string, DocumentNode>,
67
64
  sourceControl: ?SourceControl,
68
65
  reporter: Reporter,
69
66
  generatedDirectories?: Array<string>,
@@ -273,7 +270,7 @@ class CodegenRunner {
273
270
  isGeneratedFile,
274
271
  } = this.writerConfigs[writerName];
275
272
 
276
- let baseDocuments = ImmutableMap();
273
+ let baseDocuments = new Map();
277
274
  if (baseParsers) {
278
275
  baseParsers.forEach(baseParserName => {
279
276
  invariant(
@@ -30,7 +30,6 @@ const {
30
30
  getReaderSourceDefinitionName,
31
31
  } = require('../core/GraphQLDerivedFromMetadata');
32
32
  const {isExecutableDefinitionAST} = require('../core/SchemaUtils');
33
- const {Map: ImmutableMap} = require('immutable');
34
33
 
35
34
  import type {Schema} from '../core/Schema';
36
35
  import type {
@@ -147,9 +146,9 @@ function writeAll({
147
146
  config: WriterConfig,
148
147
  onlyValidate: boolean,
149
148
  // $FlowFixMe[value-as-type]
150
- baseDocuments: ImmutableMap<string, DocumentNode>,
149
+ baseDocuments: Map<string, DocumentNode>,
151
150
  // $FlowFixMe[value-as-type]
152
- documents: ImmutableMap<string, DocumentNode>,
151
+ documents: Map<string, DocumentNode>,
153
152
  schema: Schema,
154
153
  reporter: Reporter,
155
154
  sourceControl: ?SourceControl,
@@ -15,7 +15,6 @@
15
15
  const Profiler = require('./GraphQLCompilerProfiler');
16
16
 
17
17
  // $FlowFixMe[untyped-import] : Immutable is not typed
18
- const {Map: ImmutableMap} = require('immutable');
19
18
 
20
19
  import type {File} from '../codegen/CodegenTypes';
21
20
  import type {DocumentNode} from 'graphql';
@@ -36,13 +35,13 @@ class ASTCache {
36
35
 
37
36
  // Short-term: we don't do subscriptions/delta updates, instead always use all definitions
38
37
  // $FlowFixMe[value-as-type]
39
- documents(): ImmutableMap<string, DocumentNode> {
40
- return ImmutableMap(this._documents);
38
+ documents(): Map<string, DocumentNode> {
39
+ return Map(this._documents);
41
40
  }
42
41
 
43
42
  // parse should return the set of changes
44
- parseFiles(files: Set<File>): ImmutableMap<string, DocumentNode> {
45
- let documents = ImmutableMap();
43
+ parseFiles(files: Set<File>): Map<string, DocumentNode> {
44
+ let documents = new Map();
46
45
 
47
46
  files.forEach(file => {
48
47
  if (!file.exists) {
@@ -17,8 +17,6 @@ const Profiler = require('./GraphQLCompilerProfiler');
17
17
  const invariant = require('invariant');
18
18
 
19
19
  const {createUserError} = require('./CompilerError');
20
- // $FlowFixMe[untyped-import] - immutable.js is not flow-typed
21
- const {OrderedMap: ImmutableOrderedMap} = require('immutable');
22
20
 
23
21
  import type {Reporter} from '../reporters/Reporter';
24
22
  import type {Fragment, Location, Root, SplitOperation} from './IR';
@@ -35,13 +33,13 @@ export type CompilerContextDocument = Fragment | Root | SplitOperation;
35
33
  class CompilerContext {
36
34
  _isMutable: boolean;
37
35
  // $FlowFixMe[value-as-type]
38
- _documents: ImmutableOrderedMap<string, CompilerContextDocument>;
36
+ _documents: Map<string, CompilerContextDocument>;
39
37
  _withTransform: WeakMap<IRTransform, CompilerContext>;
40
38
  +_schema: Schema;
41
39
 
42
40
  constructor(schema: Schema) {
43
41
  this._isMutable = false;
44
- this._documents = new ImmutableOrderedMap();
42
+ this._documents = new Map();
45
43
  this._withTransform = new WeakMap();
46
44
  this._schema = schema;
47
45
  }
@@ -165,16 +163,16 @@ class CompilerContext {
165
163
  }
166
164
 
167
165
  withMutations(fn: CompilerContext => CompilerContext): CompilerContext {
168
- const mutableCopy = this._update(this._documents.asMutable());
166
+ const mutableCopy = this._update(this._documents);
169
167
  mutableCopy._isMutable = true;
170
168
  const result = fn(mutableCopy);
171
169
  result._isMutable = false;
172
- result._documents = result._documents.asImmutable();
170
+ result._documents = result._documents;
173
171
  return this._documents === result._documents ? this : result;
174
172
  }
175
173
 
176
174
  _update(
177
- documents: ImmutableOrderedMap<string, CompilerContextDocument>,
175
+ documents: Map<string, CompilerContextDocument>,
178
176
  ): CompilerContext {
179
177
  const context = this._isMutable
180
178
  ? this
@@ -35,10 +35,6 @@ var _require = require('../core/Schema'),
35
35
  /* $FlowFixMe[untyped-import] - importing immutable, which is untyped (and flow
36
36
  * is sad about it) */
37
37
 
38
-
39
- var _require2 = require('immutable'),
40
- ImmutableMap = _require2.Map;
41
-
42
38
  var CodegenRunner = /*#__PURE__*/function () {
43
39
  // parser => writers that are affected by it
44
40
  function CodegenRunner(options) {
@@ -255,7 +251,7 @@ var CodegenRunner = /*#__PURE__*/function () {
255
251
  _parser2 = _this5$writerConfigs$.parser,
256
252
  baseParsers = _this5$writerConfigs$.baseParsers,
257
253
  isGeneratedFile = _this5$writerConfigs$.isGeneratedFile;
258
- var baseDocuments = ImmutableMap();
254
+ var baseDocuments = new Map();
259
255
 
260
256
  if (baseParsers) {
261
257
  baseParsers.forEach(function (baseParserName) {
@@ -48,9 +48,6 @@ var _require = require('../core/GraphQLDerivedFromMetadata'),
48
48
  var _require2 = require('../core/SchemaUtils'),
49
49
  isExecutableDefinitionAST = _require2.isExecutableDefinitionAST;
50
50
 
51
- var _require3 = require('immutable'),
52
- ImmutableMap = _require3.Map;
53
-
54
51
  function compileAll(_ref) {
55
52
  var baseDir = _ref.baseDir,
56
53
  baseDocuments = _ref.baseDocuments,
@@ -13,9 +13,6 @@
13
13
  var Profiler = require('./GraphQLCompilerProfiler'); // $FlowFixMe[untyped-import] : Immutable is not typed
14
14
 
15
15
 
16
- var _require = require('immutable'),
17
- ImmutableMap = _require.Map;
18
-
19
16
  var ASTCache = /*#__PURE__*/function () {
20
17
  function ASTCache(config) {
21
18
  this._documents = new Map();
@@ -28,14 +25,14 @@ var ASTCache = /*#__PURE__*/function () {
28
25
  var _proto = ASTCache.prototype;
29
26
 
30
27
  _proto.documents = function documents() {
31
- return ImmutableMap(this._documents);
28
+ return Map(this._documents);
32
29
  } // parse should return the set of changes
33
30
  ;
34
31
 
35
32
  _proto.parseFiles = function parseFiles(files) {
36
33
  var _this = this;
37
34
 
38
- var documents = ImmutableMap();
35
+ var documents = new Map();
39
36
  files.forEach(function (file) {
40
37
  if (!file.exists) {
41
38
  _this._documents["delete"](file.relPath);
@@ -17,10 +17,6 @@ var invariant = require('invariant');
17
17
  var _require = require('./CompilerError'),
18
18
  createUserError = _require.createUserError; // $FlowFixMe[untyped-import] - immutable.js is not flow-typed
19
19
 
20
-
21
- var _require2 = require('immutable'),
22
- ImmutableOrderedMap = _require2.OrderedMap;
23
-
24
20
  /**
25
21
  * An immutable representation of a corpus of documents being compiled together.
26
22
  * For each document, the context stores the IR and any validation errors.
@@ -29,7 +25,7 @@ var CompilerContext = /*#__PURE__*/function () {
29
25
  // $FlowFixMe[value-as-type]
30
26
  function CompilerContext(schema) {
31
27
  this._isMutable = false;
32
- this._documents = new ImmutableOrderedMap();
28
+ this._documents = new Map();
33
29
  this._withTransform = new WeakMap();
34
30
  this._schema = schema;
35
31
  }
@@ -140,12 +136,12 @@ var CompilerContext = /*#__PURE__*/function () {
140
136
  };
141
137
 
142
138
  _proto.withMutations = function withMutations(fn) {
143
- var mutableCopy = this._update(this._documents.asMutable());
139
+ var mutableCopy = this._update(this._documents);
144
140
 
145
141
  mutableCopy._isMutable = true;
146
142
  var result = fn(mutableCopy);
147
143
  result._isMutable = false;
148
- result._documents = result._documents.asImmutable();
144
+ result._documents = result._documents;
149
145
  return this._documents === result._documents ? this : result;
150
146
  };
151
147
 
@@ -18,8 +18,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
18
18
 
19
19
  var IRTransformer = require('../core/IRTransformer');
20
20
 
21
- var IMap = require('immutable').Map;
22
-
23
21
  var partitionArray = require('../util/partitionArray');
24
22
 
25
23
  var getIdentifierForSelection = require('../core/getIdentifierForSelection');
@@ -131,7 +129,7 @@ function visitNode(node) {
131
129
  cache = new Map(); // $FlowFixMe[incompatible-use]
132
130
 
133
131
  var context = this.getContext();
134
- return transformNode(context.getSchema(), node, new IMap()).node;
132
+ return transformNode(context.getSchema(), node, new Map()).node;
135
133
  }
136
134
  /**
137
135
  * The most straightforward approach would be two passes: one to record the
@@ -187,7 +185,7 @@ function transformNode(schema, node, selectionMap) {
187
185
  case 'InlineDataFragmentSpread':
188
186
  case 'LinkedField':
189
187
  {
190
- var transformed = transformNode(schema, selection, selectionMap.get(identifier) || new IMap());
188
+ var transformed = transformNode(schema, selection, selectionMap.get(identifier) || new Map());
191
189
 
192
190
  if (transformed.node) {
193
191
  selections.push(transformed.node);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ardatan/relay-compiler",
3
3
  "description": "A compiler tool for building GraphQL-driven applications.",
4
- "version": "12.1.0",
4
+ "version": "12.1.2",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "relay"
@@ -23,7 +23,6 @@
23
23
  "@babel/runtime": "^7.26.10",
24
24
  "chalk": "^4.0.0",
25
25
  "fb-watchman": "^2.0.0",
26
- "immutable": "~4.3.8",
27
26
  "invariant": "^2.2.4",
28
27
  "nullthrows": "^1.1.1",
29
28
  "relay-runtime": "12.0.0",