These are chat archives for canjs/canjs

26th
Mar 2018
Viktor Busko
@Lighttree
Mar 26 2018 06:55

just like you can't have multiple native custom elements with the same tag name, you shouldn't create two components with the same tag name

@phillipskevin doesn't this mean that each major version of canjs we had to create additional tag ? like <can4-component>, <can5-component> etc. To avoid this we will have to migrate all apps to next major version of canjs right ?

Jeroen Cornelissen
@jeroencornelissen
Mar 26 2018 07:00
@Lighttree we publish our components to a private npm. Each component has its own repo. With a CanJS update we publish a new major version. So we can install them easily to our current project.
Viktor Busko
@Lighttree
Mar 26 2018 07:00
We do the same
but if you are using can 2 / 3 / 4 on the same page
you will have the issue that I described above
unless you will rename components based on major version of can
Viktor Busko
@Lighttree
Mar 26 2018 07:06
The problem not in publishing, we also publish new major version, so for sure we can have custom-component with different major versions and different tag names there. I was hoping that such version resolve will be done internally in can components somehow :) thats all. If no, we will have to do this, for now I don't see better option.
Jeroen Cornelissen
@jeroencornelissen
Mar 26 2018 07:15
We only use one Can version per page, so we don’t have that problem.
Did not know you could!?!
Gregg Roemhildt
@roemhildtg
Mar 26 2018 14:51
Running into a critical issue I just noticed with an app. The app renders a page component dynamically based on the route, and when the route gets switched back and fourth between different pages. Some of these pages are using promise getters, and these getters are being called increasingly often as the page component gets re-rendered. so the first time, the getters are called once, but depending on the page, the getter is called 3, 5, 7, ...times on subsequent re-renders.
This is resulting in an increasingly slow app as ajax requests are being sent in an increasing number as the user changes pages
I keep trying to figure out what is causing this but the stack's are quite huge and can't seem to find anything super meaningful. Here's the rendering section that creates the component in the donejs app: https://gist.github.com/roemhildtg/bd75eb27cf885e5baf84c2c92e58e0c8
Gregg Roemhildt
@roemhildtg
Mar 26 2018 15:25
Jsbin doesn't seem reproducible but I was able to get it to happen here: https://github.com/roemhildtg/canjs-promise-bug/tree/master
In a simpler example
Chasen Le Hara
@chasenlehara
Mar 26 2018 15:37
@roemhildtg I’m checking out your example repo now
Chasen Le Hara
@chasenlehara
Mar 26 2018 16:11
@roemhildtg Did this used to not leak?
Gregg Roemhildt
@roemhildtg
Mar 26 2018 16:11
I am fairly sure that it didn't at one point. But I'm not 100% sure when it started
Justin Meyer
@justinbmeyer
Mar 26 2018 16:12
@roemhildtg can you shift this to a helper like bitballs does it? https://github.com/donejs/bitballs/blob/master/public/app.js#L198 it passes the nodelist down to prevent leaks
or wait 5ish weeks until this is done: canjs/canjs#4030
with: https://gist.github.com/justinbmeyer/268a70a500a56c2b619a772707e078e6
(or if you want to help, I can start you on making the changes to support this asap)
Gregg Roemhildt
@roemhildtg
Mar 26 2018 16:15
Hmm, yeah I'll give that a shot @justinbmeyer
Justin Meyer
@justinbmeyer
Mar 26 2018 16:16
is gitter broken for anyone else? I can't see new messages ...
I'm going to add some lines
Gregg Roemhildt
@roemhildtg
Mar 26 2018 16:16
Yeah, it looks like that gist is blocking
Justin Meyer
@justinbmeyer
Mar 26 2018 16:16
util it gets fixed
ok, looks better now
Chasen Le Hara
@chasenlehara
Mar 26 2018 16:17
The Gitter app always breaks with code examples, the site works fine in a browser 🙄
Justin Meyer
@justinbmeyer
Mar 26 2018 16:17
I use the browser
Gregg Roemhildt
@roemhildtg
Mar 26 2018 16:17
Yeah chrome looks broken right now
Chasen Le Hara
@chasenlehara
Mar 26 2018 16:17
Oh hm 🤔
Gregg Roemhildt
@roemhildtg
Mar 26 2018 16:18
:disappointed:
Justin Meyer
@justinbmeyer
Mar 26 2018 16:18
@chasenlehara we talked about moving to slack, but do they have a free for open source offering?
Pricing___Slack.png
Chasen Le Hara
@chasenlehara
Mar 26 2018 16:33
@justinbmeyer I don’t think they do… I would personally oppose a move to Slack / a closed-source product.
Gitter is open source, let’s fix it ;)
Gregg Roemhildt
@roemhildtg
Mar 26 2018 16:42
Hey guys, so switching to the bitballs helper method did seem to fix the issue. In an attempt to make the helper a bit smaller, I tried moving the can-import to the template, but this seems to cause the leak. So putting can-import in the helper method fixed it. There might have been other issues too but so far it looks like I'm on the right path