Where communities thrive


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

    greenkeeper[bot] on @feathersjs

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

  • Sep 21 21:12
    greenkeeper[bot] commented #5236
  • Sep 21 21:12

    greenkeeper[bot] on @feathersjs

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

  • Sep 21 03:58

    greenkeeper[bot] on @octokit

    (compare)

  • Sep 21 03:57

    greenkeeper[bot] on @octokit

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

  • Sep 20 21:04
    m-mujica commented #5303
  • Sep 20 20:23
    m-mujica opened #5303
  • Sep 20 20:23

    m-mujica on upgrade-deps

    Update can-type and can-stache-… (compare)

  • Sep 20 20:05
    m-mujica edited #5302
  • Sep 20 20:03
    m-mujica synchronize #5302
  • Sep 20 20:03

    m-mujica on upgrade

    Upgrade routing guide to Can 6 Fix incorrect highlight Use svg images (instead of .png) (compare)

  • Sep 20 19:32
    m-mujica opened #5302
  • Sep 20 19:29

    m-mujica on upgrade

    Upgrade routing guide to Can 6 Fix incorrect highlight (compare)

  • Sep 20 17:42

    m-mujica on upgrade

    WIP: Upgrade (compare)

  • Sep 20 17:06
    do-adams starred canjs/canjs
  • Sep 20 13:34

    chasenlehara on 5119-testing-guide

    Update the Testing guide for Ca… (compare)

  • Sep 20 13:21
    cherifGsoul commented #5295
  • Sep 20 13:18
    cherifGsoul synchronize #5295
  • Sep 20 13:18

    cherifGsoul on update-theme-new-buttons

    Theme pre-release 2 (compare)

Leath Cooper
@IcculusC
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
Justin Meyer
@justinbmeyer
our place for this kinda type detection behavior is in : http://canjs.github.io/canjs/doc/can-util/js/types/types.html
Leath Cooper
@IcculusC
unless I'm misunderstanding
Justin Meyer
@justinbmeyer
well, viewModel is mostly being deprecated. That's what I'm focused on.
in an ideal world, we'd have 2 functions ...
well, 2 properties
ViewModel -> assumes you pass it a constructor function.
Leath Cooper
@IcculusC
yep
Justin Meyer
@justinbmeyer
scope -> you can do whatever the heck you want here ... function called with outer scope, element, etc, returns a new scope or anything else gets put in a new Scope.
viewModel is basically legacy
Leath Cooper
@IcculusC
well if that's the case why not just warn people if they use viewModel at all
and encourage them to use the new convention
Justin Meyer
@justinbmeyer
yeah, not a bad idea
Leath Cooper
@IcculusC
maybe one of those fancy "soon to be deprecated" warnings
Christopher Oliphant
@RALifeCoach
steal-tools - what if my main module isn’t main.js
Thomas Sieverding
@Bajix
Then define it in your package.json
Leath Cooper
@IcculusC
change it in your package.json