Skip to content

Commit 6f418ce

Browse files
author
Nathaniel Dsouza
authored
Bring in new Meteor Tracker to replace 5 years outdated trackr package (#55)
1 parent 3f077b8 commit 6f418ce

File tree

8 files changed

+649
-14
lines changed

8 files changed

+649
-14
lines changed

SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
| Version | Supported |
66
| ------- | ------------------ |
7-
| 2.0.x | :white_check_mark: |
7+
| >=2.0.0 | :white_check_mark: |
88

99
## Reporting a Vulnerability
1010

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meteorrn/core",
3-
"version": "2.1.1",
3+
"version": "2.1.2",
44
"description": "Full Meteor Client for React Native",
55
"main": "src/index.js",
66
"repository": {
@@ -29,7 +29,6 @@
2929
"minimongo-cache": "0.0.48",
3030
"node-require-fallback": "^1.0.0",
3131
"prop-types": "^15.5.10",
32-
"trackr": "^2.0.2",
3332
"underscore": "^1.8.3",
3433
"wolfy87-eventemitter": "^4.3.0"
3534
},

src/Collection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Tracker from 'trackr';
1+
import Tracker from './Tracker.js';
22
import EJSON from 'ejson';
33
import _ from 'underscore';
44

src/Data.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import minimongo from 'minimongo-cache';
2-
import Trackr from 'trackr';
2+
import Tracker from './Tracker.js';
33

44
const db = new minimongo();
55
db.debug = false;
@@ -35,7 +35,7 @@ else {
3535

3636
function runAfterOtherComputations(fn) {
3737
afterInteractions(() => {
38-
Trackr.afterFlush(() => {
38+
Tracker.afterFlush(() => {
3939
fn();
4040
});
4141
});

src/Meteor.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Trackr from 'trackr';
1+
import Tracker from './Tracker.js';
22
import EJSON from 'ejson';
33
import DDP from '../lib/ddp.js';
44
import Random from '../lib/Random';
@@ -22,7 +22,7 @@ const Meteor = {
2222
},
2323
Random,
2424
Mongo,
25-
Tracker: Trackr,
25+
Tracker,
2626
EJSON,
2727
ReactiveDict,
2828
Collection,
@@ -290,7 +290,7 @@ const Meteor = {
290290
params: EJSON.clone(params),
291291
inactive: false,
292292
ready: false,
293-
readyDeps: new Trackr.Dependency(),
293+
readyDeps: new Tracker.Dependency(),
294294
readyCallback: callbacks.onReady,
295295
stopCallback: callbacks.onStop,
296296
stop: function() {
@@ -320,19 +320,19 @@ const Meteor = {
320320
subscriptionId: id,
321321
};
322322

323-
if (Trackr.active) {
323+
if (Tracker.active) {
324324
// We're in a reactive computation, so we'd like to unsubscribe when the
325325
// computation is invalidated... but not if the rerun just re-subscribes
326326
// to the same subscription! When a rerun happens, we use onInvalidate
327327
// as a change to mark the subscription "inactive" so that it can
328328
// be reused from the rerun. If it isn't reused, it's killed from
329329
// an afterFlush.
330-
Trackr.onInvalidate(function(c) {
330+
Tracker.onInvalidate(function(c) {
331331
if (Data.subscriptions[id]) {
332332
Data.subscriptions[id].inactive = true;
333333
}
334334

335-
Trackr.afterFlush(function() {
335+
Tracker.afterFlush(function() {
336336
if (Data.subscriptions[id] && Data.subscriptions[id].inactive) {
337337
handle.stop();
338338
}

0 commit comments

Comments
 (0)