Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:04
    greenkeeper[bot] commented #5392
  • 01:04

    greenkeeper[bot] on core-js-3.5.0

    chore(package): update core-js … (compare)

  • Dec 11 18:34
    greenkeeper[bot] labeled #5444
  • Dec 11 18:34
    greenkeeper[bot] opened #5444
  • Dec 11 18:34

    greenkeeper[bot] on can-observable-mixin-1.0.7

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

  • Dec 11 18:30

    cherifGsoul on update-infrastructure-page

    (compare)

  • Dec 11 18:30

    cherifGsoul on master

    Update infrastructure page with… (compare)

  • Dec 11 18:30
    cherifGsoul closed #5441
  • Dec 11 18:30
    cherifGsoul closed #5417
  • Dec 10 17:40
    cherifGsoul review_requested #5443
  • Dec 10 16:47
    cherifGsoul review_requested #5441
  • Dec 10 16:35
    cherifGsoul synchronize #5441
  • Dec 10 16:35

    cherifGsoul on update-infrastructure-page

    Fix typos (compare)

  • Dec 10 10:01
    jkeruzec starred canjs/canjs
  • Dec 09 18:59
    cherifGsoul review_requested #5443
  • Dec 09 18:59
    cherifGsoul opened #5443
  • Dec 09 18:51

    cherifGsoul on document-inserted-removed-can6

    Add inserted/removed events to … (compare)

  • Dec 09 15:38
    greenkeeper[bot] labeled #5442
  • Dec 09 15:38
    greenkeeper[bot] opened #5442
  • Dec 09 15:38

    greenkeeper[bot] on can-view-live-5.0.1

    fix(package): update can-view-l… (compare)

Christopher Oliphant
@RALifeCoach
Thanks @matthewp I was finally able to get it all working.
Matthew Phillips
@matthewp
there's some examples in the major branch you might want to look at
kind of show how DefineMaps are used as vms
Leath Cooper
@IcculusC
will be nice if there's a warning for viewModel vs ViewModel too
Christopher Oliphant
@RALifeCoach
It turned out I had an error in one of my sub-maps. I discovered that by defining the map outside of the component.
Matthew Phillips
@matthewp
viewModel still exists, what would the warning be?
Leath Cooper
@IcculusC
well if you use a DefineMap it doesn't act as expected
Matthew Phillips
@matthewp
right
i forgot why exactly that was
Christopher Oliphant
@RALifeCoach
Also I had to use ViewModel in my component, not viewModel
Leath Cooper
@IcculusC
so maybe the distinction between an instance of Map vs DefineMap and vM vs V
M
Matthew Phillips
@matthewp
maybe we should just warn against using viewModel at all
Leath Cooper
@IcculusC
and a warning if you're using them wrong
also @matthewp good to see those new releases I banged my head against the wall over that expr.hash issue for 3 days before I decided to track it down... then you fix it on the same day lol
Matthew Phillips
@matthewp
ah, sorry
that stuff was broken for a little while
Leath Cooper
@IcculusC
was typing up a detailed issue for you and I went to check the line number and you'd fixed it
Matthew Phillips
@matthewp
I think you're right about viewModel vs ViewModel but I'm not sure what the solution is
can you post an issue in can-component?
Leath Cooper
@IcculusC
nah I was more amused than anything
yeah I'll recreate it and get some details
Christopher Oliphant
@RALifeCoach
Leath and I worked it out
Leath Cooper
@IcculusC
I think if you instantiate an instance of your DefineMap with viewModel it works
but if you just pass the constructor you extended it doesn't
Matthew Phillips
@matthewp
the problem is that can-component doesn't depend on DefineMap so it wouldn't have a way to detect that viewModel is a DefineMap
Christopher Oliphant
@RALifeCoach
But I do have questions regarding getting production ready when using StealJS.
Leath Cooper
@IcculusC
yeah I suppose there's no really good way to do that
without including them so you can do instanceof
and bloat dependencies
Matthew Phillips
@matthewp
yeah
Justin Meyer
@justinbmeyer

@IcculusC

and when I wa susing map I had to create an instance of the view model manually

what do you mean by that?
Christopher Oliphant
@RALifeCoach
I don’t want my production page retrieving 80 small files. Can CanJS and all my JS files be merged for production?
Justin Meyer
@justinbmeyer
generally speaking, one should not be using a single instance for every component
@matthewp that might not be entirely true anymore
we can probably take a good stab at it
Matthew Phillips
@matthewp
Justin Meyer
@justinbmeyer
with types.isConstructor
Leath Cooper
@IcculusC
let MyViewModel =DefineMap.extend({...});

Component.extend({
  tag: 'foo-tag',
  template: '<h3>bar</h3>',
  viewModel: new MyViewModel()
});
vs
  ViewModel: MyViewModel
bump so I can edit
Justin Meyer
@justinbmeyer
yeah, viewModel: new MyViewModel() is going to use only one instance for every foo-tag
Leath Cooper
@IcculusC
yeah, that's what I figured
Matthew Phillips
@matthewp
we can figure out some way to warn, i think it's a good thing to do
Leath Cooper
@IcculusC
which worked in the use case
Justin Meyer
@justinbmeyer
yeah, but if you have multiple foo-tag on the page
it's going to get weird
Leath Cooper
@IcculusC
yeah I figured, but it was just a single form with a single instnace of the view model per visit
I thought that may be the case