These are chat archives for canjs/canjs

28th
Jun 2018
Justin Meyer
@justinbmeyer
Jun 28 2018 02:47
@pYr0x you can listen to when the property changes, but not when the promise resolves
You want to know when the value resolves?
Why are you using the resolve based getter but not using resolve?
In 4.0, you should probably be doing the setting of select in a different way .. you should be able to remove that imperative code
let me know what you want that listenTo to do
and I'll help you figure out how to write it
Regarding the deep property set, I'm not sure. I think that might work
Justin Meyer
@justinbmeyer
Jun 28 2018 02:53

@/all

If folks have a few min, it would help a lot if you could pick a section and review a part of the Setting Up CanJS guide: https://canjs.github.io/next/doc/guides/setup.html

Please add comments here: https://docs.google.com/document/d/19EPefoI7fRovoCx61HBtFUu0aBGiRSgHrSZ16IQxfWc/edit#heading=h.nzqslfn4opog

(most examples don't work, but it's helpful to know what people think is confusing!!)

Stef
@sronsiek
Jun 28 2018 08:32
Hi all - can anyone point me to an example / recipe of file upload implemented in canjs4
Nico R.
@nriesco
Jun 28 2018 12:26
Hi, I currently use can3 and while taking a look at this https://jsbin.com/jeligek/3/edit?html,js,console,output I tried to figure out it the code worked on can3 changing <script src="https://unpkg.com/can@4/dist/global/can.all.js"></script> into <script src="https://unpkg.com/can@3/dist/global/can.all.js"></script>. Well it didn’t work. I removed the connectedCallback and changed Default to Value but still didn’t work, what makes it fail?
Jeroen Cornelissen
@jeroencornelissen
Jun 28 2018 12:27
Is there a quick way to setup can-route-pushstate with <script src=“https://unpkg.com/can@4/dist/global/can.all.js”> ?
Jeroen Cornelissen
@jeroencornelissen
Jun 28 2018 12:50
@nriesco I think you have to render the component <clock-controls> with stache. CanJS3 doesn’t have automount.
Kevin Phillips
@phillipskevin
Jun 28 2018 14:13
@nriesco also, you can't pass strings as the view and objects as the ViewModel
you need to do
  view: can.stache('<canvas id="analog" width="255" height="255"></canvas>'),
  ViewModel: can.DefineMap.extend({})
instead of
  view: '<canvas id="analog" width="255" height="255"></canvas>',
  ViewModel: {}
the second version only works in CanJS 4.0
Nico R.
@nriesco
Jun 28 2018 14:21
@phillipskevin thanks, I tried but had no luck. I’m just trying versino 4, as all my code has version 3 and was wondering how hard would it be to migrate to canjs4
so modifiying that example seemed like a good exercise to me
to understand what needs to be modified
so I guess there is something else that is not working
Kevin Phillips
@phillipskevin
Jun 28 2018 14:23
I'm actually working on a presentation about upgrading to CanJS 4.0 right now
will probably record for youtube next week
but I'll share the link to the slides today
Nico R.
@nriesco
Jun 28 2018 14:24
great
i think the issue is related to what @jeroencornelissen said
Kevin Phillips
@phillipskevin
Jun 28 2018 14:26
you just need to do something like
document.body.appendChild(
  can.stache("<clock-controls></clock-controls>")()
);
the element in the html won't work
Jeroen Cornelissen
@jeroencornelissen
Jun 28 2018 14:27
Yes, that is what i meant.
How does setting the root in can-route-pushstate work?
https://canjs.com/doc/can-route-pushstate.root.html
I keep getting this error: TypeError: Cannot set property 'root' of undefined at execute
I set it like this: route.pushstate.root = '/test/';
Kevin Phillips
@phillipskevin
Jun 28 2018 14:32
I think you need to set route.bindings.pushstate.root
the docs might be wrong, not sure what they show
Jeroen Cornelissen
@jeroencornelissen
Jun 28 2018 14:34
they show route.pushstate.root =
Kevin Phillips
@phillipskevin
Jun 28 2018 14:35
oh, I guess I did know that: canjs/can-route-pushstate#88
Jeroen Cornelissen
@jeroencornelissen
Jun 28 2018 14:35
when I set it to route.bindings.pushstate.root it works, but {{routeUrl(page='home')}} doesn’t work anymore. It sets it to ?page=home.
Kevin Phillips
@phillipskevin
Jun 28 2018 14:47
what do your registered routes look like?
Jeroen Cornelissen
@jeroencornelissen
Jun 28 2018 19:41
@phillipskevin "{page}
{page}and {page}/{subpage}
Kevin Phillips
@phillipskevin
Jun 28 2018 20:51
@jeroencornelissen seems lik that should be fine... is this a project you can push up?