Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 15:01
    m-mujica synchronize #5303
  • 15:01

    m-mujica on upgrade-deps

    Update bundlesize threshold for… (compare)

  • 14:14
    pehaada starred canjs/canjs
  • 14:11
    m-mujica synchronize #5303
  • 14:11

    m-mujica on upgrade-deps

    Update bundlesize threshold for… (compare)

  • 14:02
    phillipskevin commented #5303
  • 12:08
    m-mujica edited #5119
  • 12:08

    m-mujica on upgrade

    (compare)

  • 12:07

    m-mujica on major

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

  • 12:07
    m-mujica closed #5302
  • 12:07
    m-mujica commented #5302
  • 11:50
    esteverodriguez starred canjs/canjs
  • 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
Justin Meyer
@justinbmeyer
thanks for your help
Mark Stahl
@mjstahl
Sorry I was distracted by some client stuff. It was fun, and I was glad I could help. I look forward to seeing how it turns out.
Justin Meyer
@justinbmeyer
@mjstahl {{helper models@Todo~findAll}}
we could make stuff like that work
allow these things to substitute the normal (.) behavior
Mark Stahl
@mjstahl
Yeah, I think that is the correct way to look at it. Larry Wall would be proud. ;)
Justin Meyer
@justinbmeyer

we might follow Angular 2.0’s conventions

<component [(prop)]=“value”/>

two way

was that

one way

<component [prop]=“value” />

so (EVENT) will now bind on view-models

<component (prop)=“callSomething()”/>

you could do that, for instance, if prop changes in component

oh … I forgot to explain why we are doing this

so, originally, we wanted two-way binding to look like it currently does

<component prop=“{value}”/>

and to add one-way binding like:

<component prop=“{{value}}”/>

this causes problems :disappointed:

it interferes with how stache processing normally works

so we thought about changing one way binding to something more like:

<component prop=“[value]”/>

but this causes problem if we want one-way binding in something like <input value=“[key]”/>

we can’t actually set value to “[key]” temporarily

so the “modifiers” need to be on the attribute

the choice of [, ( simply reflects what angular chose

there’s a possibility I change [ to {

so things like {childProp}=“[parentPropertyName]"

looks reasonable

the good thing … is most attribute values would no longer need a decorator

we wouldn’t write can-click=“{foo bar}"

instead

($click)=“foo bar"

wrote all this in another chat room, but I wanted to talk about it here
Matthew Phillips
@matthewp
cc @dylanrtt
Justin Meyer
@justinbmeyer

@akagomez asked

Where did the $ come in?

($EVENT) would listen to dom events
be the equivalent of can-click
can-EVENT
(EVENT) listens to the viewModel
Kevin Phillips
@phillipskevin
if we do that, where do we draw the line with matching angular 2’s template syntax?
Justin Meyer
@justinbmeyer
not sure what you mean by that
we don't have to match angular's syntax ... we draw the line at doing what makes sense
but angular 2.0's binding syntax has advantageous over what's currently in 2.3
Kevin Phillips
@phillipskevin
I just mean if a significant portion matches, but not everything, it will obviously be confusing for people that are familiar with one syntax trying to use the other
or transitioning from one to the other
Matthew Phillips
@matthewp
dom events are much more common, maybe (EVENT) should be for dom
Justin Meyer
@justinbmeyer
I think it would be over-all less confusing
stache doesn't exactly match Handlebars
I think it will be much easier for someone to know angular 2.0 to come to CanJS
Kevin Phillips
@phillipskevin
no, I agree. I think if the angular 2 syntax solves the problems we’re looking at now it makes sense to match it on that.
Justin Meyer
@justinbmeyer
if we have some similarities in what () vs [] means
but some of the finer things
like what you are suggesting ... binding on events
instead of view model
is changed
they still see that () means event binding
[] means one-way binding
[()] means two-way
so I agree that DOM binding is more common
but not more than two-way binding
let me break that down
Matthew Phillips
@matthewp
btw, what does ~ do again, gets the value of a compute?
Justin Meyer
@justinbmeyer
makes something pass a compute

One way binding

<component [one]="bar"/>

Two way view model binding

<component [(two)]="bar">
that would be the same as writing
<component  [two]="bar"
           (two)="~bar(@viewModel.two)" />

Two Way Attribute Binding

<input [($value)]="bar"/>
The same as:
<input [$value]="bar"
        ($input)="~bar($element.value)"/>
so here, hopefully you can see why we are using ($EVENT)
even though it's more common
In case it's not clear, there are two reason:
  1. Component bindings are a very common thing. So [()] needs to be small.
  2. We have an identifier most people would recognize as "element" -> $. I don't have something that represents "viewModel"
Justin Meyer
@justinbmeyer
Thoughts :-) ?
Matthew Phillips
@matthewp
digesting..
I think I said this last time we discussed binding, but I still don't see a huge value in one-way binding, I think this would be a lot simpler if we only worried about two-way and events