Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 14 20:01
    greenkeeper[bot] labeled #5450
  • Dec 14 20:01
    greenkeeper[bot] opened #5450
  • Dec 14 20:00

    greenkeeper[bot] on semver-7.0.0

    chore(package): update semver t… (compare)

  • Dec 14 16:58
    millette starred canjs/canjs
  • Dec 14 00:14
    greenkeeper[bot] labeled #5449
  • Dec 14 00:14
    greenkeeper[bot] opened #5449
  • Dec 14 00:14

    greenkeeper[bot] on can-super-model-2.0.0

    fix(package): update can-super-… (compare)

  • Dec 14 00:13
    greenkeeper[bot] labeled #5448
  • Dec 14 00:13
    greenkeeper[bot] opened #5448
  • Dec 14 00:13

    greenkeeper[bot] on can-define-rest-model-2.0.0

    fix(package): update can-define… (compare)

  • Dec 14 00:12
    greenkeeper[bot] labeled #5447
  • Dec 14 00:12
    greenkeeper[bot] opened #5447
  • Dec 14 00:12

    greenkeeper[bot] on can-define-realtime-rest-model-2.0.0

    fix(package): update can-define… (compare)

  • Dec 14 00:07
    greenkeeper[bot] labeled #5446
  • Dec 14 00:07
    greenkeeper[bot] opened #5446
  • Dec 14 00:07

    greenkeeper[bot] on can-connect-ndjson-2.0.0

    fix(package): update can-connec… (compare)

  • Dec 13 21:27

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:25

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

  • Dec 13 21:21

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:20

    greenkeeper[bot] on @octokit

    chore(package): update @octokit… (compare)

Justin Meyer
@justinbmeyer
when / how do you query the new things?
Thomas Sieverding
@Bajix
I would query things using findAll after my websocket connection is online
Justin Meyer
@justinbmeyer
oh ... I would fire getList and forget
Thomas Sieverding
@Bajix
Then I’d use something like hydrateInstance to handling incoming data from my websocket connection
Justin Meyer
@justinbmeyer
ok, so I'm not sure how all this works ... but let me take a stab at some sudo code
Thomas Sieverding
@Bajix
Sure
onData: function( packet ) {
  var action = packet[0],
    data = packet[2];

  switch (action) {
    case 'DELETE channel':
      return Channel.model(data).destroyed();
    case 'DELETE message':
      return Message.model(data).destroyed();
    case 'DELETE user':
      return User.model(data).destroyed();
    case 'channel':
      return this.dispatch('channel', [Channel.model(data)]);
    case 'message':
      return this.dispatch('message', [Message.model(data)]);
    case 'user':
      return this.dispatch('user', [User.model(data)]);
  }
},
This is an example of a similar use-case to what I’m building now
      '{scope} onlineAt': function( scope, ev, onlineAt ) {
        var channel = scope.attr('channel');

        if (onlineAt) {
          Message.findAll({
            channel: channel._id,
            limit: channel.config.loadMessageCount
          });

          User.findAll({
            channel: channel._id,
            limit: config.chat.loadMessageCount
          });
        }
      },
So onlineAt would be the time my connection goes online
This was pre can-connect
My models were setup to emit newInstance on prototype.init on their constructor
I was combining the two data sets manually
Christopher Oliphant
@RALifeCoach
back to steal-tools - I have in my package.son
  "system": {
    "main": "modules/page.players-redesign/player-bio/components/player-bio.js"
  },
/git/pgatour-cq-v2/front-end/node_modules/steal-tools/lib/graph/make_graph_with_bundles.js:83
    if( Array.isArray(cfg.main) ) {
                         ^

TypeError: Cannot read property 'main' of undefined
    at module.exports (/git/pgatour-cq-v2/front-end/node_modules/steal-tools/lib/graph/make_graph_with_bundles.js:83:23)
Leath Cooper
@IcculusC
not in system
it's a top level package.json field
Thomas Sieverding
@Bajix
@IcculusC It’s in both
Leath Cooper
@IcculusC
oh
Thomas Sieverding
@Bajix
He should be doing this in system.main
the top level main is a fallback
Leath Cooper
@IcculusC
weird, in my experience it only works under the top level package.json object
Christopher Oliphant
@RALifeCoach
I removed it from the system object and I am getting the same result
This message was deleted
Leath Cooper
@IcculusC
well I learned something just now
Thomas Sieverding
@Bajix
@RALifeCoach Your paths are likely the issue
Christopher Oliphant
@RALifeCoach
how so?
Thomas Sieverding
@Bajix
What’s your package.json name & system.directories
Christopher Oliphant
@RALifeCoach
my package is package.json and it’s in the same folder as build.js
not sure what you mean by system.directories
Thomas Sieverding
@Bajix
Do you have a src folder
Or are you using a different naming convention?
Christopher Oliphant
@RALifeCoach
a different naming convention - legacy code
Thomas Sieverding
@Bajix
What’s your main asset directory
Leath Cooper
@IcculusC
@matthewp @justinbmeyer is it okay for me to close my issue referring to the expr.hash bug you fixed with the most recent release of can-stache-bindings
Justin Meyer
@justinbmeyer
yeah
Christopher Oliphant
@RALifeCoach
modules
Justin Meyer
@justinbmeyer
@Bajix that is very rough, but check it out. Maybe lets move this convo to the forums.
Christopher Oliphant
@RALifeCoach
modules has many sub directories - none of which use CanJS
except for the one I reference in main
Thomas Sieverding
@Bajix
@justinbmeyer kk. I’ll do that
So you should have system.directories.lib = modules
Justin Meyer
@justinbmeyer
On a high level, I created a behavior that you should just be able to call Todo.getList() and it should do whatever it can ... regardless if the connection is established or not
it should wait until it is
Thomas Sieverding
@Bajix
And then your main should be “{name}/page.players-redesign/player-bio/components/player-bio.js"
Where {name} is package.json name
Ideally though, your main file would be a stache file using done-autorender
@justinbmeyer So essentially the trick would be to use the behavior to prevent any race conditions on findAll
Christopher Oliphant
@RALifeCoach
I don’t have one of those. My html to show the component looks like this:
<!DOCTYPE html>
<html>
<head>
    <title>PGAT</title>
</head>
<body>
<script type="text/javascript" src="/js/vendor/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/js/pgatour.base.js"></script>
<script type="text/javascript" src="/js/pgatour.eventEmitter.js"></script>
<script type="text/javascript" src="/js/pgatour.baseModule.js"></script>
<script type="text/javascript" src="/js/pgatour.asyncScriptLoader.js"></script>
<script type="text/javascript" src="/js/pgatour.adTimer.js"></script>
<script type="text/javascript" src="/js/pgatour.adGroup.js"></script>
<script type="text/javascript" src="/js/pgatour.ad.js"></script>
<script type="text/javascript" src="/js/pgatour.browserActivityWatcher.js"></script>
<script src="../../../node_modules/steal/steal.js"
        main="modules/page.players-redesign/player-bio/components/player-bio"></script>
</body>
</html>
That runs okay