These are chat archives for canjs/canjs

24th
Aug 2018
Thomas Sieverding
@Bajix
Aug 24 2018 00:22
Does CanJS work w/ VueJS?
Justin Meyer
@justinbmeyer
Aug 24 2018 02:54
@Bajix yes, ObserveObject === can-observe
there's no VueJS integration
Adam L Barrett
@BigAB
Aug 24 2018 03:34
...yet :)
(not a hint or anything, there's nothing in the works at all or anything, I just didn't want to rule out the possibility)
Thomas Sieverding
@Bajix
Aug 24 2018 08:13
@justinbmeyer Do you know if CanJS observables are interoperable with VueJS observables presently? I think that the next major version of Vue will be more split up, and if they make their observables standalone, then it should be viable to use steal config maps to swap something that implements the same interface but uses Can observables. It would be interesting if they’d even consider using Can observables in lieu of their own considering how much more advanced they are.
Justin Meyer
@justinbmeyer
Aug 24 2018 14:14
@Bajix I don't know. I know they have a similar system. But I've only briefly skimmed the mechanics. It's not event based I think. I think there's just one "listener" for each observable value.
but I might also be thinking of easy-react-state or whatever it is called
Gregg Roemhildt
@roemhildtg
Aug 24 2018 15:10
Quick(ish) question. Do you guys think it'd be possible to use can-stache as a templating language that would output a different format than html? I'd like to design a JSON file, that serves as a template that I could run through my template renderer with helpers and context and output plain json.
This template file would resemble json, but would have stache tags inside it that would be replaced by my helpers and context.

Just to give you an example, this json file :

 [{
                                    "text": "Date & Time of inspection",
                                    "style": "grayb"
                                },
                                {
                                    "style": "gray",
                                    "text": "{{helpers.moment(data.inspection.DateCreated, format=M/D/YYYY H:m A)}}"
                                }
                            ],
                            [{
                                    "text": "Weather Conditions:",
                                    "style": "grayb"
                                },
                                {
                                    "style": "gray",
                                    "text": "{{data.inspection.WeatherCondition::None Specified}}"
                                }
                            ],

Should compile down to plain json where the special tags would be replaced by my scope and helper output

Gregg Roemhildt
@roemhildtg
Aug 24 2018 16:09
I think dot will work for this actually http://olado.github.io/doT/
Justin Meyer
@justinbmeyer
Aug 24 2018 17:09
@roemhildtg you'd want to make stache text-only
so it doesn't produce fragments
About to discuss proposals: https://www.youtube.com/watch?v=2WM0WOAY_jE
Matthew Phillips
@matthewp
Aug 24 2018 17:27
Watch that ^^