These are chat archives for ractivejs/ractive

9th
Aug 2017
Christopher St. John
@ckstjohn_twitter
Aug 09 2017 14:41
hi. we're using ractive 0.7.3 entirely client-side for a cms-ish app, along with ractive-load. looks like ractive-load depends on version 3 templates, so it's a no-go for 0.9.x without rewriting ractive-load parse. started to do that real quick last night but got bogged down (v4 templates look to be less friendly to write that sort of code with, plus i was unsure how deep the rabbit hole was). googled around a bit, saw some 0.8 discussion, but didn't see anything about 0.9 + ractive-load plans (could easily have missed it, though). so: is ractive-load still a thing? and if so, are there any thoughts about brining it up-to date, and if not, any recommendations on replacements? apologies if my search missed a discussion, spend most of my time digging into code...
Joseph
@fskreuz
Aug 09 2017 14:44
There was a discussion about this not too long ago. It was a workaround tho, where you fork ractive-load and make it expect a 4. iirc, v4 only added features and v3 templates should be fine.
I can probably look into this later, unless someone wants to beat me to it. :grin:
Christopher St. John
@ckstjohn_twitter
Aug 09 2017 14:48
hmm, i changed the version to 4. but it looks like parse() has a lot of v3 specific stuff in it (attributes item.m[1].m vs item.a.href, for example). could totally have that wrong though, i was mostly just poking it with a stick rather than trying to deeply understand it.
Chris Reeves
@evs-chris
Aug 09 2017 14:49
the changes to work with 0.8 should also work with 0.9
attributes are just no longer stored as a map so they don't step on each other in certain situations
I think rvc has been updated to parse correctly, and if you pull master rvc into a local build of ractive-load, you can get it to work with minimal fiddling
worst case, you would need to replace item.a.thing with item.m.find(a => a.n === 'thing')
Christopher St. John
@ckstjohn_twitter
Aug 09 2017 14:53
@evs-chris thanks, will do that.
Chris Reeves
@evs-chris
Aug 09 2017 14:57
as far as replacements, there's a component compiler built into the ractive distribution that works nicely with webpack. So if you use webpack, you can get nice fast-loading pre-parsed ractive modules using code splitting.
If you have ractive installed via npm, you can run the ractive bin at node_modules/.bin/ractive for more info
Christopher St. John
@ckstjohn_twitter
Aug 09 2017 15:06
thanks, i'll take a look.