Skip to content

Instantly share code, notes, and snippets.

@ahdinosaur
Created July 21, 2016 01:24
Show Gist options
  • Save ahdinosaur/d8be9fe93455b35f5143a526e10e1b1e to your computer and use it in GitHub Desktop.
Save ahdinosaur/d8be9fe93455b35f5143a526e10e1b1e to your computer and use it in GitHub Desktop.
chat logs from freenode #choo
20:04 < ahdinosaur> if anyone is interested in a choo-like API where it's pull-streams all the way down, i made some helpers for `inu`: https://github.com/ahdinosaur/inux
20:04 < yoshuawuyts> ahdinosaur: I'm curious: how big is inu?
20:04 < yoshuawuyts> probably smaller than choo I'd think
20:05 < yoshuawuyts> well, inux would be more fair to compare I reckon but still
20:05 < ahdinosaur> one sec, i'll discify
20:05 < yoshuawuyts> ahdinosaur: I'm using this for choo https://github.com/yoshuawuyts/choo/blob/master/scripts/instrument#L24-L35
20:06 < yoshuawuyts> gzip size tends to translate slightly better I find
20:06 < ronnross> So curious how one would use something like https://codemirror.net/ in Choo.
20:07 < ronnross> Would you work directly with the dome of use subscriptions to handle working with it.
20:07 < ronnross> Might sound like a crazy question, but when I implemented it in Elm I had to use ports and subscriptions.
20:08 < yoshuawuyts> ronnross: you built the markdown editor thingy right? - I think I'd like use the same sort of API for that
20:08 < yoshuawuyts> make it as generic as possible, and wire it up to choo with a light glue layer
20:08 < ronnross> Ok just wanted to check
20:09 < yoshuawuyts> :D
20:14 < ronnross> yoshuawuyts: Are you going to make a Choo series?
20:14 < ronnross> video series?
20:14 < ronnross> I just saw your tweet on video recording tools
20:15 < yoshuawuyts> ronnross: haha, I would if I had time - but unless there's a way to monetize it I can't afford to right now
20:15 < ronnross> Maybe Egghead?
20:16 < yoshuawuyts> ronnross: that was for something else - someone asked me to perhaps do a lil intro vid for http://opencollective.com/choo
20:16 < yoshuawuyts> and I was thinking of how to do it; but would def need some tools for that
20:17 < ronnross> Yeah screenflow is nice, but it does cost
20:18 < ronnross> Best of luck if/when you decide to do so.
20:18 -!- ronnross [~ronnross@74.83.194.146] has quit [Quit: ronnross]
20:27 < ahdinosaur> yoshuawuyts: inu: https://rawgit.com/ahdinosaur/082533385f42f1392da9c7d152334c06/raw/ec6b81561df7016b34cc9c6f48a2fac5debd1240/inu.html, inux: https://rawgit.com/ahdinosaur/082533385f42f1392da9c7d152334c06/raw/ec6b81561df7016b34cc9c6f48a2fac5debd1240/inux.html
20:28 < yoshuawuyts> ahdinosaur: ahhh, if you wanna improve file size: replacing process.nextTick with setTimeout(fn, 0) might help
20:28 < yoshuawuyts> it's what it does under the hood anyway in the browserify shim
20:30 < yoshuawuyts> oh wait, it's 13.2kb minified not gzipped
20:30 < yoshuawuyts> that's super tiny
20:30 < yoshuawuyts> choo is 15.44
20:30 < ahdinosaur> yoshuawuyts: yeah, i know, but i'm not fussed about size since it's small enuf for me
20:31 < yoshuawuyts> haha, but dogs are smaller than trains
20:31 < ahdinosaur> inux are helpers for the choo-like api, so you still need inu to make it work, but they have overlapping deps
20:32 < yoshuawuyts> ayee - is sheet-router inu or inux?
20:32 < ahdinosaur> inux
20:33 < ahdinosaur> inu: 8.38 kB, inux: 8.93 kB. if bundled separately.
20:33 < yoshuawuyts> nice!
20:33 < ahdinosaur> also includes all of `pull-stream` :)
20:33 < ahdinosaur> and `yo-yo`
20:42 < ahdinosaur> ah, with both `inu` and `inux` together (also removing `yo-yo` and using `unassertify`): 8.06 kB
20:43 < yoshuawuyts> minified right? - what about gzipped?
20:43 < ahdinosaur> that's gzipped
20:43 < yoshuawuyts> ohh, interesting
20:43 < yoshuawuyts> then where's the extra size coming from I wonder...
20:43 < ahdinosaur> pull-stream-y modules
20:43 < yoshuawuyts> but they so tiny
20:44 < yoshuawuyts> I guess yer dog is bigger than our train haha
20:44 < yoshuawuyts> still a lil pup tho
20:44 < yoshuawuyts> :D
20:46 < ahdinosaur> i'm including (all of) `pull-stream`, `pull-cat`, `pull-notify`, and `pull-many`. also a few other modules here and there that i could make smaller.
20:46 < yoshuawuyts> ahh yeah that would save a good amount I reckon
20:46 < yoshuawuyts> pull-notify too? interesting
20:46 < yoshuawuyts> what's that being used for?
20:46 < ahdinosaur> pull-notify is the engine that makes it all work
20:47 < yoshuawuyts> ahhh
20:47 < ahdinosaur> since front-end events are "push-y"
20:47 < yoshuawuyts> yeah good point
20:48 < ahdinosaur> also `pull-notify` over `pull-pushable` because sometimes many peeps want to listen to the same events
20:49 < yoshuawuyts> ahh right
20:49 < yoshuawuyts> quite like pull-pushable for a lot of other cases tho :D
20:49 < yoshuawuyts> we were having a discussion here earlier: pretty much everyone finds pull-streams hard to learn
20:50 < yoshuawuyts> myself included
20:50 < ahdinosaur> i saw, same here.
20:50 < yoshuawuyts> maybe we should like make a "10 common patterns" style article so people can at least get started
20:50 < ahdinosaur> the website (http://pull-stream.github.io) was a good start, but we need so much more.
20:50 < yoshuawuyts> pipeline, parallel, pushing, reducing, transforming and stuff
20:50 < yoshuawuyts> ahdinosaur: yeah for sure
20:51 < ahdinosaur> we need to add your knowledge on pull-streams
20:52 < ahdinosaur> also dominictarr wrote https://gist.github.com/dominictarr/fd1ab77564ef38be430468f9c293aa8c but i think hasn't published yet (so shhh, i guess?)
20:53 < ahdinosaur> so keen for more content to get started, happy to add anything to the website
20:53 < yoshuawuyts> mannn, that should just be the README
20:53 < yoshuawuyts> written two months ago soooo
20:53 < yoshuawuyts> I think having common patterns would be grand - second step would be to spruce up the readmes of all the core packages
20:54 < yoshuawuyts> cause they're quit uninformative atm
20:54 < ahdinosaur> ey, i'd love new READMEs, i just struggle to write good docs
20:54 < yoshuawuyts> also the main readme needs work
20:54 < yoshuawuyts> lolol, if you want I could like feed you a readme format and then just like apply it on all the things?
20:54 < yoshuawuyts> split up the works hah
20:55 < yoshuawuyts> cause I'm def not motivated to do it all by myself haha - too much work, and already low on time ;_;
20:55 < yoshuawuyts> not to say you've got a lot of free time - but if we split it we should be able to get it done faster :D
20:55 < ahdinosaur> i've been trying to improve one pull-stream module a week, any help on how to do it better is much appreciated
20:59 < ahdinosaur> yosh btw you're the docs god, always amazed with how good choo docs are and still have no idea how to follow that.
21:01 * yoshuawuyts blush
21:01 < yoshuawuyts> ahdinosaur: something likeee thisssss https://gist.github.com/yoshuawuyts/397fd583162030183f277d5c83df0776
21:02 < yoshuawuyts> perhaps like with an added API section to like dissect the whole API
21:02 < yoshuawuyts> denote options, edge cases and the like
21:03 < yoshuawuyts> not sure about the marbles, but they look cool so it might be cool
21:03 < yoshuawuyts> like: "yeah, we're totes legit streams and stuff"
21:03 < yoshuawuyts> though I doubt people actually read them haha
21:05 < ahdinosaur> it'd be sweet to have interactive docs a la http://rxmarbles.com/ for pull-streams.
21:05 < yoshuawuyts> hahaha, yeah for sure
21:06 < ahdinosaur> source$ and sink$ ey?
21:06 < yoshuawuyts> ayeee
21:06 < yoshuawuyts> andrey got to me
21:06 < yoshuawuyts> sinkStream -> sink$
21:06 < yoshuawuyts> which kinda reads like a plural
21:07 < yoshuawuyts> umm, it'd probably be like count$ and log$
21:07 < yoshuawuyts> or number$
21:07 < yoshuawuyts> number(stream) produces many "number"
21:07 < ahdinosaur> yeah. i've been using plurals instead. (actions -> states -> effects -> nextActions -> ...)
21:08 < yoshuawuyts> buttttt
21:08 < ahdinosaur> mostly because action$ was another wtf moment for me, but it does make sense.
21:08 < yoshuawuyts> yeah, if you've got like an array of actions that you want to convert to a stream they'd be named "arrays" and "array$" respectively
21:09 < ahdinosaur> true
21:09 < yoshuawuyts> if we add like a link to a place that explains it, we could like instruct people immediately on the naming
21:09 < ahdinosaur> yeah sweet.
21:10 < yoshuawuyts> though I've got a gut feeling dominic might be opposed to writing it this way haha
21:10 < ahdinosaur> my goal is for pull-stream to be as friendly as (or as friendly as) rxjs, which i think is better than aiming to be like node streams.
21:11 < ahdinosaur> s/as friendly as/more friendly than
21:11 < yoshuawuyts> yeah, totally agreed
21:11 < yoshuawuyts> I'm half surprised paramap isn't part of core btw - https://pull-stream.github.io/#pull-paramap
21:12 < ahdinosaur> i think it used to be
21:12 < yoshuawuyts> oh right, before my time then probs
21:12 < yoshuawuyts> 2 years ago, might've never been part
21:13 < ahdinosaur> that's one learning curve for anyone coming from node streams who might expect it to be like paramap by default
21:13 < ahdinosaur> i know that bit me way back when
21:15 < ahdinosaur> one thing we should document that always comes up, pull-streams are single use, you can't have two sinks for one source.
21:15 < yoshuawuyts> was thinking something like this as base examples? - https://gist.github.com/yoshuawuyts/fc4db5f59b9cc104049fbbe9ff1c2522
21:16 < yoshuawuyts> ahdinosaur: aye, yeah that's def worth mentioning
21:16 < yoshuawuyts> feel like the readme should layer down all the basics; provide a super solid intro
21:16 < ahdinosaur> yep, looks good. also remember https://github.com/dominictarr/pull-stream-examples/issues/2 ?
21:17 < yoshuawuyts> ahhh yeahh
21:17 < yoshuawuyts> I was up in my neck down in server land at the time haha
21:17 < yoshuawuyts> yeah I think dom nailed the order
21:18 < yoshuawuyts> but split point 5 thematically is what I'd do
21:18 < yoshuawuyts> "here's stuff for async" - "here's stuff to deal with observables" - etc.
21:19 < ahdinosaur> also https://gist.github.com/dominictarr/4832db6625112016c8c1 from a while back
21:20 < yoshuawuyts> ahh nicee
21:20 < ahdinosaur> themes make all the sense. especially if targeting actual use cases that come up, like choo docs do.
21:20 < yoshuawuyts> ayeee
21:20 < yoshuawuyts> that would be nice
21:21 < yoshuawuyts> can we like link all this stuff somewhere - feel this was productive; even if its just raw IRC logs so we don't forget
21:21 < yoshuawuyts> (3.30 am - I will forget stuff haha)
21:23 -!- ronnross [~ronnross@74.83.194.146] has joined #choo
21:23 < ahdinosaur> here's how to fetch with `xhr` and `pull-defer`, here's how to make a duplex api, here's how to return a stream of keyboard events, here's how to read files from a glob, here's how to ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment