These are chat archives for canjs/canjs

6th
May 2016
Sunil George
@georgesunil81
May 06 2016 15:43
I am trying for a way to apply a css class based on a true/false condition onto an html element within my stache. I assume this is commonly done within stache, I am fairly new. I'd appreciate if someone can help me with the info.
Morgan Heimbeck
@Xitstrategies
May 06 2016 15:44
class="{{#if truthy}}green{{/if}}"
Sunil George
@georgesunil81
May 06 2016 15:45
Wow, thanks @Xitstrategies, thats a clean and quick way to do it. Thanks a ton for the help.
Also, on a separate issue, need some thoughts on whether to have stache do some logic work, or, preprocess the object given to it so that we can have a lighter stache template that does not do "too much" logic.
Kevin Phillips
@phillipskevin
May 06 2016 16:46
sounds like you already know the answer :smile:
my rule of thumb is that if I am worried I might screw up the logic in the template, I’ll do it in the viewModel so I can write tests for it
Thomas Sieverding
@Bajix
May 06 2016 17:50
Is there an ETD on Can 3.0?
Julian
@pYr0x
May 06 2016 17:50
ETD?
Thomas Sieverding
@Bajix
May 06 2016 17:50
estimated time of delivery
Julian
@pYr0x
May 06 2016 17:51
beta or final?
Thomas Sieverding
@Bajix
May 06 2016 17:51
either
Julian
@pYr0x
May 06 2016 17:51
justin said, a alpha should be available this weekend
beta is comming soon
Thomas Sieverding
@Bajix
May 06 2016 17:51
Ok sick
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:51
I have can.Component in php page rendered within cached html from the server (no SSR) the PHP rendering is more faster is there a way to handle this out of done.ssr
@pYr0x have you face this issue before?
Julian
@pYr0x
May 06 2016 17:52
the finale i heard somethink like end of this year... but this seems a little bit to lonh
Thomas Sieverding
@Bajix
May 06 2016 17:52
I’m confused
Julian
@pYr0x
May 06 2016 17:52
why?
Thomas Sieverding
@Bajix
May 06 2016 17:53
What is being cached?
Also, anytime you’re caching it’s going to be faster than on-demand
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:53
@Bajix the php rendering
Thomas Sieverding
@Bajix
May 06 2016 17:54
What is it faster than?
Julian
@pYr0x
May 06 2016 17:54
@cherifGsoul you cached the components output
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:54
the PHP rendering I have just a widget with can.Component
Julian
@pYr0x
May 06 2016 17:54
ok
but the cache is not live
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:55
no I dont know how all I did in my php page <div type="text/stache" can-autorender"></div>
Thomas Sieverding
@Bajix
May 06 2016 17:55
You mean to say that PHP rendering a cached version of your SPA is faster than the SPA rendering itself?
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:55
cache is not live? what you mean @pYr0x ?
@Bajix is not SPA
Julian
@pYr0x
May 06 2016 17:55
sorry i am confused too ;)
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:56
I know
:)
Julian
@pYr0x
May 06 2016 17:56
you have a script tag like you posted... so done-autorender will render the content inside
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:56
yes
Julian
@pYr0x
May 06 2016 17:56
and what do you cache?
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:57
I cache the rendered html from the server (with PHP) I have just a small widget there
Julian
@pYr0x
May 06 2016 17:57
how can you cache the rendered html with javascript inside?
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:57
The framework I use makes a lot of inline JS
I dont cache it
that's the question
Julian
@pYr0x
May 06 2016 17:58
how you can cache that?
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:58
I dont know if steal can help with this
Julian
@pYr0x
May 06 2016 17:58
is the question?
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:58
yes
Julian
@pYr0x
May 06 2016 17:58
:D
Thomas Sieverding
@Bajix
May 06 2016 17:58
Does this even have to do with CanJS at all? If you’re caching the rendered output before your client-side rendering occurs, then you’re just optimizing the app bootstrapping
Julian
@pYr0x
May 06 2016 17:59
so... i dont think it is possible with PHP to cache the rendered html after canjs did all his job
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 17:59
yes
Julian
@pYr0x
May 06 2016 17:59
you can grap the HTML with a headless browser
but that is not good
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 18:00
is not possible even
Julian
@pYr0x
May 06 2016 18:00
other solution, make a build, with steal?
Thomas Sieverding
@Bajix
May 06 2016 18:00
I mean, maybe it’s viable to create a NodeJS SSR wrapper that can be spawned via PHP
And then add a caching layer in front of that
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 18:00
ok
Thomas Sieverding
@Bajix
May 06 2016 18:00
Toss in a little Docker action to keep things sane
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 18:01
it's hard in that situation
Julian
@pYr0x
May 06 2016 18:01
@Bajix ;) but in this situiation you have to have node
;)
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 18:01
the client uses shared hosting :D
Julian
@pYr0x
May 06 2016 18:01
so i think the best method is to create a build
but with this you have to remove the autorender
Mohamed Cherif Bouchelaghem
@cherifGsoul
May 06 2016 18:03
it is built
Julian
@pYr0x
May 06 2016 18:03
oh ok
so you only want to cache the HTML output
is it really so slow without caching?
i think a built with steal is fast
(not so fast) but fast
Sunil George
@georgesunil81
May 06 2016 18:09
Thanks buddy @phillipskevin . That makes so much sense to me. Must keep the test-ability high for sure. Thanks for setting that straight for me.
Kevin Phillips
@phillipskevin
May 06 2016 18:09
any time @georgesunil81