These are chat archives for ractivejs/ractive

23rd
Jun 2017
Mark Powell
@mpowell-atomic
Jun 23 2017 14:13
hi @evs-chris! nice to see your 'ractive-bin-loader'! does it support the single file component spec? or has that spec changed for 0.9x? i.e. using imports <link rel='ractive' href='foo.html' name='foo'>
and grabbing the template from the inline html instead of using script tags and template: $TEMPLATE? cheers!
Chris Reeves
@evs-chris
Jun 23 2017 14:39
The bin component format still supports single file components, though in a slightly different format. Loading other components is pushed off into purpose-built tools for handling modules, like rollup and webpack.
So instead of using a link tag, you can use animport statement in the script, and whatever bundler/loader you use can take care of it from there. I hadn't used webpack prior to trying to write a ractive loader, but it seems to work really well for this sort of thing.
Mark Powell
@mpowell-atomic
Jun 23 2017 15:02
ok. my concern is that it doesn't conform to the defined spec for single file components (which is entirely your prerogative!) so it breaks years of convention. Is there a good reason to not use that spec? should the single file component spec should be updated for 0.9x onwards? thanks!
Chris Reeves
@evs-chris
Jun 23 2017 15:14
Mostly the loaders that follow the spec have a lot of moving parts that are hard to maintain. rvc loaders will still work with 0.9 and 1.0 when released, they just need to be updated with every release.
The spec also doesn't get along with non-ractive code very well, but targeting ES modules is now pretty universal.
Joseph
@fskreuz
Jun 23 2017 15:18
The spec pretty much only defines how the component files are written. Implementation is totally up to the loader (i.e. what's emitted, how paths resolve, etc.).
Mark Powell
@mpowell-atomic
Jun 23 2017 15:21
it would be a shame if there wasn't an officially supported loader (not that there is now but if this new loader is the official one) that supports the current single file component spec because it was such a unique selling point of ractive back in the day and looked so awesome. vue really took that and ran with it and improved it in a lot of ways (preprocessor support for the css section etc).
Joseph
@fskreuz
Jun 23 2017 15:24
Yep, it's probably time to get the component spec and loaders up to speed with these new features.
It all goes back to the issue of so many things to do, so little time... and people. :D
Chris Reeves
@evs-chris
Jun 23 2017 15:35
is there a particularly advantage that the spec loaders have over the built-in parser?
plugins are also supported in the bin loader, so you can preprocess your CSS or transpile your scripts or use parser transforms
I would like for the component spec to be superceded...
Does anyone have some example components I can look at for a comparison?
let's drag in @dagnelies into this one (since the component list has his name in it) :D
Also, it's not so much an advantage. It's more about being in use for a long time now.
Chris Reeves
@evs-chris
Jun 23 2017 15:41
That's a sort of advantage 😀
Joseph
@fskreuz
Jun 23 2017 15:42
I've been in the "change the spec" train before (I remember requesting wrapping the HTML in <template> before). But since then, it isn't so bad without it. Vue did it now tho. :P
Chris Reeves
@evs-chris
Jun 23 2017 15:43
They never seemed to work well for widget components - mostly for views, as it's probably evidenced by a lack of them in the component integrations.
You can put partials in template tags in the bin format
Joseph
@fskreuz
Jun 23 2017 15:44
I was thinking more about just making it just a top-level wrapper for "here's the HTML", not really the actual <template> element.
Chris Reeves
@evs-chris
Jun 23 2017 15:45
Ah
Joseph
@fskreuz
Jun 23 2017 21:14
Which version did the CLI come out?
Chris Reeves
@evs-chris
Jun 23 2017 21:14
0.9
Joseph
@fskreuz
Jun 23 2017 21:15
thanks :thumbsup:
I'm always at the impression that all the fancy stuff came with 0.8 :D
Probably because of the perf overhaul.
Chris Reeves
@evs-chris
Jun 23 2017 21:17
Nah, we were trying to get 0.8 out, since 0.7.3 was out there pretty much unsupported for so long
if you want to see some wacky code, step through a set operation on 0.7
Joseph
@fskreuz
Jun 23 2017 21:19
:D