Skip to content

Commit 2ce2a19

Browse files
committed
fix broken subscriptions and switch to babel-preset-env
1 parent f4851f1 commit 2ce2a19

File tree

4 files changed

+75
-25
lines changed

4 files changed

+75
-25
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
presets: [ "latest" ]
2+
"presets": [ "env" ]
33
}

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ module.exports = function graphqlGun(query, gun) {
2222
} = container;
2323
let ref = parentRef;
2424
let subscribe =
25-
(parentSubscribed || !!tryGet(info, "directives.live")) &&
26-
!tryGet(info, "directives.unlive");
25+
(parentSubscribed || "live" in tryGet(info, "directives", {})) &&
26+
!("unlive" in tryGet(info, "directives", {}));
2727

2828
if (info.isLeaf) {
2929
if (key === "_chain") {
@@ -44,7 +44,7 @@ module.exports = function graphqlGun(query, gun) {
4444
if (subscribe && subscriptions[stringPath] === undefined) {
4545
subscriptions[stringPath] = chain.get(key).on(updater, true);
4646
} else {
47-
chain.get(key).val(updater);
47+
chain.get(key).once(updater);
4848
}
4949
});
5050
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"devDependencies": {
1818
"babel": "^6.23.0",
1919
"babel-polyfill": "^6.26.0",
20-
"babel-preset-latest": "^6.24.0",
20+
"babel-preset-env": "^1.7.0",
2121
"graphql": "^0.13.2",
2222
"graphql-tag": "^2.9.2",
2323
"jest": "^23.2.0",

yarn.lock

Lines changed: 70 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ babel-plugin-syntax-trailing-function-commas@^6.22.0:
375375
version "6.22.0"
376376
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"
377377

378-
babel-plugin-transform-async-to-generator@^6.24.1:
378+
babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1:
379379
version "6.24.1"
380380
resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
381381
dependencies:
@@ -395,7 +395,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
395395
dependencies:
396396
babel-runtime "^6.22.0"
397397

398-
babel-plugin-transform-es2015-block-scoping@^6.24.1:
398+
babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1:
399399
version "6.26.0"
400400
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f"
401401
dependencies:
@@ -405,7 +405,7 @@ babel-plugin-transform-es2015-block-scoping@^6.24.1:
405405
babel-types "^6.26.0"
406406
lodash "^4.17.4"
407407

408-
babel-plugin-transform-es2015-classes@^6.24.1:
408+
babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1:
409409
version "6.24.1"
410410
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db"
411411
dependencies:
@@ -419,33 +419,33 @@ babel-plugin-transform-es2015-classes@^6.24.1:
419419
babel-traverse "^6.24.1"
420420
babel-types "^6.24.1"
421421

422-
babel-plugin-transform-es2015-computed-properties@^6.24.1:
422+
babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1:
423423
version "6.24.1"
424424
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3"
425425
dependencies:
426426
babel-runtime "^6.22.0"
427427
babel-template "^6.24.1"
428428

429-
babel-plugin-transform-es2015-destructuring@^6.22.0:
429+
babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0:
430430
version "6.23.0"
431431
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
432432
dependencies:
433433
babel-runtime "^6.22.0"
434434

435-
babel-plugin-transform-es2015-duplicate-keys@^6.24.1:
435+
babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1:
436436
version "6.24.1"
437437
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e"
438438
dependencies:
439439
babel-runtime "^6.22.0"
440440
babel-types "^6.24.1"
441441

442-
babel-plugin-transform-es2015-for-of@^6.22.0:
442+
babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0:
443443
version "6.23.0"
444444
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
445445
dependencies:
446446
babel-runtime "^6.22.0"
447447

448-
babel-plugin-transform-es2015-function-name@^6.24.1:
448+
babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1:
449449
version "6.24.1"
450450
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b"
451451
dependencies:
@@ -459,15 +459,15 @@ babel-plugin-transform-es2015-literals@^6.22.0:
459459
dependencies:
460460
babel-runtime "^6.22.0"
461461

462-
babel-plugin-transform-es2015-modules-amd@^6.24.1:
462+
babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1:
463463
version "6.24.1"
464464
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154"
465465
dependencies:
466466
babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
467467
babel-runtime "^6.22.0"
468468
babel-template "^6.24.1"
469469

470-
babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
470+
babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
471471
version "6.26.2"
472472
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3"
473473
dependencies:
@@ -476,30 +476,30 @@ babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
476476
babel-template "^6.26.0"
477477
babel-types "^6.26.0"
478478

479-
babel-plugin-transform-es2015-modules-systemjs@^6.24.1:
479+
babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1:
480480
version "6.24.1"
481481
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23"
482482
dependencies:
483483
babel-helper-hoist-variables "^6.24.1"
484484
babel-runtime "^6.22.0"
485485
babel-template "^6.24.1"
486486

487-
babel-plugin-transform-es2015-modules-umd@^6.24.1:
487+
babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1:
488488
version "6.24.1"
489489
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468"
490490
dependencies:
491491
babel-plugin-transform-es2015-modules-amd "^6.24.1"
492492
babel-runtime "^6.22.0"
493493
babel-template "^6.24.1"
494494

495-
babel-plugin-transform-es2015-object-super@^6.24.1:
495+
babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1:
496496
version "6.24.1"
497497
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d"
498498
dependencies:
499499
babel-helper-replace-supers "^6.24.1"
500500
babel-runtime "^6.22.0"
501501

502-
babel-plugin-transform-es2015-parameters@^6.24.1:
502+
babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1:
503503
version "6.24.1"
504504
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b"
505505
dependencies:
@@ -510,7 +510,7 @@ babel-plugin-transform-es2015-parameters@^6.24.1:
510510
babel-traverse "^6.24.1"
511511
babel-types "^6.24.1"
512512

513-
babel-plugin-transform-es2015-shorthand-properties@^6.24.1:
513+
babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1:
514514
version "6.24.1"
515515
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0"
516516
dependencies:
@@ -523,7 +523,7 @@ babel-plugin-transform-es2015-spread@^6.22.0:
523523
dependencies:
524524
babel-runtime "^6.22.0"
525525

526-
babel-plugin-transform-es2015-sticky-regex@^6.24.1:
526+
babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1:
527527
version "6.24.1"
528528
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc"
529529
dependencies:
@@ -537,29 +537,29 @@ babel-plugin-transform-es2015-template-literals@^6.22.0:
537537
dependencies:
538538
babel-runtime "^6.22.0"
539539

540-
babel-plugin-transform-es2015-typeof-symbol@^6.22.0:
540+
babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0:
541541
version "6.23.0"
542542
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
543543
dependencies:
544544
babel-runtime "^6.22.0"
545545

546-
babel-plugin-transform-es2015-unicode-regex@^6.24.1:
546+
babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1:
547547
version "6.24.1"
548548
resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9"
549549
dependencies:
550550
babel-helper-regex "^6.24.1"
551551
babel-runtime "^6.22.0"
552552
regexpu-core "^2.0.0"
553553

554-
babel-plugin-transform-exponentiation-operator@^6.24.1:
554+
babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1:
555555
version "6.24.1"
556556
resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
557557
dependencies:
558558
babel-helper-builder-binary-assignment-operator-visitor "^6.24.1"
559559
babel-plugin-syntax-exponentiation-operator "^6.8.0"
560560
babel-runtime "^6.22.0"
561561

562-
babel-plugin-transform-regenerator@^6.24.1:
562+
babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1:
563563
version "6.26.0"
564564
resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f"
565565
dependencies:
@@ -580,6 +580,41 @@ babel-polyfill@^6.26.0:
580580
core-js "^2.5.0"
581581
regenerator-runtime "^0.10.5"
582582

583+
babel-preset-env@^1.7.0:
584+
version "1.7.0"
585+
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a"
586+
dependencies:
587+
babel-plugin-check-es2015-constants "^6.22.0"
588+
babel-plugin-syntax-trailing-function-commas "^6.22.0"
589+
babel-plugin-transform-async-to-generator "^6.22.0"
590+
babel-plugin-transform-es2015-arrow-functions "^6.22.0"
591+
babel-plugin-transform-es2015-block-scoped-functions "^6.22.0"
592+
babel-plugin-transform-es2015-block-scoping "^6.23.0"
593+
babel-plugin-transform-es2015-classes "^6.23.0"
594+
babel-plugin-transform-es2015-computed-properties "^6.22.0"
595+
babel-plugin-transform-es2015-destructuring "^6.23.0"
596+
babel-plugin-transform-es2015-duplicate-keys "^6.22.0"
597+
babel-plugin-transform-es2015-for-of "^6.23.0"
598+
babel-plugin-transform-es2015-function-name "^6.22.0"
599+
babel-plugin-transform-es2015-literals "^6.22.0"
600+
babel-plugin-transform-es2015-modules-amd "^6.22.0"
601+
babel-plugin-transform-es2015-modules-commonjs "^6.23.0"
602+
babel-plugin-transform-es2015-modules-systemjs "^6.23.0"
603+
babel-plugin-transform-es2015-modules-umd "^6.23.0"
604+
babel-plugin-transform-es2015-object-super "^6.22.0"
605+
babel-plugin-transform-es2015-parameters "^6.23.0"
606+
babel-plugin-transform-es2015-shorthand-properties "^6.22.0"
607+
babel-plugin-transform-es2015-spread "^6.22.0"
608+
babel-plugin-transform-es2015-sticky-regex "^6.22.0"
609+
babel-plugin-transform-es2015-template-literals "^6.22.0"
610+
babel-plugin-transform-es2015-typeof-symbol "^6.23.0"
611+
babel-plugin-transform-es2015-unicode-regex "^6.22.0"
612+
babel-plugin-transform-exponentiation-operator "^6.22.0"
613+
babel-plugin-transform-regenerator "^6.22.0"
614+
browserslist "^3.2.6"
615+
invariant "^2.2.2"
616+
semver "^5.3.0"
617+
583618
babel-preset-es2015@^6.24.1:
584619
version "6.24.1"
585620
resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939"
@@ -751,6 +786,13 @@ browser-resolve@^1.11.3:
751786
dependencies:
752787
resolve "1.1.7"
753788

789+
browserslist@^3.2.6:
790+
version "3.2.8"
791+
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6"
792+
dependencies:
793+
caniuse-lite "^1.0.30000844"
794+
electron-to-chromium "^1.3.47"
795+
754796
bser@^2.0.0:
755797
version "2.0.0"
756798
resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719"
@@ -791,6 +833,10 @@ camelcase@^4.1.0:
791833
version "4.1.0"
792834
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
793835

836+
caniuse-lite@^1.0.30000844:
837+
version "1.0.30000862"
838+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000862.tgz#7ca14f5079fa8f77ac814fca92d45deb4b7eff9d"
839+
794840
capture-exit@^1.2.0:
795841
version "1.2.0"
796842
resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f"
@@ -1060,6 +1106,10 @@ ecc-jsbn@~0.1.1:
10601106
dependencies:
10611107
jsbn "~0.1.0"
10621108

1109+
electron-to-chromium@^1.3.47:
1110+
version "1.3.51"
1111+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.51.tgz#6a42b49daaf7f22a5b37b991daf949f34dbdb9b5"
1112+
10631113
encoding@^0.1.11:
10641114
version "0.1.12"
10651115
resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb"

0 commit comments

Comments
 (0)