These are chat archives for canjs/canjs

18th
Jul 2018
Gregg Roemhildt
@roemhildtg
Jul 18 2018 14:48
Hi guys, which version of can-observation-recorder should be used at the moment? I'm seeing 2 versions in my project 1.1.1 and 1.2.0 and it doesn't like having multiple versions
Kevin Phillips
@phillipskevin
Jul 18 2018 15:16
what is importing the older version, @roemhildtg ?
Gregg Roemhildt
@roemhildtg
Jul 18 2018 15:18
Looks like can-simple-map is one
From can-component 4.2.4
image.png
Kevin Phillips
@phillipskevin
Jul 18 2018 15:19
could it be a package-lock issue?
we shouldn't have anything locked to minor versions
Gregg Roemhildt
@roemhildtg
Jul 18 2018 15:26
Let me check
I didn't realize npm would update minor versions
Gregg Roemhildt
@roemhildtg
Jul 18 2018 15:33
Ah okay
Deleting node_modules/package-lock solved it
I always forget to remove the node_modules
Kevin Phillips
@phillipskevin
Jul 18 2018 15:34
yeah, it's annoying
glad that fixed it for you though
Gregg Roemhildt
@roemhildtg
Jul 18 2018 15:52
Me too! btw, nice work on getting 5.0 out. Its looking good :)
Gregg Roemhildt
@roemhildtg
Jul 18 2018 20:45

I've been staring at this too long. Is this not correct for setting up can-route?

import config from './config/apps/app';
import 'can-debug';
import route from 'can-route';
import {ViewModel} from './app';
import stache from 'can-stache';

const app = new ViewModel(config);
route.data = app;
route.register('{handHole}/{spliceCaseId}');
route.start();

document.body.appendChild(stache('<splice-app />')(app));

When I do this...my properties defined in config.stuff is null on app.

    "can-component": "^4.2.4",
    "can-define": "^2.5.2",
    "can-queues": "^1.1.2",
    "can-route": "^4.3.0",
Gregg Roemhildt
@roemhildtg
Jul 18 2018 21:02
I think I've definitely missed something here... shouldn't this be rendering "data"? https://codepen.io/anon/pen/PBGKoE
Kevin Phillips
@phillipskevin
Jul 18 2018 21:06
you can pass the data in to the component like '<my-app test:from="test" />'
Gregg Roemhildt
@roemhildtg
Jul 18 2018 21:09
right...i have been looking at this too long lol
not thinking clearly :p
Kevin Phillips
@phillipskevin
Jul 18 2018 21:12
you can also do something like this: https://codepen.io/anon/pen/VBKzmW?editors=1010
that's how I normally do it for demo pages and things like that
Justin Meyer
@justinbmeyer
Jul 18 2018 21:25
we need to put the viewModel directly on the element
I'm going to do that tonight
Gregg Roemhildt
@roemhildtg
Jul 18 2018 21:39
Thatll be really nice
So like $0.viewModel
?
from inspector?
Justin Meyer
@justinbmeyer
Jul 18 2018 22:01
yes
Julian
@pYr0x
Jul 18 2018 22:33
should https://github.com/canjs/canjs/blob/master/es/can-dom-mutate.js also export can-dom-mutate/dom-events
because we need it for inserted and removed events
import {domEvents} from "can";
import domMutateDomEvents from "can-dom-mutate/dom-events";

domEvents.addEvent(domMutateDomEvents.inserted);
domEvents.addEvent(domMutateDomEvents.removed);