Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 04:06
    BenitoJedai starred canjs/canjs
  • Feb 21 16:19
    cherifGsoul labeled #5427
  • Feb 21 16:19
    cherifGsoul labeled #5427
  • Feb 21 16:15
    cherifGsoul labeled #5433
  • Feb 21 16:15
    cherifGsoul commented #5433
  • Feb 21 15:53
    cherifGsoul labeled #5464
  • Feb 21 15:51
    cherifGsoul labeled #5465
  • Feb 21 15:51
    cherifGsoul labeled #5466
  • Feb 21 15:49
    cherifGsoul labeled #5467
  • Feb 21 15:45
    cherifGsoul labeled #5468
  • Feb 21 15:44
    cherifGsoul labeled #5468
  • Feb 20 20:57
  • Feb 20 20:42
    greenkeeper[bot] labeled #5469
  • Feb 20 20:42
    greenkeeper[bot] opened #5469
  • Feb 20 20:42

    greenkeeper[bot] on @octokit

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

  • Feb 18 23:43
    1d0n7kn0w starred canjs/canjs
  • Feb 14 12:04
    CalvinWalzel starred canjs/canjs
  • Feb 13 05:42
    liyanlong starred canjs/canjs
  • Feb 11 22:25
    greenkeeper[bot] commented #5450
  • Feb 11 22:25

    greenkeeper[bot] on semver-7.1.3

    chore(package): update semver t… (compare)

Chris Gomez
@akagomez
@matthewp Interesting thanks. Do we have anything documented in the context of components?
Matthew Phillips
@matthewp
not that i can recall
Chris Gomez
@akagomez
Got it.
Alex
@whitecolor
@justinbmeyer any comment on docjs errors I get?
Gerard Finnerty
@halcyonandon
I was reading about Facebook's bigpipe for optimized page loading with a component-driven architecture, https://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919
has anything similar to this been discussed or implemented with canjs?
Joe Crick
@joe-crick
Is it possible to interrupt a route change? I’m trying to implement a warn the user they’re navigating away from the page with unsaved changes confirmation that can be triggered when the user changes the route (including back or forward browser buttons).
Curtis Cummings
@ccummings
@joe-crick Was thinking we could add a pre-navigation hook to can.route that would let you intercept a route change. At that point you can prompt the user, then cancel the change or let it go through
Justin Meyer
@justinbmeyer
@whitecolor where did you report them?
nm
arg
ok, I will have to fix that
looks like you can't make a filename w/ | in windows
Alex
@whitecolor
@justinbmeyer ok when you do tell me
Alex
@whitecolor
What it __convert property on Map instance that is checked in map.js?
espretto
@espretto
hi,
is it at all intended for can.computes properties to live within a can.Map instance? and if yes, would i have to manually .off() them or perform any additional teardown logic?

also, how to get hold of the root of a can.Map instance from within can.compute's function? example:

var ViewModel = can.Map.extend({
  model: ['...'],
  state: {
    example: can.compute(function () {
      this.model; // > undefined
    })
  }
});

or would you go down the can.Map.define's road to achieve this? like how?

Guido Smeets
@gsmeets
does anyone know if there's a way to dynamically create a can.Component on a dom node from code?
or should I just generate a template snippet and parse that?
Guido Smeets
@gsmeets
@matthewp I put my amd stache loader on github (https://github.com/Empirion/can-stache-amd), still needs documentation though. If you want you can pull that into the canjs repo as a plugin. I'll add docs later this week
dylanrtt
@dylanrtt

@gsmeets I don't think there's a way to get a handle to the Component. I always do something like

can.stache('<my-component options="{options}"></my-component')({options: options})

and append the frag

dylanrtt
@dylanrtt
This message was deleted
Matthew Phillips
@matthewp
@gsmeets awesome! i'll take a look at it, does it work with the requirejs optimizer?
Guido Smeets
@gsmeets

@matthewp it's intended to be used with it. if you create this:

define(["stache!path/to/template.stache], function ( VIEW ) {})

then VIEW will be the renderer function. The plugin loader will pull in the file and run it through can.stache.async, which in turn will fetch any can-imports and partials.

When building with requirejs it'll wrap the template in a can.stache(). The pluginbuilder will find all can-imports and partials and add those in the define() that is being generated.

i.e., if the template.stache is:

<can-import from="app/foo/bar" />
<my-foo />

then this will be the generated result:

define([ "can", "can/stache", "app/foo/bar", function( can ) {
    return can.stache( " <can-import from="app/foo/bar" /><my-foo />" );
})
espretto
@espretto
hi, i have a problem with xhtml svg elements being picked up by canjs' scanner trying to resolve them to a component tag. is there a hook to skip/ignore tags like <svg:svg>...</svg:svg>?
Matthew Phillips
@matthewp
@gsmeets cool, i'd like to discuss it a bit more with you when you have the time. I'm not too familiar with require's plugin system.
like where do you return the renderer function?
Oh, I see, in the build you are using getIntermediateAndImports, good
We should put this in the canjs org, would you be ok with that?
Chris Gomez
@akagomez
opolyo01
@opolyo01
Quick question, I need to listen for radio change event as per example -- http://canjs.com/docs/can.view.bindings.can-value.html
'{scope.dateGroup} change': function ( group ) { console.log("Date group changed", group); },
<input type="radio" can-value="dateGroup" value="day">
change even never getting called
dylanrtt
@dylanrtt
@opolyo01 try '{scope} dateGroup' as your event signature. binding to 'change' will only work with observables (maps/computes)
opolyo01
@opolyo01
thanks, works
Guido Smeets
@gsmeets
@matthewp "We should put this in the canjs org, would you be ok with that?"
Yeah, that's fine. Still haven't had time for the docs though, 46 hr workweek ftw :/
Mohamed Cherif Bouchelaghem
@cherifGsoul
hi, what version of jekyll should I have to run gh-pages?
Chris Gomez
@akagomez
@cherifGsoul I have no idea. Are you sure you the correct room?
Mohamed Cherif Bouchelaghem
@cherifGsoul
@akagomez Yes I ask for the gh-pages branch in canjs repo to run the site on my local machine
Chris Gomez
@akagomez
Oh! canjs.com? Sorry. I didn’t connect those dots.
Kyle Gifford
@kylegifford
Is there a "right"/better way to do inheritance with the define plugin then this? http://jsfiddle.net/kg1ff0rd/hyrhvsbL/5/
Alexis Abril
@alexisabril
@kylegifford I don’t know that there is at the moment. David and I had a thought discussion about making “define” a can.Construct itself behind the scenes. That would let you just call “this._super()” in your defined methods. I’m not sure what detrimental impact that could have though
Kyle Gifford
@kylegifford
Thanks, good to know I'm not crazy :)

The code I'm working with uses

this.define = can.extend(parent.prototype.define, this.define);

in the child constructor, which I believe prevents extending objects on define

*on the child define
Kyle Gifford
@kylegifford
and if I do parent.prototype.define.foo.set.call(this, newVal);, I get in an infinite loop
Chris Gomez
@akagomez
@justinbmeyer @daffl Is there a recommended way to create dynamic components/dom nodes? A silly example would be: <{{span}}></{{span}}>