These are chat archives for canjs/canjs

22nd
Jun 2016
qantourisc
@qantourisc
Jun 22 2016 11:07
In principle all custom member (in the findAll scope) of can.Model should follow func(attr,success,error) correct ? (For sanities sake but not technical sake)
Also does canJS have a build-in method for calling certain function if the HTTP return code is X ?
qantourisc
@qantourisc
Jun 22 2016 11:54
Looking for can.ajax on the github, seems to contain a bug when data contains: "{}" it sends ["{","}"] as json
qantourisc
@qantourisc
Jun 22 2016 12:01
OK nevermind on that, making complete testcase
qantourisc
@qantourisc
Jun 22 2016 12:08
Found: user error: stray function with same name
Paul Tichonczuk
@tracer99
Jun 22 2016 15:46
I have a bug in a steal compiled version of my CanJS app. The bug only exists when compiled. Annoyingly, it is trapped by the Stache helpers function. But the catch outputs to can.dev.warn. can.dev is undefined in a production build.
Is this a bug I should file?
The bug itself is even more frustrating. It seems that a helper I have registered is not available in the compiled version, but is in dev.
Paul Tichonczuk
@tracer99
Jun 22 2016 15:51
This helper worked fine when it was a mustache file, but now that I have upgraded to 2.3 and converted all my mustache files to stache, the helper has vanished from scope.
Kevin Phillips
@phillipskevin
Jun 22 2016 15:52
how are you registering the helper?
Paul Tichonczuk
@tracer99
Jun 22 2016 15:52
Stache.registerHelper
where Stache is import Stache from 'can/view/stache/',
and to make sure, in the file that invokes the template I imported the file that registeres the helpers import 'ucp2/helpers/';
Matthew Phillips
@matthewp
Jun 22 2016 16:53
you might try importing it in the template itself, with can-import
I can't remember if that's needed or not
Paul Tichonczuk
@tracer99
Jun 22 2016 17:01
ok. will try, thanks.
Paul Tichonczuk
@tracer99
Jun 22 2016 21:25
@matthewp that did not help. I've narrowed down the possible cause though. I think it's to do with the structure of the packaged bundle. We use can-compile to compile all the views into a views.production.js file.
we use a wrapper for can-compile like so 'steal("can/view/ejs", "can/view/stache", function() { {{{content}}} })'
if I don't compile the views and let them be brought in like in dev (everything else compiled), the site works fine.
annoying thing is that again, this worked fine with can 2.2 and mustache.