These are chat archives for ractivejs/ractive

10th
Aug 2018
Chris Reeves
@evs-chris
Aug 10 2018 01:30
@ceremcem I moved the global setup into the plugin so that it can also be easily used on the server side
just have to pass { global: true } to the plugin to tell it to register, and it will do so safely
(may need to use the new cache buster option on the build menu if you're not getting 0.10.8 in the output frame)
Cerem Cem ASLAN
@ceremcem
Aug 10 2018 04:34
even better!
Cerem Cem ASLAN
@ceremcem
Aug 10 2018 17:39
a general question: can we detect a Reference Exception in the runtime, satisfy the requirement and say the engine "try again please?" (or can we detect in compile time, that would be even better)
after saying that, this sounded like "tree shaking" o_O
Chris Reeves
@evs-chris
Aug 10 2018 18:09
no, there's not really a way to do that right now, unless you do some serious monkey patching
Cerem Cem ASLAN
@ceremcem
Aug 10 2018 18:13
so the only option is detecting all references before executing the script, which seems what Rollup does
Joseph
@fskreuz
Aug 10 2018 18:55
Reference Exception... missing variables?
If this is the browser, I think you can window.onerror to capture unhandled exceptions, then check what exception it is.
But then, having a variable missing is something that should never happen.
Cerem Cem ASLAN
@ceremcem
Aug 10 2018 19:13
that "missing variable" would be the part of my "design"
I kept splitting my webapp codes which naturally increased the page responsiveness but this kind of manual splitting approach has no end. so I thought if I was able to load the missing libraries on exception, it would be global solution for code splitting
Cerem Cem ASLAN
@ceremcem
Aug 10 2018 19:19
but thinking again, determining the dependencies on compile time seems a more robust approach: ceremcem/rollup-test#3
Chris Reeves
@evs-chris
Aug 10 2018 20:32
wait, template refs or js refs?
What you could do is define boundaries/"chunks". Then use acorn + voodoo to determine what references reference stuff past these boundaries. Then replace/rewrite these references with proxies.
just throwing ideas :grin:
Joseph
@fskreuz
Aug 10 2018 21:29
This gets especially difficult because async. You'd need to rewrite sync code to be async, write them async to begin with (like webpack recommending import()), or be able to re-run the code that failed one more time (and hope there are no side-effects/state) - like how hmr works.
Chris Reeves
@evs-chris
Aug 10 2018 21:29
gonna need lots of chicken blood
rollup code splitting looks like it has gotten very good in the last two releases
I think they're about to 1.0 it
Joseph
@fskreuz
Aug 10 2018 21:30

gonna need lots of chicken blood

definitely. lotsa hair pulling and teeth grinding. :grin:

Oooh. haven't checked out the latest Rollup. Must add to things to do. :grin:
Chris Reeves
@evs-chris
Aug 10 2018 21:31
so many things to do
I'm not totally sure about the systemjs underlying the async imports, but it's definitely better than the mangled webpack things
Cerem Cem ASLAN
@ceremcem
Aug 10 2018 21:43

gonna need lots of chicken blood

laughed out loud :D

wait, template refs or js refs?

I thought for both at the beginning. If I could capture a Reference Error, perform a MITM and then let the call continue, it would work for everything