These are chat archives for ractivejs/ractive

21st
Jul 2018
Cerem Cem ASLAN
@ceremcem
Jul 21 2018 19:16
likely off topic: what format is this:
x = function({foo}){
  return 2 * foo;
}
kouts
@kouts
Jul 21 2018 19:17
es6 ?
Cerem Cem ASLAN
@ceremcem
Jul 21 2018 19:18

problem is that if I define the same function like

x = function(opts){
  return 2 * opts.foo;
}

then everything works correctly. If I define like above, old browsers throw an error

Chris Reeves
@evs-chris
Jul 21 2018 19:18
maybe es2016, cause I'm not sure if destructuring is args was supported in es2015
Cerem Cem ASLAN
@ceremcem
Jul 21 2018 19:18
hmm, es6? so I should convert it to es5 format, by using babel or something?
Chris Reeves
@evs-chris
Jul 21 2018 19:18
you'd have to transition, yeah
kouts
@kouts
Jul 21 2018 19:19
try
x = function x(_ref) {
  var foo = _ref.foo;
  return 2 * foo;
};
Chris Reeves
@evs-chris
Jul 21 2018 19:19
Buble is easier to deal with than Babel
also, guard _ref with _ref = _ref || {}
Cerem Cem ASLAN
@ceremcem
Jul 21 2018 19:20
@kouts that works, absolutely, but I'm not the author of the dependency
Chris Reeves
@evs-chris
Jul 21 2018 19:20
es has come a long way in a few years
Cerem Cem ASLAN
@ceremcem
Jul 21 2018 19:21
@evs-chris I failed with babel, so I give Buble a try (it's from Rich again, isn't it :)
Chris Reeves
@evs-chris
Jul 21 2018 19:21
yep 😀
Cerem Cem ASLAN
@ceremcem
Jul 21 2018 19:45
I find bubleify which has a straightforward configuration to get up and running
but sadly doesn't work for me. I want to make my webapp work on Chrome 42.xx on an old Android device, so I just changed the chrome: 42 option. would I need anything else?
Cerem Cem ASLAN
@ceremcem
Jul 21 2018 19:54
I also find es-check, digging in...
kouts
@kouts
Jul 21 2018 21:10
Question: Can you provide yield's or named yields with default content?