These are chat archives for ractivejs/ractive

1st
Jun 2018
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 00:11
hi
(that's all, all I wanted to say is hi)
Albert Gemoets
@KnightSwordAG_twitter
Jun 01 2018 00:16
Hi there! I'm new to Ractive.js and I'm trying to something a little weird.
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 00:16
hi
Albert Gemoets
@KnightSwordAG_twitter
Jun 01 2018 00:17
I have this button in an {{each}} block:
One moment, cutting and pasting cross machines isn't working... :D
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 00:19
you may also take advantage of playground: https://ractive.js.org/playground/#N4IgFiBcoE5SBTAJgcwSAvhoA
Albert Gemoets
@KnightSwordAG_twitter
Jun 01 2018 00:19
So, I have this button in an {{each}} block:
<button type="button" class="btn btn-outline-danger" on-click="['cardFieldDeleteButtonClick','{{idx}}']">
The idx is the index field for the {{each}}
But when the click method fires, the index is undefined.
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 00:20
of course
use idx in place of '{{idx}}'
Albert Gemoets
@KnightSwordAG_twitter
Jun 01 2018 00:20
I have tried that too, it's also undefined.
Let me try it one more time, so I can feel sheepish when it works. :D
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 00:20
okay. please prepare an example in the playground and let's see what we can do
Albert Gemoets
@KnightSwordAG_twitter
Jun 01 2018 00:21
Okay, one moment. :)
.... Uh... I just found the bug. :DS
I didn't pass my index to the calling method in question...... :D
So, thank you Cerem Cem ASLAN. :D
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 00:24
you welcome :)
Albert Gemoets
@KnightSwordAG_twitter
Jun 01 2018 00:24
Just the way it is huh, when you have to explain your bug to someone else, it forces you to see it the way they do.:P
Yup, that fixed it! >.<
Oh well, thanks again.
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 00:26
my question asking ratio in StackOverflow is 3/8, which means I do post 3 out of 8 questions because I find the answer of the remaining 5 questions after finishing the last sentence :)
Norbert Haberl
@nhaberl
Jun 01 2018 07:06
Are you using any CSS frameworks with ractive? If Yes....any recommendations? :)
Arnaud Dagnelies
@dagnelies
Jun 01 2018 07:48
sounds kind of orthogonal to ractive. Why not simply use the one you prefer?
Arnaud Dagnelies
@dagnelies
Jun 01 2018 07:54
I would also make sense to pick the same as the "theme framework" you are using.
ractive is neutral to all of this
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 08:20

ractive is neutral to all of this

+1

Trevor Morgan
@trvrm
Jun 01 2018 12:52
I tend to use either Bulma or Bootstrap when I'm building ractive sites.
kouts
@kouts
Jun 01 2018 12:58
Bootstrap is a nice all-rounder, usually I go with some CCS of Bootstrap not all (too much bloat)
When I want to hack something quick I use the full-blown version though :smile:
Joseph
@fskreuz
Jun 01 2018 13:00
I typically lean towards Bootstrap for a full-featured framework. And because of Bootstrap, I gravitate towards Sass if pre-processing is needed. Have used Pure CSS before for simpler cases (and the docs currently use it). At minimum, esp when going vanilla, Normalize must be present. But as everyone already mentioned, Ractive doesn't mind which one you use.
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 14:31
out of topic: one of the most important things besides the functionality of Ractive is that our issues are not closed in a rush. the answerer lets you think about the answer. did anyone remark that before? I'm not seeing this lovely behaviour much
Joseph
@fskreuz
Jun 01 2018 14:39
You mean issues in Github?
For bugs, they usually get closed immediately. Github supports commit message keywords that auto-close the related issue.
But for things I label as inquiry/*, enhancement/* or meta/*, those are usually open for extended periods so discussions happen.
Also, closed issues don't necessarily mean the end of the issue. I remember someone mention this in another open-source project that a discussion can still continue on a closed issue. The comment box is still there.
Joseph
@fskreuz
Jun 01 2018 14:44
Discussion is "officially dead" when the owner locks the thread, effectively removing comment functionality - which never happens in Ractive (and hopefully we never have to use that).
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 14:45
yes, I meant the github issues
I'm aware of the commit message keywords but as far as I could notice, you also put a word of two in order to make the issue clearer
Joseph
@fskreuz
Jun 01 2018 14:49
@evs-chris has done that since... forever. He always leaves a message after the close. If not after, scroll a few messages before. There's either that message, or a discussion that led to the solution. :grin:
But yeah, I agree. I recommend leaving a message. It's the same practice with code reviews/PRs. If you tell someone not to do this something, better specify why and what the alternative is. :thumbsup:
Joseph
@fskreuz
Jun 01 2018 15:08
Speaking of code reviews, PRs and advice, Ractive is always open to accepting contributions in any form. :grin:
Whether its correcting that typo, restyling the site, or fixing that pesky bug that's been open for 3 hours - just post it, everyone reviews it, and everyone goes home happy. :tada:
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 15:09
:)
Joseph
@fskreuz
Jun 01 2018 15:10
I need to find a very visible spot for this "ad" :grin:
Chris Reeves
@evs-chris
Jun 01 2018 16:13
correction: one of the many typos 😁
kouts
@kouts
Jun 01 2018 16:27
Question: is there a difference between {{#payload.foo}} ... {{/}} and {{#with payload.foo}} ... {{/}} ?
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 16:31
there is none unless payload.foo is iterable, I guess
Joseph
@fskreuz
Jun 01 2018 16:38
Yep, {{# object }} will act like {{# with }}, while {{# array }} will be more like {{# each }}
...or something along those lines https://ractive.js.org/api/#sections
Chris Reeves
@evs-chris
Jun 01 2018 16:39
regarding css preprocessing, the bin component compiler has support, but it's pretty basic
you basically get the text content of the style in a hook function and are expected to return css
there's a very small difference between {{#foo}} and {{#with foo}} if foo is undefined
the with will still render, but the plain block won't (I think... been a while since I used pain blocks)
Joseph
@fskreuz
Jun 01 2018 16:52

pain blocks

:joy: exactly why the Handlebars versions were created. Lots of ambiguity with the regular sections.

Chris Reeves
@evs-chris
Jun 01 2018 16:54
Freudian auto correct 😂
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 20:18
an hour ago I tried setImmediate() function. I'm experiencing a huge performance improvement. @evs-chris @fskreuz did you consider it?
I just used https://github.com/YuzuJS/setImmediate where the demo says much about it
Joseph
@fskreuz
Jun 01 2018 20:21
I've read about it. It's in the same league as requestAnimationFrame, a more optimized timer.
There was an article comparing it against setTimeout, requestAnimationFrame, process.nextTick() somewhere.
It all boils down to: one is standard, one is non-standard, one is fairly new and mainly for animations, one is only in node. :D
oh wait... I didn't read the repo. it's effectively all of these. :facepalm:
Cerem Cem ASLAN
@ceremcem
Jun 01 2018 20:27
I just replaced all setTimeout(fn, 0) calls with setImmediate(fn) and the performance improvement seems huuuuuuuuuge. I love it
it also falls back to setTimeout(fn, 0), so it seems safe to use
Chris Reeves
@evs-chris
Jun 01 2018 21:56
the only place the ractive lib code uses settimeout is for actual timeouts, like the safety net in transitions and fallback for raf in animate
one of the benefits of synchronous guts 😀, you can just queue post op actions and run them when the current op is done
kouts
@kouts
Jun 01 2018 22:17
A little late but thanks all for your answers. :smile: