These are chat archives for riot/riot

12th
Apr 2017
Fit Foodie App
@FitFoodApp_twitter
Apr 12 2017 05:03
Does anyone know if riot is going to support namespaces in custom tags?
Sujith Krishnan
@sujith_krishnan_twitter
Apr 12 2017 07:09

@puppetmaster3 . Yes. I got it, jade will get rendered to html. But i was trying to add riot tags in jade template, and passing the data object from jade to tag

I achieved it in below way

Server Side
res.render('jadefile', data : data_from_server);

In Jade File

mytag
script(type="riot/tag", src="/path/to/mytag.tag")
script(src="https://rawgit.com/riot/riot/master/riot%2Bcompiler.min.js")

script.
riot.compile(function() {
var tags = riot.mount('*', {'config' : !{JSON.stringify(configs)}});
});

This way, data passed from server, which is available in jade - made available for tag (mytag).

Inside mytag.tag

<mytag>
   <div each="{ value, name  in opts.data}">
      <h3> {name} - {value}</h3>
   </div>
</mytag>

Wish to know if there any better implementation possible than this !

puppetmaster3
@puppetmaster3
Apr 12 2017 10:06
@sujith_krishnan_twitter I think you should use RIOT for SSR data binding. (and use Jade just for mark up)
@FitFoodApp_twitter RIOT is DOM based. If you are using namespaces in your .js you can continue to do that.
@fvezzoso file a bug maybe?
Sujith Krishnan
@sujith_krishnan_twitter
Apr 12 2017 10:10
@puppetmaster3 Thank you very much. Will check. (I am thinking to replace view render engine from jade to swig.)
puppetmaster3
@puppetmaster3
Apr 12 2017 11:33
@sujith_krishnan_twitter you will get very little from that switch, pug is just fine. just learn how to SSE using RIOT.
@sujith_krishnan_twitter SSR, not SSE.
Federico Vezzoso
@fvezzoso
Apr 12 2017 15:46
Yeah, already did @puppetmaster3 :) riot/riot#2317