Where communities thrive


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

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

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

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

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

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

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

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

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

  • 00:07
    greenkeeper[bot] labeled #5446
  • 00:07
    greenkeeper[bot] opened #5446
  • 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)

  • Dec 12 19:26
    cherifGsoul review_requested #5443
  • Dec 12 18:34
    cherifGsoul synchronize #5443
  • Dec 12 18:34

    cherifGsoul on document-inserted-removed-can6

    Update after review (compare)

  • Dec 12 17:44

    cherifGsoul on theme-3.0.0-pre.5

    (compare)

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
but never ran into the multiple instances of foo-tag yet
Christopher Oliphant
@RALifeCoach
Also if I do var map = new MyDefineMap() and there is an error in one of the sub-maps I can view map and see which one has an error. If I define MtDefineMap in the Component with ViewModel, then there is a nondescript error.
Leath Cooper
@IcculusC
would it be a reasonable solution to just put something on the define map like a boolean value that differentiates it from a normal map and check for it if it's passed into viewModel and warn from there?
then the object would have the value if it were a define map but wouldn't require component to include define map as a dependency