These are chat archives for canjs/canjs

13th
Jun 2016
Guido Smeets
@gsmeets
Jun 13 2016 08:20
am I correct in concluding that there's no guarantee on the order of a component's binding being set and its inserted event being fired
Guido Smeets
@gsmeets
Jun 13 2016 08:40
in fact, I can't even be sure a component's parent component is inserted
qantourisc
@qantourisc
Jun 13 2016 10:37
<select {$(value)}="mykey">...</select> should work right ?
Guido Smeets
@gsmeets
Jun 13 2016 10:38
shouldn't that be {($value)} ?
qantourisc
@qantourisc
Jun 13 2016 10:39
gsmeets: yes, and that's also why it wasn't working, thanks, this proves its time to eat :) About your question: sorry I don't know i'm rather new
Guido Smeets
@gsmeets
Jun 13 2016 10:41
no problem, I fixed my problem by making no assumptions about load order
it was just weird, because my test project behaved exactly opposite of my customer project
qantourisc
@qantourisc
Jun 13 2016 12:19
PS is there a sane way to put null or undfined in a {($value)} or do you have to use tricky like null and check for those ?
Justin Meyer
@justinbmeyer
Jun 13 2016 15:24
@Bajix I'm not sure what you mean other than a "mixin" system
there's a can-mixin issue
@gsmeets I think bindings are setup first
then inserted
I think there's an issue
canjs/can-component#8
not sure if that's the same thing
in fact, I can't even be sure a component's parent component is inserted
Yes, you should be sure that a parent's inserted event will be fired before any child
if not, that's a bug
@qantourisc I'm not sure what you mean exactly about "put null or undefined" because an <input>'s value can only be a string
if you mean you'd like the empty string ("") to be null then you can use a type converter or this undocumented feature (until 3.0):
Justin Meyer
@justinbmeyer
Jun 13 2016 15:30
canjs/can-stache#17
that shows how to do it w/ 2.3
if(newVal instanceof can.expression.SetIdentifier) {
Sunil George
@georgesunil81
Jun 13 2016 16:28
With can version 2.3.24, I am getting an error "Cannot read property 'registerHelper' of undefined"!
The line in question is can.stache.registerHelper(key,...
Anything I may be missing?
Kevin Phillips
@phillipskevin
Jun 13 2016 16:30
how are you importing can?
Sunil George
@georgesunil81
Jun 13 2016 16:31
Using AMD
define([ 'can' ], function(can) {...
And using StealJS
"steal": "^0.16.2",
Kevin Phillips
@phillipskevin
Jun 13 2016 16:32
it doesn’t look like can/view/stache is included in the amd dist
Sunil George
@georgesunil81
Jun 13 2016 16:32
can.stache.registerHelper works with "can": "^3.0.0-pre.1"
Oh, let me check.
Kevin Phillips
@phillipskevin
Jun 13 2016 16:33
try define([ ‘can’, ‘can/view/stache' ], function(can) {…
Sunil George
@georgesunil81
Jun 13 2016 16:33
ok, will do.
It worked with can 3.0.0-pre.1
But, I do not want to use the pre version
Need to use 2.3.24
Will try to include can/view/stache and see if that solves it.
Sunil George
@georgesunil81
Jun 13 2016 16:39
Thanks @phillipskevin , the below solved it -
define([ 'can', 'can/view/stache/stache' ], function(can) {...
Thanks for the hint.
qantourisc
@qantourisc
Jun 13 2016 17:16
@justinbmeyer Yes that was the question, and answer.
Also I cannot find the use-variable-but-don't-bind option for keys atm.
I could write a simple helper, but I suspect that would reinventing the wheel.
Kevin Phillips
@phillipskevin
Jun 13 2016 17:28
good @georgesunil81
qantourisc
@qantourisc
Jun 13 2016 17:29
Another question: can I bind to <mycomponent {(mycanmap.member)}="tagnameincomp"> I does not appear to work (or i'm holding it wrong)
Thomas Sieverding
@Bajix
Jun 13 2016 19:01
SuperMap’s are broken in 2.3.24; can.Map.prototype.addEventListener doesn’t exist anymore, and is utilized within the list prototype override
Thomas Sieverding
@Bajix
Jun 13 2016 19:10
So can-connect superMap only works with can-map, which has can.Map.prototype.addEventListener added, and doesn’t work with 2.3.24
Kevin Phillips
@phillipskevin
Jun 13 2016 19:13
is there an issue open for that?
Thomas Sieverding
@Bajix
Jun 13 2016 19:13
Nope
Matthew Phillips
@matthewp
Jun 13 2016 19:13
which version of can-connect?
Thomas Sieverding
@Bajix
Jun 13 2016 19:13
latest
Matthew Phillips
@matthewp
Jun 13 2016 19:14
0.6.0-pre?
Thomas Sieverding
@Bajix
Jun 13 2016 19:14
Yes
Matthew Phillips
@matthewp
Jun 13 2016 19:14
Yes, that is for can 3.0
Use 0.5.x
Thomas Sieverding
@Bajix
Jun 13 2016 19:14
I see
Matthew Phillips
@matthewp
Jun 13 2016 19:15
Probably that shouldn't be npm latest
and should use a pre tag
Thomas Sieverding
@Bajix
Jun 13 2016 19:15
Well it’s 0.6.0-pre.4
Matthew Phillips
@matthewp
Jun 13 2016 19:15
what I mean is, when you do npm install can-connect it should not get 0.6.0-pre.4
it should get 0.5.5
Thomas Sieverding
@Bajix
Jun 13 2016 19:16
Could be a consequence of npm-check-updated
I’ll double check
Matthew Phillips
@matthewp
Jun 13 2016 19:16
it's a consequence of not using tags
to publish
on our part
Thomas Sieverding
@Bajix
Jun 13 2016 19:17
Yep default install goes straight to 0.6.0-pre.4
Matthew Phillips
@matthewp
Jun 13 2016 19:18
Screen Shot 2016-06-13 at 3.18.15 PM.png
I just updated it
Thomas Sieverding
@Bajix
Jun 13 2016 19:18
sweet
@matthewp on top of shit, like a boss
:thumbsup:
I’m super eager to use Can 3.0
Matthew Phillips
@matthewp
Jun 13 2016 19:28
There are pre-releases you can try of everything
Thomas Sieverding
@Bajix
Jun 13 2016 19:30
Yea, I’ll probably start looking into those more in the coming weeks
Thomas Sieverding
@Bajix
Jun 13 2016 22:02
Is there a way to make tests live reload?
using steal-mocha
Ilya Fadeev
@ilyavf
Jun 13 2016 22:05

hi. Is it possible to create can.component which will replace its tag with its content?
E.g.:

<my-component {params}="settings"></my-component>

can.Component.extend({tagName: "my-component", template: "<p>My component content</p>"})

To be rendered as:
<p>My component content</p>

?

Joel Kuzmarski
@leoj3n
Jun 13 2016 22:26
@ilyavf Just curious; Why would you want to do that?
Kevin Phillips
@phillipskevin
Jun 13 2016 22:32
@Bajix you might want to ask in the steal room. You can definitely use the live-reload api to do it, but there might be an easier way.
Matthew Phillips
@matthewp
Jun 13 2016 22:50
@ilyavf it's not, there an issue for tagless components out there, but it's not implemented
You can use either a Control or a can.view.attr though.