Where communities thrive


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

    greenkeeper[bot] on core-js-3.3.1

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

  • 14:49
    greenkeeper[bot] labeled #5375
  • 14:49
    greenkeeper[bot] opened #5375
  • 14:49

    greenkeeper[bot] on core-js-3.3.0

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

  • Oct 12 18:35
    matthewp commented #5358
  • Oct 12 18:15
    chasenlehara commented #5358
  • Oct 12 06:41

    greenkeeper[bot] on @octokit

    (compare)

  • Oct 12 06:39

    greenkeeper[bot] on @octokit

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

  • Oct 11 19:01
    m-mujica edited #5374
  • Oct 11 19:01
    m-mujica opened #5374
  • Oct 11 19:00

    m-mujica on update-deep-observable

    Update can-deep-observable to l… (compare)

  • Oct 11 18:55
    m-mujica edited #5365
  • Oct 11 18:54
    greenkeeper[bot] labeled #5373
  • Oct 11 18:54
    greenkeeper[bot] opened #5373
  • Oct 11 18:54

    greenkeeper[bot] on can-deep-observable-1.0.1

    fix(package): update can-deep-o… (compare)

  • Oct 11 16:42
    LakshanKarunathilake starred canjs/canjs
  • Oct 11 14:58
    greenkeeper[bot] labeled #5372
  • Oct 11 14:58
    greenkeeper[bot] opened #5372
  • Oct 11 14:58

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

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

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
Justin Meyer
@justinbmeyer
@halcyonandon I saw your comments about vdom and such, but I'm not sure I understand them. A virtual DOM is any structure that isn't the actual dom, but can effectively represent the actual DOM. In the case of can-simple-dom, our DOM looks pretty similar to the actual DOM apis, but it's much faster. The similarity allows us to have things like jQuery mutate our virtual DOM.
Leath Cooper
@IcculusC
kind of a ghetto workaround but it keeps the bloat down and accomplishes something similar to using instanceof
Justin Meyer
@justinbmeyer
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?
not really a good long term solution b/c we want people to use can-define to be able to add observability to constructors created with class expressions
types.isConstructor basically checks if a function has a modified .prototype
which, IMO, is a pretty close approximation to when to use new in almost any circumstance
and would cover all uses of DefineMap
Leath Cooper
@IcculusC
will Map be deprecated?
could do it the other way around
put he check on the Map not the DefineMap