These are chat archives for ractivejs/ractive

29th
Jul 2017
Chris Reeves
@evs-chris
Jul 29 2017 01:29
I like the dates on there vs the timestamps :thumbsup:
dates[date.substr(0, 10)] = total? :grinning:
Martin Kolárik
@MartinKolarik
Jul 29 2017 01:34
yep, much better for readability and it turned out to be even more efficient, because timestamps don't compress well
you mean use only the date part?
Chris Reeves
@evs-chris
Jul 29 2017 01:35
yes
this is really cool for tracking uptake on new versions
I sometimes wonder if new versions don't have sleeper bugs that the test suite misses and I don't find out about until people start to migrate
Martin Kolárik
@MartinKolarik
Jul 29 2017 01:39
that might actually be a good idea :+1:
Chris Reeves
@evs-chris
Jul 29 2017 01:39
seeing that 0.9.3 has 10x the hits of 0.9.2 over the period that it has been released is comforting
Martin Kolárik
@MartinKolarik
Jul 29 2017 01:42
it'll be more interesting to check that when it has all data, right now it's just a small sample
Chris Reeves
@evs-chris
Jul 29 2017 01:43
yes - I'm particularly interested in month over month and year over year
especially across versions
Martin Kolárik
@MartinKolarik
Jul 29 2017 01:44
btw I published docs for all current features here: https://github.com/jsdelivr/data.jsdelivr.com
Chris Reeves
@evs-chris
Jul 29 2017 02:01
ah, neat - that gives you everything you need to build bundles in-browser
do /combine/ requests add to each individual package's stats?
Martin Kolárik
@MartinKolarik
Jul 29 2017 02:11
yes, same as making each request separately
Chris Reeves
@evs-chris
Jul 29 2017 02:11
nice!
Juan C. Andreu
@andreujuanc
Jul 29 2017 21:55
Is it me, or https://github.com/rstacruz/ractive-promise-alt fails with new ES6 modules export thingy?
lots of self registering libraries are broken in ES6 i think D:
Joseph
@fskreuz
Jul 29 2017 22:11
Not sure what you mean. The library wasn't written for ES6.
Also, to properly do global registration of plugins in ES6, Ractive needs to be a dependency of the plugin module.
import Ractive from 'ractive'

Ractive.theregistry.theplugin = ...
To include the plugin as a module, since it's not exporting anything, use the side-effecty version of imports (no names)
import 'thepluginmodule'

// do stuff with theplugin. it's assumed to have registered with ractive at this point.
Long story short, stuff should now be shipping ES formats :D
Joseph
@fskreuz
Jul 29 2017 22:20
In other things...

Doing more research on how Ractive works. Is it correct to say:

template -(parser)-> AST -(construct)-> VDOM -(render)-> DOM

?

And VDOM is simply a "hydrated" version of the AST that holds references to elements, pseudo-elements (sections, conditions), data, computations, listeners etc?
Joseph
@fskreuz
Jul 29 2017 22:25

And any change in the data makes Ractive do the following:

  • Walk through the VDOM, top to bottom
  • Not touch elements that have not been changed
  • For elements that changed, either re-render (updated data), teardown (when data no longer valid) or shuffle (when the data was repositioned)

?

And whatever happens in the VDOM has a corresponding action in the real DOM (i.e. update - re-render, teardown - remove node and descendants, shuffle - detach and re-attach)?
Juan C. Andreu
@andreujuanc
Jul 29 2017 22:32
Thanks Joseph
That cleared things out
Joseph
@fskreuz
Jul 29 2017 22:34
It's probably easier to just rewrite the thing in ES6 than to mess with build tooling to get the UMD version to play well with other ES6 code. :D
Juan C. Andreu
@andreujuanc
Jul 29 2017 22:38
Cos no much time, and i'm just testing around somestuff,
Plugin is very small, so i just
Ractive = (Ractive.__esModule || Ractive.default) ? Ractive.default : Ractive;
:)
Joseph
@fskreuz
Jul 29 2017 22:39
Alternatively, you can rewrite it to not globally register. You can export the definition, and use in dependent components. Zero side-effects. :D
// rpa.js
export default { /* the plugin definition */ }

// yourcomponent.js
import rpa from './rpa.js'

export default Ractive.extend({
  adapt: [ rpa ],
  ...
})