These are chat archives for canjs/canjs

19th
Dec 2018
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 14:54
Hi guys!
I'm working on upgrade of an application from CanJS@3 to CanJS@5 and Steal@2.
I'm having a performance issue related with the application loading on an older version of Firefox (FF44) the application hangs many times, until it shows an window with title "Warning: Unresponsive script" dialog.
I don't know if the problem is related with CanJS or Steal, but can you guys give me some tips how to solve this issue?
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 15:01
It seems to spend some time on can-view-callbacks renderNodeAndChildren function.
Kevin Phillips
@phillipskevin
Dec 19 2018 15:11
do you have the latest can-view-callbacks, @ivospinheiro ?
there was an issue with the MutationObserver version of that code (which is used for browsers that don't support customElements, like older FF)
but it was fixed in the latest version
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 15:13
I'm using can-view-callbacks@4.3.2
Kevin Phillips
@phillipskevin
Dec 19 2018 15:15
ok
are you using "automounting"... where you have a component directly in your html?
like <my-app></my-app>?
or are you rendering everything with stache?
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 15:17
The first can-component is being rendered like this:
$('#app').html(stache("<my-app></my-app>"));
Kevin Phillips
@phillipskevin
Dec 19 2018 15:17
ok
so... to check if what I'm thinking is the issue, can you change the <html> element of your page to <html data-can-automount="false">
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 15:20
We are using a plugin for tree's named jstree and in this case it is a big tree with lots of nodes.
It seems that the renderNodeAndChildren function is being called whenever a new node is inserted on the DOM
@phillipskevin I will try that
Kevin Phillips
@phillipskevin
Dec 19 2018 15:25
:thumbsup:
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 15:32
It works! And now the application loads is much more faster
Kevin Phillips
@phillipskevin
Dec 19 2018 15:32
ok
that's good, but that means there's something we should fix
can share what your jstree code looks like?
and open an issue in can-view-callbacks if possible
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 15:33
I will do that as soon as I can
Kevin Phillips
@phillipskevin
Dec 19 2018 15:33
ok thanks
Justin Meyer
@justinbmeyer
Dec 19 2018 15:37
$('#app').html(stache("<my-app></my-app>")); should be $('#app').html(stache("<my-app></my-app>")());
I think jQuery will call the function ... so this ends up working, but imo, it's sorta weird to do it the 1st way
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 15:39
@justinbmeyer I didn't noticed that. Thanks
Anyway, it seems that it does not explain why the application is taking a lot of time to load
Kevin Phillips
@phillipskevin
Dec 19 2018 16:06
your app is still taking a lot of time to load after that data-can-automount change @ivospinheiro ?
Ivo Pinheiro
@ivospinheiro
Dec 19 2018 16:56
@phillipskevin It seems that it still takes a significative time to load.
Justin Meyer
@justinbmeyer
Dec 19 2018 17:38
@ivospinheiro only in FF44?
things run normal in other browsers?
Gregg Roemhildt
@roemhildtg
Dec 19 2018 21:31
@justinbmeyer Not sure yet! Other than modals and head.title, meta tags...etc
But it's cool to have the option!
the-learning-man
@the-learning-man
Dec 19 2018 23:38
Hi All
was trying https://github.com/canjs/webpack-example and it seems pretty broken :(
and wanted to check if there was something i'm missing...