Fork me on GitHub
#arachne
<
2016-09-06
>
marciol19:09:11

Hei, I just saw that more one piece reached the repo, asset pipelines 🙂

luke20:09:13

Yep! Pretty happy with where they’re at (although I have no actual asset modules yet, and haven’t done docs)

luke20:09:19

But feel free to give it a look-over.

luke20:09:48

It’s backed by an immutable fileset implementation inspired by boot: https://github.com/arachne-framework/arachne-fileset

martinklepsch20:09:06

@luke what's the kind of use case for asset pipelines, is that for SASS/image processing? I haven't used an asset pipeline in ages... (favoring static builds instead of dynamic ones)

luke20:09:08

@martinklepsch This asset pipeline is for all processing of static assets (i.e, anything your server isn’t generating on the fly in response to each request.

luke20:09:34

So yes, useful for scss, coffeescript, minifying, image compression, creating thumbnails, compressing, etc, etc.

luke20:09:58

if you have an Arachne app that only contains the asset pipeline, not an HTTP server, you in fact have a static site generator 🙂

martinklepsch20:09:08

ah ok, so asset pipeline, even in arachne, is a build-time component? image compression/thumbnails sounds like something that'd be on the fly

luke20:09:07

Well it actually slots in at “startup” time, which is slightly different from build time; Arachne doesn’t really do anything during build to keep things simple. But you can “build” in a static way by having an Arachne app that starts (and processes the assets) and immediately exits.

marciol20:09:08

great, I think this work will be great for the clojure community, without doubts 🙂.

luke20:09:29

Sure, you could do compression/thumbnails at runtime too. kind of depends on what you want.

luke20:09:39

but if your inputs are static files on the file system doing them ahead of time is better

martinklepsch20:09:02

Ok, I think I understand

luke20:09:43

I couldn’t wire things into “build” time without creating a hard dependency on a particular build tool (lein vs boot) or building my own.

martinklepsch20:09:07

Well, there's an obvious choice 😄

luke20:09:26

So it just does all the “static” type things as part of its startup process. And deployment tools will be able to hook into that pretty easily to upload to CDNs or whatever.

martinklepsch20:09:34

Anyways thanks for clarifying. 👍

luke20:09:44

there will be lots more docs & stuff forthcoming too

zane20:09:45

Sounds a lot like Optimus's approach.

zane20:09:16

Re: "build time" vs "startup time".

zane20:09:48

Although Optimus does the work on the first request rather than at startup, I believe.

marciol20:09:48

It is possible to have some kind of task (I don’t know how to make this independently, in elixir we have mix tasks and in rails rake tasks) to precompile the assets statically

marciol20:09:21

so you can decouple this kind of stuff from build time, but generate as you want the static precompiled assets.

luke20:09:03

Yeah, the vocabulary is a bit different bot that’s totally doable. In Arachne you can have multiple runtimes, which load up a different set of modules/components. You’d just set up a runtime which only did static stuff and then terminated, and run that. It would effectively be the same as a “build task”.

martinklepsch20:09:06

@marciol I generate everything static using a build (boot) task and upload to S3/CloudFront

marciol20:09:56

yep, despite the different vocabulary, it is what I mean 🙂

luke20:09:30

I really like the way boot does things, but like I said didn’t want to create a hard dependency on a particular build tool, and also I wanted to keep all Arachne-related things as homogenous as possible. So your build tool of choice does a minimal amount of bootstrapping (basically just figuring out a classpath and starting a JVM) and Arachne takes it from there.

luke20:09:09

So a lot of things that are currently “build” time activities, like CLJS compilation and asset deployment, are actually first-class modules in Arachne that work like any other module.

luke20:09:19

Simplifies the programming model IMO, and everything lives together in the same config.

luke20:09:11

and then you also don’t have to do anything magic to support file watchers that rebuild your assets when an input file is changed. You just keep the asset component running, instead of letting it shut down.

martinklepsch20:09:06

I'm not yet seeing the benefits but it's early so I'll just wait until things get specific 🙂