These are chat archives for ractivejs/ractive

29th
Jun 2017
James Green
@jmkgreen
Jun 29 2017 08:46

Some feedback:

Reading https://ractive.js.org/api/#example-component-file - this is very confusing. As the reader I am immediately looking for what foo.html consists of and whether it too has any javascript behaviours.

It may be better to provide a link to a source code repository providing such an example instead of an inline code snippet.

It would also be good to get Event documented on the API page. Keep forgetting where the docs are found for that one.
Petter Ekrann
@petterek
Jun 29 2017 09:09

We have done a "bunch" of code splitting using ractive.
And we ended up adding a wrapper til that identifies part's of the app as "widgets" and loads the appropriate js for the widget.
We also introduced POJO view models that have no notion of ractive. Then we have a "layer" between that maps these things together.

Works pretty good, I belive, but for now it is an internal framework only (with very spescific adoptions) but if someone want to have a look at it i'm more than willing to share

Joseph
@fskreuz
Jun 29 2017 12:12
@jmkgreen foo.html is just another component file that should look the same as the one in the example. Also, there is an issue open for a full-scale app example with a few suggestions ractivejs/ractivejs.github.io#74 . I just haven't got to it yet. :D
Events are documented at https://ractive.js.org/concepts/#event-management . Components follow pretty much the same rules as regular instances and DOM events in terms of listening and propagation. If you mean the "event object" that's passed in by Ractive, it's now been superseded by the context object due to a lot of similarities https://ractive.js.org/api/#context-object
@petterek Yep, that's one strength of Ractive. It doesn't prescribe tools (loaders, routers, syntax, etc.) allowing you to mold it to any workflow.
Speaking of workflows, there is an open PR to showcase the different ways you can actually use Ractive ractivejs/ractivejs.github.io#73
Joseph
@fskreuz
Jun 29 2017 12:32
@jmkgreen The component file section is just a quick summary of the component file. A more in-depth document is found in the component spec repo https://github.com/ractivejs/component-spec
Joseph
@fskreuz
Jun 29 2017 12:39
In the spirit of keeping the conversation alive, I would like to have everyone's opinion on updating the component spect to handle ES-style script sections. ractivejs/component-spec#18 :wink:
It might be trivial (hey, just write ES and leave most of it untouched during mangling), but I might not know of edge cases on things like import paths, or tooling, etc.
Chris Reeves
@evs-chris
Jun 29 2017 12:46
that's actually why the bin takes a more hands off approach 😁
it will fill in your template and css for you, but the rest is up to you and your tooling. ES modules are strongly recommended, but not required. It could just as easily target umd. Targeting modules is a bit safer, since you can't really back into a corner with dynamic imports that tooling struggles with.
Chris Reeves
@evs-chris
Jun 29 2017 12:56
I never really considered how constrained the component spec is before. I suppose that could be both a positive and a negative
Joseph
@fskreuz
Jun 29 2017 12:57
Well, being constrained means that there's room for future expansion (as long as it's backwards compatible) :D
Also, was thinking about integrating rcu and rcu-builders into the Ractive package for front-end tooling since it ships the bin for build time. Could possibly get rid of the pesky template version mismatch error we get when updating, and one less hoop when updating tools. (i.e. instead of rvc -> rcu -> ractive, it would be just rvc -> ractive(with rcu))
Not a mono repo yet, just shipping it with Ractive but a separate lib (like the polyfill).
Chris Reeves
@evs-chris
Jun 29 2017 13:07
I'm kinda leaning toward replacing rvc/rcu with a bin-compatible loader. When I get a few spare cycles, I'm planning to add component support to the playground (multiple files, component parsing, rollup) and a button to download a project zip of what you're playing with. I haven't thought it through entirely, as including rollup in the loader is probably untenable. I don't think it would be too hard to parse out imports for umd, though.
I'm also quite biased, as I've never used cjs or amd for browsery things on purpose. Closest I've come would be the loader that ace editor uses.
Joseph
@fskreuz
Jun 29 2017 13:11
rcu can be bundled into a loader. I think rvc and ractive-load ships with rcu internally. So it acts more like a module/library than build-tool stuff.
both are runtime loaders (though rvc can be used with rjs optimizer during build).
Not that it's ideal (runtime? wassat? :smile: ) but they have their uses.
Joseph
@fskreuz
Jun 29 2017 13:17
Was poking into playground a few days ago when I saw Ace editor using amd. Was looking for an ES version of their modules so I can use Gobble and Rollup for the playground. Found nothing. :grimacing:
My Google-fu isn't strong enough. :D
Chris Reeves
@evs-chris
Jun 29 2017 13:17
check out brace
it's browserifyable ace - on npm
haven't used it yet, but I stumbled across it the other day
Joseph
@fskreuz
Jun 29 2017 13:18
ooh. nice. :thumbsup: