Parens of the Dead, a Clojure + ClojureScript video series

2015-11-15 Thread Magnar Sveen
I've made a short video series on writing a game with Clojure and 
ClojureScript. The last episode is out today, so the series is complete. 
Hope you find some entertainment in it. :-)

http://www.parens-of-the-dead.com/

- Magnar


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: #{:rant} Questions about contribution policy and clojure compiler source.

2015-07-18 Thread Magnar Sveen
Linux and Linus? Github vs Jira?

Enough of these distractions.

The issue here is that brilliant people like Zach Tellman is "strongly 
disinclined to make contributions to the core Clojure implementation in the 
future". That Kyle Kingsbury, another brilliant developer, feels 
stonewalled - and even tho he loves Clojure the language and the community 
- is considering moving on. Because of the way the contribution process 
works. Or does not work, in these cases.

I think Zach summed it up nicely in his gist. I don't think the sky is 
falling in any way. But don't try to boil this down to a "patches vs pull 
request" bike shedding. It is certainly a much more important topic than 
that.

On Saturday, July 18, 2015 at 11:14:58 PM UTC+2, Luc wrote:
>
> You mentionned RedHat Linux centric type corporations. There are a lot 
> more businesses that are not Linux 
> centric business wise. They use it but provide something else on top. 
> Did you even read this article against your own statement ? :) 
>
> A huge number of occasional contributors were not reluctant to log a 
> ticket and submit a patch 
> instead of ranting about it. 
>
> This is the main point you missed. That 'entry barrier' of yours does not 
> stand with Linux. 
> I would think hard about the reasons behind these numbers. 
> There has to be some value added in the process of submitting patches. 
>
> Luc P. 
>
> On Sat, 18 Jul 2015 23:02:30 +0300 
> Bozhidar Batsov > wrote: 
>
> > On 18 July 2015 at 22:52, Luc Préfontaine 
> > > wrote: 
> > 
> > > Each linux kernel release involves hundreds of people. 
> > > Many release had above a thousand contributors. 
> > > This is for your enlightenment and are old figures: 
> > > 
> > > http://royal.pingdom.com/2012/04/16/linux-kernel-development-numbers/ 
> > > 
> > 
> > Did you even read this article? "75% – The share of all kernel 
> > development that is done by developers who are being paid for their 
> > work." This doesn't exactly contract what I said. 
> > 
> > 
> > > 
> > > There are as many people not officially hired to work for linux 
> > > operating system 
> > > focused businesses that submit patches through the ticketing system. 
> > > 
> > > As for the development lifecycle of the linux kernel: 
> > > http://www.linuxfoundation.org/content/22-lifecycle-patch 
> > > 
> > > You can read the other sections, if you find the Clojure dev. 
> > > lifecycle arcane, you will 
> > > freak at this one. 
> > > Obviously, these guys must all be old fashion outdated folks in 
> > > this era of instant 
> > > communication and snapchat like media, there's no other explanation 
> > > for such a 
> > > bureaucratic process :) 
> > > 
> > > How much pain is it to upgrade to a new Clojure version ? Nil. 
> > > How much pain is it to upgrade to a new linux kernel ? 
> > > Not nil but considering the size of this project, its ramifications 
> > > and the hardware 
> > > changing every 6 months, not big. On par with Clojure I would say. 
> > > 
> > > How much pain to upgrade to a new version of Ruby on Rails ? 
> > > Huge. I know, I have been through this a number of times. Not just 
> > > major releases, even maintenance ones are a nightmare to upgrade. 
> > > 
> > > Disclaimer: I am not saying that Rails has a bad lifecycle, I am 
> > > just stating feedback 
> > > from me and other people that actually lived this. Gee, I sound like 
> > > Mallard Fillmore... 
> > > 
> > > That's for the political correctness of this post. And to avoid 
> > > being harassed, sued, whatever. 
> > > 
> > > I would like us to compare carrots with carrots, not with apples or 
> > > strawberries but if 
> > > you insist 
> > > 
> > > To me the result is utterly important. 
> > > We deliver 24/7 software under linux using Clojure. We have up 
> > > times of more than 300 days. One upgrade a year. This is the world 
> > > that live into. 
> > > 
> > > Making it 'harder to contribute' like you state is the price to pay 
> > > for some form of 
> > > quality control. Contributing to something that eventually crumbles 
> > > because of a 
> > > lack of QA is of no value. To us all. 
> > > 
> > > Stuart has made this evaluation. Since it models by some aspect how 
> > > a successful 
> > > project like Linux is managed, I find it hard to throw a stone at 
> > > the current lifecycle. 
> > > 
> > > That may look to you as an ultra-conservative approach. Let's put 
> > > it this way, 
> > > I would use Linux and Clojure to control a nuclear plant anytime. 
> > > 
> > > I am quite certain sure I would not use Rails or Ruby for this 
> > > purpose. 
> > > 
> > 
> > As this conversation isn't really going anywhere I'll keep my 
> > thoughts to myself. 
> > 
> > 
> > > 
> > > Luc P. 
> > > 
> > > 
> > > Luc P. 
> > > 
> > > Sent from my iPad 
> > > 
> > > On Jul 18, 2015, at 14:32, Bozhidar Batsov  > 
> > > wrote: 
> > > 
> > > On 18 July 2015 at 20:18, Luc Prefontaine 
> > > > wrote: 
> > > 
> > >> Aaah ! The pull request looms again 

Re: [ANN] clj-refactor.el 1.1.0 is released

2015-07-07 Thread Magnar Sveen
Hi Tassilo. Please report this issue on our tracker!
https://github.com/clojure-emacs/clj-refactor.el/issue

On Tue, Jul 7, 2015 at 12:03 PM Tassilo Horn  wrote:

> Magnar Sveen  writes:
>
> Hi Magnar,
>
> > Since the last announcement of clj-refactor in this group, there's been a
> > flurry of activity.
>
> I've just started using it.  Especially being able to rename locals and
> clean up namespace declarations is awesome so thanks for the great work!
>
> I've sometimes encountered some quirks where it performed the
> replacement for renamed locals at slightly off positions (after
> switching to refactor-nrepl "1.2.0-SNAPSHOT" from 1.1.0 it seems to
> occur less often), though, and I frequently (after every refactoring it
> seems) I get errors about bad namespaces (although different ones than
> those where I performed the refactorings).
>
> The error messaged in emacs is this:
>
> --8<---cut here---start->8---
> error in process filter: user-error: Some namespaces are in a bad state:
>   error "Class not found: String" in funnyqt.xmltg-test;
>   error "Class not found: String" in funnyqt.tg-test;
>   error "Class not found: String" in funnyqt.coevo.tg;
>   error "Class not found: String" in funnyqt.bidi
> --8<---cut here---end--->8---
>
> I've just checked the funnyqt.xmltg-test namespace, and there's no
> single occurrence of String at all.  Is there any way to get some more
> information on what causes the hickup?  Apparently, these namespaces are
> all correct (at least they compile and the tests succeed).  So if I
> could isolate somehow the problematic stuff I'd file an issue with some
> minimal example (I guess that would go to refactor-nrepl, right?).
>
> Bye,
> Tassilo
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] clj-refactor.el 1.1.0 is released

2015-07-06 Thread Magnar Sveen


Since the last announcement of clj-refactor in this group, there's been a 
flurry of activity. Lars Andersen  and Benedek 
Fazekas  have been hard at work with the 
editor-agnostic refactor-nrepl 
 package, which was spawned 
out of clj-refactor.el. I'm happy to say that there are now refactorings in 
both Light Table  and vim 
 available based on this effort.

As for clj-refactor, the latest releases have brought a lot of new features 
- here are some highlights:

   - 
   
   *Add project dependency* gives you a list of artifacts on Clojars, lets 
   you select version and adds it to your project.clj, then hotloads the 
   dependency into your REPL. demo 
   

   - 
   
   *Add missing libspec* finds the symbol at point in your classpath, and 
   adds the proper require statement to your namespace. demo 
   

   - 
   
   *Find usages* opens a grep-like buffer with all usages of the symbol at 
   point. demo 
   
   - 
   
   *Rename symbol* renames all occurences of the symbol at point, in your 
   project. demo 
   
   - 
   
   *Clean namespace*
   - Eliminates :use clauses in favor of refer :all.
  - Sorts required libraries, imports and vectors of referred symbols
  - Raises errors if any inconsistencies are found (e.g. a libspec with 
  more than one alias).
  - Removes any duplication in the :require and :import form.
  - Removes any unused libspec vectors
  - Removes unused symbols from the :refer vector, or removes it 
  completely.
  - Removes any unused imports
  - Optionally rewrites to favor prefix form, e.g. [clojure [string 
  test]] instead of two separate libspecs demo 
  
   - 
   
   *Extract function* extracts the form at point, or the nearest enclosing 
   form, into a toplevel defn.demo 
   
   - 
   
   *Inline symbol* replaces the symbol at point with its definition. 
   Removes empty lets afterwards.demo 
   
   - 
   
   *Add stubs* adds a skeleton implementation of the protocol or interface 
   at point. demo 
   
   
And a whole bunch more. See everything clj-refactor has to offer 
.

Thanks to all the contributors, and especially to Lars and Ben!

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ring - setting no-cache for everything?

2015-06-20 Thread Magnar Sveen
Sounds like your URLs could use some cache busting. :) Then you can add far 
future Expires headers, with no worries that users are seeing stale files. 
Optimus is one way to inject some front-end performance in your 
Ring-app. https://github.com/magnars/optimus

On Friday, June 19, 2015 at 11:00:57 AM UTC+2, Colin Yates wrote:
>
> Hi all, is there a quick way to disable caching for everything or 
> alternatively hash based on the contents of the resource. I am talking 
> specifically about CSS and javascript issues served from the JAR's class 
> path?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ANN: org.clojure/tools.namespace "0.2.11"

2015-06-20 Thread Magnar Sveen
Thanks! Have been waiting for this. Working with .cljc-files is quite nice 
after these changes. :)

On Friday, June 19, 2015 at 9:46:08 PM UTC+2, Stuart Sierra wrote:
>
> tools.namespace: parse namespace declarations and reload
> files in dependency order.
>
> https://github.com/clojure/tools.namespace
>
> Release 0.2.11 contains the following changes:
>
>   * [TNS-34] Support for reader conditionals
>
> tools.namespace still works only in Clojure(JVM), not
> ClojureScript. But it is now able to parse both .clj files
> and .cljc source files containing reader conditionals.
>
> This release of tools.namespace remains backwards-compatible
> with older versions of Clojure back to 1.3.0.
>
>
> Leiningen dependency information:
> [org.clojure/tools.namespace "0.2.11"]
>
> This is a Clojure-contrib project,
> http://dev.clojure.org/display/doc/Clojure+Contrib
>
> [TNS-34]: http://dev.clojure.org/jira/browse/TNS-34
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.7.0-RC2

2015-06-20 Thread Magnar Sveen
Tested RC2 in a project with a lot of .cljc going on - seems to be working 
fine.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ANN: Prone - better exception reporting middleware for Ring

2014-12-07 Thread Magnar Sveen


Better exception reporting middleware for Ring. Heavily inspired by 
better_errors 
for Rails .

See it to believe it: a quick video demoing Prone 
.

Prone presents your stack traces in a consumable form. It filters out stack 
frames that did not originate in your application, allowing you to focus on 
your code. It allows you to browse environment data, such as the request 
map and exception data (when using ex-info). Prone also provides a debug 
function that enables you to visually browse local bindings and any piece 
of data you pass to debug.



Check it out: https://github.com/magnars/prone


Any feedback welcome. :-)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Stasis - not another static site framework

2014-03-09 Thread Magnar Sveen
Hi Jarrod,

Sounds to me like you're using harpjs mainly as an asset pipeline 
replacement? Stasis doesn't care about Jade, LESS or any such thing - 
because that is covered by other libraries that you would use along with 
it. Stasis is only concerned with 1) serving your pages live in 
development, and then 2) exporting them to disk. All sites using Stasis 
that I know 
of<https://github.com/magnars/stasis#are-there-any-full-fledged-examples-to-look-at>use
 
Optimus <https://github.com/magnars/optimus> for its frontend optimization. 
It has a LESS asset loader <https://github.com/magnars/optimus-less>, but 
no one has made one for Jade. I would guess you could use 
Twixt<https://github.com/AvisoNovate/twixt>instead, which comes bundled with 
support for both Jade and LESS.

But again - if you're using harpjs mainly for its compilation, Stasis isn't 
a good fit. You could probably use Twixt directly instead, and do your 
compilation in the same process that is serving your web pages.

- Magnar

On Wednesday, March 5, 2014 1:08:06 AM UTC+1, Jarrod Swart wrote:
>
> This is a cool project.  I primarily use static site generators to build 
> the front-end for sites that I will use enlive to template inside my app.
>
> I currently use: http://harpjs.com for this purpose because it allows 
> easy integration of LESS and Jade which are auto recompiled & watched by 
> the dev server.  
>
> This allows minimal html/css/js to be handwritten then it gets compiled to 
> the static site, from there I use only enlive for templating.  All in all 
> it is a very fast way to create the front-end templates for web apps.
>
> How does stasis compare to this?  Could I replicate it?  Or is this just 
> too far from the intended workflow of Stasis?
>
>
> On Monday, March 3, 2014 4:51:02 PM UTC-5, Magnar Sveen wrote:
>>
>> Just a heads up that Stasis 1.0.0 has been released. The API has been 
>> stable for two months now. I've built three sites with it, and I know of 
>> two other sites built with Stasis too: 
>>
>>- The docs for SinonJS: http://sinonjs.org/ 
>>- J David Smith's blog at http://atlanis.net/blog/ 
>>
>> He even wrote a blog post about it here: 
>> http://atlanis.net/blog/posts/new-site-stasis.html
>>
>> So if you were on the fence because of the 0.x release, worry no more. :) 
>> Building a static site is an excellent way to have fun with Clojure, and 
>> get a lightning fast web site that can handle any amount of traffic.
>>
>> - Magnar
>>
>> On Thursday, January 23, 2014 11:16:48 AM UTC+1, Magnar Sveen wrote:
>>>
>>> Stasis
>>>
>>> A Clojure library of tools for developing static web sites.
>>>
>>> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#another-static-site-framework-why>Another
>>>  
>>> static site framework? Why?
>>>
>>> Well, that's exactly it. I didn't want to use a framework. I don't like 
>>> the restrained feeling I get when using them. I prefer coding things over 
>>> messing around with configuration files.
>>>
>>> I want to
>>>
>>>- code my own pages
>>>- set up my own configuration
>>>- choose my own templating library
>>>- create my own damn stylesheets
>>>
>>> *Statis offers a few functions that are pretty useful when creating 
>>> static web sites.*
>>>
>>> No more. There are no batteries included.
>>>
>>> If you want a framework that makes it really quick and easy to create a 
>>> blog, you should take a look at these:
>>>
>>>- misaki <https://github.com/liquidz/misaki> is a Jekyll inspired 
>>>static site generator in Clojure.
>>>- Madness <http://algernon.github.io/madness/> is a static site 
>>>generator, based on Enlive and Bootstrap.
>>>- Static <http://nakkaya.com/static.html> is a simple static site 
>>>generator written in Clojure.
>>>- Ecstatic <http://samrat.me/ecstatic/> creates static web pages and 
>>>blog posts from Hiccup templates and Markdown.
>>>- incise <https://github.com/RyanMcG/incise> is an extensible static 
>>>site generator written in Clojure.
>>>
>>> They generally come with a folder where you put your blog posts in some 
>>> templating language, and a set of configuration options about how to set up 
>>> your blog. They often generate code for you to tweak.
>>> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#usage>Usage
>>>
>

Re: paredit+regex question

2014-03-03 Thread Magnar Sveen
I found this particularly annoying myself, and turned it off. You can see the 
code in my emacs 
config
.

If you don't want to mess around with how paredit works, you can always 
insert any character with C-q 

- Magnar

On Monday, March 3, 2014 10:09:47 PM UTC+1, Erlis Vidal wrote:
>
> Hi this is not a clojure question but I'm sure some one on this list can 
> help me. 
>
> I'm trying to write a regex using paredit and it looks like I cannot write 
> something like this 
>
> #"mypattern \d"
>
> whenever I type the character \ I see the text "Escaping character..." in 
> the minibuffer. It is waiting for another character and then it uses the 
> two characters as a single one, so I cannot delete only one, they are 
> together.
>
> I see how this can be useful for strings, but for regex this is not 
> helping. 
>
> I end up writing my regex like (re-pattern "mypattern \\d") instead of 
> using the short syntax. 
>
> Any idea how can I write the short syntax using paredit? 
>
> Thanks, 
> Erlis 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Stasis - not another static site framework

2014-03-03 Thread Magnar Sveen
Just a heads up that Stasis 1.0.0 has been released. The API has been 
stable for two months now. I've built three sites with it, and I know of 
two other sites built with Stasis too: 

   - The docs for SinonJS: http://sinonjs.org/ 
   - J David Smith's blog at http://atlanis.net/blog/ 

He even wrote a blog post about it 
here: http://atlanis.net/blog/posts/new-site-stasis.html

So if you were on the fence because of the 0.x release, worry no more. :) 
Building a static site is an excellent way to have fun with Clojure, and 
get a lightning fast web site that can handle any amount of traffic.

- Magnar

On Thursday, January 23, 2014 11:16:48 AM UTC+1, Magnar Sveen wrote:
>
> Stasis
>
> A Clojure library of tools for developing static web sites.
>
> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#another-static-site-framework-why>Another
>  
> static site framework? Why?
>
> Well, that's exactly it. I didn't want to use a framework. I don't like 
> the restrained feeling I get when using them. I prefer coding things over 
> messing around with configuration files.
>
> I want to
>
>- code my own pages
>- set up my own configuration
>- choose my own templating library
>- create my own damn stylesheets
>
> *Statis offers a few functions that are pretty useful when creating static 
> web sites.*
>
> No more. There are no batteries included.
>
> If you want a framework that makes it really quick and easy to create a 
> blog, you should take a look at these:
>
>- misaki <https://github.com/liquidz/misaki> is a Jekyll inspired 
>static site generator in Clojure.
>- Madness <http://algernon.github.io/madness/> is a static site 
>generator, based on Enlive and Bootstrap.
>- Static <http://nakkaya.com/static.html> is a simple static site 
>generator written in Clojure.
>- Ecstatic <http://samrat.me/ecstatic/> creates static web pages and 
>blog posts from Hiccup templates and Markdown.
>- incise <https://github.com/RyanMcG/incise> is an extensible static 
>site generator written in Clojure.
>
> They generally come with a folder where you put your blog posts in some 
> templating language, and a set of configuration options about how to set up 
> your blog. They often generate code for you to tweak.
> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#usage>Usage
>
> The core of Stasis is two functions: serve-pages and export-pages. Both 
> take a map from path to contents:
>
> (def pages {"/index.html" "Welcome!"})
>
> The basic use case is to serve these live on a local server while 
> developing - and then exporting them as static pages to deploy on some 
> server.
>
> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#serving-live-pages-locally>Serving
>  
> live pages locally
>
> Stasis can create a Ring handler to serve your pages.
>
> (ns example
>   (:require [stasis.core :as stasis]))
> (def app (stasis/serve-pages pages))
>
> Like with any Ring app, you point to your app in project.clj:
>
> :ring {:handler example/app}
>
> and start it with lein ring server-headless.
> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#exporting-the-pages>Exporting
>  
> the pages
>
> To export, just give Stasis some pages and a target directory:
>
> (defn export []
>   (stasis/export-pages pages target-dir))
>
> When you've got this function, you can create an alias for leiningen:
>
> :aliases {"build-site" ["run" "-m" "example/export"]}
>
> and run lein build-site on the command line. No need for a lein plugin.
> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#example-apps>Example 
> apps?
>
> The static page that prompted me to write Stasis is currently closed 
> source, but I'm in the process of turning my 4 other static sites over. The 
> simplest, and first to be done, is:
>
>- 
>
>whattheemacsd.com (source) <https://github.com/magnars/what-the-emacsd>
>
>Uses Enlive <https://github.com/cgrand/enlive> for templating, and 
>Optimus <https://github.com/magnars/optimus> for frontend optimization.
>
> I'm also working on the Emacs Rocks! <http://emacsrocks.com/> webpage, 
> where I'll use hiccup instead of Enlive.
> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#is-it-stable>Is it 
> stable?
>
> It's still on a 0.x release, but I feel the API has jelled enough now to 
> open source it. I don't expect any major changes at this point. I'll likely 
> push it to 1.0 at the end of the month.
>
> 

Re: [ANN] clj-refactor.el 0.10.0

2014-02-01 Thread Magnar Sveen
Sorry, mate. It's not about cornering the market in clojure refactorings - 
it's just scratching our own itch, and hopefully other people find it 
useful too.

I'm a little surprised Light Table doesn't offer these things already. 
Isn't it a Clojure-centric editor?

On Saturday, February 1, 2014 8:22:53 PM UTC+1, adrians wrote:
>
> Really cool stuff, guys. Are you considering a Light Table version as well?
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Stasis - not another static site framework

2014-01-23 Thread Magnar Sveen

>
> Very minimalist. I appreciate that.
>

Thank you :-) And let me say that out of the five frameworks, I think 
Incise is the most exciting - with its focus on extensibility.

This makes sharing implementations easier. The stasis way to do this is for 
> everyone to write it and integrate themselves.  Often the later is more fun 
> and offers a bit more control, but the former is easier.
>

Agreed. Now, I prefer control and fun over ease - but that might be a bad 
choice in many situations.

My feeling is that both Stasis and Incise have their place, and can live 
happily alongside each other. Maybe Incise could even use Stasis as a lib 
to build its more elaborate features on top of?

- Magnar

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Stasis - not another static site framework

2014-01-23 Thread Magnar Sveen
Oh, look at that. Thanks! :)


On Thu, Jan 23, 2014 at 11:27 AM, Dmitry Groshev wrote:

> And here is a link to the project, just in case you've missed it like I
> did: https://github.com/magnars/stasis :)
>
>
> On Thursday, January 23, 2014 2:16:48 PM UTC+4, Magnar Sveen wrote:
>>
>> Stasis
>>
>> A Clojure library of tools for developing static web sites.
>> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#another-static-site-framework-why>Another
>> static site framework? Why?
>>
>> Well, that's exactly it. I didn't want to use a framework. I don't like
>> the restrained feeling I get when using them. I prefer coding things over
>> messing around with configuration files.
>>
>> I want to
>>
>>- code my own pages
>>- set up my own configuration
>>- choose my own templating library
>>- create my own damn stylesheets
>>
>> *Statis offers a few functions that are pretty useful when creating
>> static web sites.*
>>
>> No more. There are no batteries included.
>>
>> If you want a framework that makes it really quick and easy to create a
>> blog, you should take a look at these:
>>
>>- misaki <https://github.com/liquidz/misaki> is a Jekyll inspired
>>static site generator in Clojure.
>>- Madness <http://algernon.github.io/madness/> is a static site
>>generator, based on Enlive and Bootstrap.
>>- Static <http://nakkaya.com/static.html> is a simple static site
>>generator written in Clojure.
>>- Ecstatic <http://samrat.me/ecstatic/> creates static web pages and
>>blog posts from Hiccup templates and Markdown.
>>- incise <https://github.com/RyanMcG/incise> is an extensible static
>>site generator written in Clojure.
>>
>> They generally come with a folder where you put your blog posts in some
>> templating language, and a set of configuration options about how to set up
>> your blog. They often generate code for you to tweak.
>>  <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#usage>Usage
>>
>> The core of Stasis is two functions: serve-pages and export-pages. Both
>> take a map from path to contents:
>>
>> (def pages {"/index.html" "Welcome!"})
>>
>> The basic use case is to serve these live on a local server while
>> developing - and then exporting them as static pages to deploy on some
>> server.
>> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#serving-live-pages-locally>Serving
>> live pages locally
>>
>> Stasis can create a Ring handler to serve your pages.
>>
>> (ns example
>>   (:require [stasis.core :as stasis]))
>> (def app (stasis/serve-pages pages))
>>
>> Like with any Ring app, you point to your app in project.clj:
>>
>> :ring {:handler example/app}
>>
>> and start it with lein ring server-headless.
>> <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#exporting-the-pages>Exporting
>> the pages
>>
>> To export, just give Stasis some pages and a target directory:
>>
>> (defn export []
>>   (stasis/export-pages pages target-dir))
>>
>> When you've got this function, you can create an alias for leiningen:
>>
>> :aliases {"build-site" ["run" "-m" "example/export"]}
>>
>> and run lein build-site on the command line. No need for a lein plugin.
>>  <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#example-apps>Example
>> apps?
>>
>> The static page that prompted me to write Stasis is currently closed
>> source, but I'm in the process of turning my 4 other static sites over. The
>> simplest, and first to be done, is:
>>
>>-
>>
>>whattheemacsd.com (source)<https://github.com/magnars/what-the-emacsd>
>>
>>Uses Enlive <https://github.com/cgrand/enlive> for templating, and
>>Optimus <https://github.com/magnars/optimus> for frontend
>>optimization.
>>
>> I'm also working on the Emacs Rocks! <http://emacsrocks.com/> webpage,
>> where I'll use hiccup instead of Enlive.
>>  <https://gist.github.com/magnars/32dbca91bdb0987ea4ba#is-it-stable>Is
>> it stable?
>>
>> It's still on a 0.x release, but I feel the API has jelled enough now to
>> open source it. I don't expect any major changes at this point. I'll likely
>> push it to 1.0 at the end of the month.
>>
>> <https://gist.github.com/magnars/3

[ANN] Stasis - not another static site framework

2014-01-23 Thread Magnar Sveen
Stasis

A Clojure library of tools for developing static web sites.
Another
 
static site framework? Why?

Well, that's exactly it. I didn't want to use a framework. I don't like the 
restrained feeling I get when using them. I prefer coding things over 
messing around with configuration files.

I want to

   - code my own pages
   - set up my own configuration
   - choose my own templating library
   - create my own damn stylesheets

*Statis offers a few functions that are pretty useful when creating static 
web sites.*

No more. There are no batteries included.

If you want a framework that makes it really quick and easy to create a 
blog, you should take a look at these:

   - misaki  is a Jekyll inspired static 
   site generator in Clojure.
   - Madness  is a static site 
   generator, based on Enlive and Bootstrap.
   - Static  is a simple static site 
   generator written in Clojure.
   - Ecstatic  creates static web pages and 
   blog posts from Hiccup templates and Markdown.
   - incise  is an extensible static 
   site generator written in Clojure.

They generally come with a folder where you put your blog posts in some 
templating language, and a set of configuration options about how to set up 
your blog. They often generate code for you to tweak.
Usage

The core of Stasis is two functions: serve-pages and export-pages. Both 
take a map from path to contents:

(def pages {"/index.html" "Welcome!"})

The basic use case is to serve these live on a local server while 
developing - and then exporting them as static pages to deploy on some 
server.
Serving
 
live pages locally

Stasis can create a Ring handler to serve your pages.

(ns example
  (:require [stasis.core :as stasis]))
(def app (stasis/serve-pages pages))

Like with any Ring app, you point to your app in project.clj:

:ring {:handler example/app}

and start it with lein ring server-headless.
Exporting
 
the pages

To export, just give Stasis some pages and a target directory:

(defn export []
  (stasis/export-pages pages target-dir))

When you've got this function, you can create an alias for leiningen:

:aliases {"build-site" ["run" "-m" "example/export"]}

and run lein build-site on the command line. No need for a lein plugin.
Example 
apps?

The static page that prompted me to write Stasis is currently closed 
source, but I'm in the process of turning my 4 other static sites over. The 
simplest, and first to be done, is:

   - 
   
   whattheemacsd.com (source) 
   
   Uses Enlive  for templating, and 
   Optimus  for frontend optimization.
   
I'm also working on the Emacs Rocks!  webpage, 
where I'll use hiccup instead of Enlive.
Is it 
stable?

It's still on a 0.x release, but I feel the API has jelled enough now to 
open source it. I don't expect any major changes at this point. I'll likely 
push it to 1.0 at the end of the month.
Again,
 
why not use one of the existing frameworks?

I think the existing frameworks are great if they fit your style. Stasis 
imposes no styles. There are very few decisions made for you - no markdown 
vs asciidoc, no enlive vs hiccup. No configuration options. You have to 
make them.

So, yeah ... I think Stasis would be a great starting point if you want to 
create the 6th static site framework to go in that list at the top. :-)


- Magnar

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN - New podcast Functional Geekery

2014-01-07 Thread Magnar Sveen
Excellent! Downloading as I type. 

 - Magnar

> Den 8. jan. 2014 kl. 03:23 skrev Steven Proctor :
> 
> The feed is live in iTunes for those who were wanting to subscribe there.  
> https://itunes.apple.com/us/podcast/functional-geekery/id790455326?mt=2&ign-mpt=uo%3D4
> 
> Thanks,
> --Proctor
> 
>> On Wednesday, January 1, 2014 7:08:06 PM UTC-6, Steven Proctor wrote:
>> I am doing a new podcast Functional Geekery, with the goal to cover topics 
>> across multiple languages, Clojure included.  I am announcing it here, as 
>> Clojure was the language that got me to dig deeper into functional 
>> programming.
>> 
>> The site can be found here: http://www.functionalgeekery.com/ and the first 
>> episode is posted.  I am working on getting the feed in iTunes and the Zune 
>> Music Marketplace, but it should be in those soon.
>> 
>> If you have any suggestions or topics for the show, I would love to hear you 
>> feedback.
>> 
>> Thanks!
>> --Proctor
> 
> -- 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Clojure" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/clojure/aaFoQeR7_F8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Optimus asset loaders and transformations

2014-01-02 Thread Magnar Sveen


Like many others, I am quite enthused about 
React.JS these 
days. I'm looking at 
Om too, 
but would like to learn React first.

If you're interested in using 
JSX with 
your React, then I've created a custom asset loader for Optimus to handle
.jsx files: optimus-jsx .

Enjoy. :-)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] clj-refactor.el - A few Clojure refactorings for Emacs.

2014-01-02 Thread Magnar Sveen
Thanks mate, I'm glad to hear that. And thanks for your contributions too!

Your post reminded me that renaming has an annoying bug - it suggests 
replacing substrings of namespaces too. So I fixed that just now. :-)

- Magnar

On Monday, December 30, 2013 6:30:49 PM UTC+1, Alex Baranosky wrote:
>
> Hi Magnar,
>
> I've been using this library for maybe a month.  The refactorings I use by 
> far the most are renaming files, and threading/unthreading. Thanks for your 
> work on this. 
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: ANN - New podcast Functional Geekery

2014-01-01 Thread Magnar Sveen
Looks great! Please post here when the feed is available in iTunes.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] clj-refactor.el - A few Clojure refactorings for Emacs.

2013-12-30 Thread Magnar Sveen


clj-refactor.el  provides a set 
of simple refactorings for Clojure in Emacs. It doesn't tackle the hard 
problems, like cross-namespace renaming. Instead it gives you a little 
quality of life while we're waiting.
Thread 
/ unwind

Given this:

(map square (filter even? [1 2 3 4 5]))

Start by wrapping it in a threading macro:

(->> (map square (filter even? [1 2 3 4 5])))

And start threading away, using cljr-thread:

(->> (filter even? [1 2 3 4 5])
 (map square))

And again:

(->> [1 2 3 4 5]
 (filter even?)
 (map square))

To revert this, there's cljr-unwind. Just read the examples in the other 
direction.
Introduce
 
/ expand let

Given this:

(defn handle-request
  {:status 200
   :body (find-body abc)})

With the cursor in front of (find-body abc), I do cljr-introduce-let:

(defn handle-request
  {:status 200
   :body (let [X (find-body abc)]
   X)})

Now I have two cursors where the Xes are. Just type out the name, and press 
enter. Of course, that's not where I wanted the let statement. So I do 
cljr-expand-let:

(defn handle-request
  (let [body (find-body abc)]
{:status 200
 :body body}))

Yay.
Automatic
 
insertion of namespace declaration

When you open a blank .clj-file, clj-refactor inserts the namespace 
declaration for you.

It will also add the relevant :use clauses in test files, normally using 
clojure.test, but if you're depending on midje in your project.clj it uses 
that instead.
More stuff
   
   - When you rename a file, it will update the ns-declaration and then 
   query-replace new ns in project.
   - You can add :require and :import to the ns, and when you're done it 
   jumps back to where you were.

In summary

This isn't the big refactoring lib that we're all waiting for. That would 
require connecting to nREPL, analyzing ASTs, expanding macros, and a whole 
lot of other problems.

Instead it adds a few helpful functions that are available right now.

And if you want to contribute, and maybe grow this into the refactorer's 
dream - do let me know. I'm all for that. :-)

- Magnar

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Optimus asset loaders and transformations

2013-12-30 Thread Magnar Sveen
Oh, if you checked out Optimus when I first announced it, here are some 
improvements since then:

   - Split strategies and optimizations so they can vary independently.
   - Add support for :base-path on assets for CDNs.
   - Add exporting of assets to disk. Also for CDNs.
   - Move Angular.JS features into its own 
project
   .
   - Create extension point for asset loading.
   - Add Last-Modified headers.

I remember someone asking about how Optimus interacts with other Ring 
middleware, in particular the wrap-not-modified middleware. Now that 
Optimus servers Last-Modified headers, that works very well. Just add (
ring.middleware.not-modified/wrap-not-modified) after (optimus/wrap) and 
you're serving 304 responses like a pro. :-)

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] Optimus asset loaders and transformations

2013-12-30 Thread Magnar Sveen


Optimus  is a Ring middleware for 
frontend performance optimization.

In order to do its optimization, it needs to rest on a first-class asset 
concept in the Ring stack. So the most basic operation of Optimus is 
serving assets from a list, with this minimal structure:

[{:path :contents}]

It serves the :contents if the request :uri matches :path.

Built on top of that is a bunch of operations that either help you:

   - Load assets to put in the list
   - Optimize the assets in the list somehow
   - Decide how you want to serve the assets
   - Link to the assets

For instance, transformations that change :path also set :original-path so 
that the linking functions can refer to a known name.

So, Optimus is a replacement for compojure.route/resources, that includes a 
separate middleware stack for asset transformations.

I'm announcing optimus-less  and 
optimus-angular  which both 
show some interesting ways to extend Optimus.
Optimus 
LESS

Even tho Optimus itself doesn't do transpiling, building a transpiler to 
use with Optimus is pretty nice. I created 
optimus-less as 
an example implementation.

Optimus LESS declares load-less-asset as a custom loader for .less files 
with Optimus' load-assetmultimethod. This is in turn used by load-assets, 
load-bundle and load-bundles - so everything works like before, but now it 
also supports LESS files. Score!

It's about 20 lines of 
code,
 
including requires. And adding support for more transpilers require no 
changes to Optimus itself.
Optimus 
Angular

This project offers two distinct features. It helps you:

   - Prepopulate the Angular.JS template cache.
   - Prepare JavaScript for minification with 
ngmin
   .

Prepopulating
 
the Angular.JS template cache

optimus-angular/create-template-cache is a custom Optimus asset loader. It 
creates a virtual JavaScript asset that populates the Angular.JS template 
cache with your given templates.
Preparing
 
JavaScript for minification

When minifying JavaScript, local variable names are changed to be just one 
letter. This reduces file size, but disrupts some libraries that use clever 
reflection tricks - like Angular.JS.

By transforming your assets with optimus-angular/prepare-for-minification, 
these reflection tricks are replaced by an alternate syntax that still 
functions after mangling of local names.
In summary

Hopefully these examples show how Optimus is open for extension. So while 
the core of Optimus is frontend optimization, the introduction of first 
class assets open up new possibilities.

If you use Optimus or want to get started, please do let me know. I'm happy 
to address any relevant issues. My goal is for Optimus to be a really solid 
piece of software.

Thanks,

- Magnar

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Optimus - a Ring middleware for frontend performance optimization.

2013-11-27 Thread Magnar Sveen

On Wednesday, November 27, 2013 1:08:34 PM UTC+1, Stefan Kamphausen wrote:
 

> Howard has quite some experience with this and I'd expect he put a great 
> deal of that into the new library. :-)
>
 
Indeed. There's certainly a lot of care that's been put into the features 
that are in Twixt now. :-)

- Magnar

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Optimus - a Ring middleware for frontend performance optimization.

2013-11-27 Thread Magnar Sveen
I think it would be best if the author chimed in, but it looks like there 
has been done some good work on optimizing the development workflow when 
you're working with languages that need to be transpiled. There isn't much 
front-end optimization, but looks like it's on the todo-list. There's also 
the slightly misguided inclusion of gzip at this point in the stack. You 
want gzip for all your text content - including dynamically generated html 
and json - so adding it to the static assets here would either be not 
enough, or redundant work.

On Tuesday, November 26, 2013 1:34:35 PM UTC+1, Stefan Kamphausen wrote:
>
> Hi,
>
> I'd be very interested in learning, how Twixt[1] compares to Optimus and 
> the other solutions cited.
>
> [1] https://github.com/AvisoNovate/twixt/
>
>
> Regards,
> stefan
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Optimus - a Ring middleware for frontend performance optimization.

2013-11-26 Thread Magnar Sveen
 It 
> also has :dev and :prod modes (though these mean "dont minify" and "do 
> minify". It does split out the functions in a slightly composable way (you 
> can have `(wrap-lesscss-processor loader :mode :dev)`), but those still use 
> :mode.
>
> Stefon supports: concatenating JS and CSS, compiling less, coffeescript, 
> hamlcoffee, minification using Closure compiler (currently broken), some 
> trivial css minification, cache-busting and expiry headers, and asset 
> references (eg data-uri to put the contents of one asset in another). It 
> also supports caching compilation and clj-v8 for speed, and expiration 
> headers and cache busting. It has precompilation for production use with a 
> CDN).
>
> Dieter is basically like stefon, but older and less maintained, and some 
> different choices around precompilation.
>
> Optimus supports concatenating, minification, cache busting, expiry 
> headers, and something angular specific. Also assets dont have to be files 
> on disk, and a there's a list of a dozen or so other features that contrast 
> it to stefon or cornet in a neutral way (neither decision is right or 
> wrong, just different).
>
> So basically stefon supports all high level use cases, optimus support all 
> of them except compilation, cornet supports most of it but not cache 
> busting. But where we do support the same things, we do it in many 
> different ways.
>
> So my problem here is that we've each chosen to couple everything 
> together. If you want to use stefon's CDN feature in production, with 
> optimus' dev asset serving, with cornet's minification, you're out of luck.
>
> Weavejester made a critique of stefon on reddit [1] a while back. He made 
> the point "why isn't this just middleware", by which I believe he means 
> "why cant this all be split up into composable functions?"
>
> He's right. We should, IMO, stop doing what we're doing, and rebuild our 
> projects into a set of composable components that play well together:
>
> - a choice of caching middlewares
> - a choice of minifying middlewares
> - a choice of asset compilers (including different versions and 
> implementations) (also some way for them to interact to support a pipeline)
> - a choice of precompilation/CDN and compiling on the server
> - composable optimizations (caching compilations)
> - a choice of how to concatenate assets
>
> I don't really know how to do this though, just that they should be 
> different libraries, and that all orthogonal feature sets should be 
> composable. I'd love to hear people's thoughts on how we can accomplish 
> this.
>
> [1] 
> http://www.reddit.com/r/Clojure/comments/1n1n0p/circlecistefon_asset_pipeline_for_clojure_closely/ccexi3a<http://www.google.com/url?q=http%3A%2F%2Fwww.reddit.com%2Fr%2FClojure%2Fcomments%2F1n1n0p%2Fcirclecistefon_asset_pipeline_for_clojure_closely%2Fccexi3a&sa=D&sntz=1&usg=AFQjCNFC5zUvXm1s4TP_BrpeCbz3Sz2ucQ>
>
> On Monday, 25 November 2013 11:10:54 UTC-8, Magnar Sveen wrote:
>>
>> Hi Jason! 
>>
>> Magnar, could you talk a little about how your project is better 
>>> than/different from Stefon/dieter and cornet? I feel like we have a lot of 
>>> these projects now, all doing mostly the same thing.
>>>
>>
>> Thanks for asking. I'll try to shed some light on the differences as I 
>> see them, and hopefully the people behind Dieter/Stefon (they're very 
>> similar) can add some details into their thinking. I haven't seen Comet, 
>> and google didn't help much either. Can you share a link?
>>
>> As for Optimus vs Stefon: First of all it's a difference in focus. Stefon 
>> focuses on being an asset pipeline modelled after Sprockets in Rails. It 
>> lets you write LESS, CoffeeScript, Haml - turning it into CSS and 
>> JavaScript. Optimus is not about transpiling from other languages, but 
>> about frontend optimization. As such, it rewrites your urls to include 
>> cache busters and serves your assets with far-future expires headers, so 
>> they can be cached aggressively in production. As I add more features to 
>> optimus, they too will focus around better frontend performance - and not 
>> more languages to be transpiled.
>>
>> While this is the main point in my mind, there are also other differences 
>> that aren't just details that everyone will agree on. :-) These two come to 
>> mind:
>>
>> 1. Stefon serves assets live in development, but requires a build step in 
>> production to precompile the files. Optimus does not require a build step, 
>> but compiles your asset wh

Re: [ANN] Optimus - a Ring middleware for frontend performance optimization.

2013-11-25 Thread Magnar Sveen
Thanks for the link to cornet. Must be the kerning on my font, since I read 
comet. :-) I'll definitely check it out. At first glance it looks like a 
replacement for Dieter/Stefon, more focused on transpiling than 
optimization. I can't see any mention of it tackling problems like cache 
busting, and the issues that come with it. For instance how the cache 
busters on CSS files need to be a cascade of the assets they link to.

As for basic ring middlewares, I try not to reimplement them. So you would 
use wrap-content-type, for instance. As for wrap-not-modified, that's an 
interesting thought - especially since we know the asset hasn't changed, or 
it would be under another name. I'll have to look into that further. Nice 
tip, thanks.

- Magnar

On Monday, November 25, 2013 10:56:33 PM UTC+1, Jason Bennett wrote:
>
> Ok, thanks for the reply. Cornet is at 
> https://github.com/cosmi/cornet<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fcosmi%2Fcornet&sa=D&sntz=1&usg=AFQjCNGTDwnsbtlpY6VpnA2Xpg3UKB19Sg>,
>  
> it's similar to stefon.
>
> I believe there are some existing middlewares for ring that do similar 
> things (like wrap-not-modified). Do you replace this or work with it?
>
> jason
>
> On Monday, November 25, 2013 11:10:54 AM UTC-8, Magnar Sveen wrote:
>>
>> Hi Jason! 
>>
>> Magnar, could you talk a little about how your project is better 
>>> than/different from Stefon/dieter and cornet? I feel like we have a lot of 
>>> these projects now, all doing mostly the same thing.
>>>
>>
>> Thanks for asking. I'll try to shed some light on the differences as I 
>> see them, and hopefully the people behind Dieter/Stefon (they're very 
>> similar) can add some details into their thinking. I haven't seen Comet, 
>> and google didn't help much either. Can you share a link?
>>
>> As for Optimus vs Stefon: First of all it's a difference in focus. Stefon 
>> focuses on being an asset pipeline modelled after Sprockets in Rails. It 
>> lets you write LESS, CoffeeScript, Haml - turning it into CSS and 
>> JavaScript. Optimus is not about transpiling from other languages, but 
>> about frontend optimization. As such, it rewrites your urls to include 
>> cache busters and serves your assets with far-future expires headers, so 
>> they can be cached aggressively in production. As I add more features to 
>> optimus, they too will focus around better frontend performance - and not 
>> more languages to be transpiled.
>>
>> While this is the main point in my mind, there are also other differences 
>> that aren't just details that everyone will agree on. :-) These two come to 
>> mind:
>>
>> 1. Stefon serves assets live in development, but requires a build step in 
>> production to precompile the files. Optimus does not require a build step, 
>> but compiles your asset when the server starts. 
>>
>> 2. Stefon creates bundles by having custom .stefon files with 
>> edn-flavored lists of files in your directories of static assets. Optimus 
>> also needs a list of bundles, but does so using Clojure in your program. I 
>> would think that Stefons' approach is better if your frontend developers 
>> are not comfortable editing the Clojure code, while Optimus' approach 
>> allows more programatic control.
>>
>> I hope I haven't misrepresented Stefon in any way - these are my 
>> impressions. Since I'm a front-end optimization nut, these arguments were 
>> enough to sway me to create a different package. It would be several major 
>> breaking changes to Dieter and Stefon's architectures and APIs, and I 
>> didn't think I would get anywhere fighting for these changes in github 
>> issues.
>>
>>  
>>
>>> I also don't totally understand why they're all done as Ring middleware 
>>> instead of lein/maven plugins. Maybe this is my Java background talking, 
>>> but that seems to me to be the logical place to put this sort of thing.
>>>
>>
>> Front-end development with a compilation step is pretty horrible. There's 
>> also the case that the URL to a static asset and its location on disk is 
>> entirely different after optimization.
>>
>> Hope that answers your questions somewhat decently. And if it didn't, 
>> maybe you'll be swayed by the argument that a little competition is a good 
>> thing for the community. :)
>>
>> - Magnar
>>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] Optimus - a Ring middleware for frontend performance optimization.

2013-11-25 Thread Magnar Sveen
Hi Jason! 

Magnar, could you talk a little about how your project is better 
> than/different from Stefon/dieter and cornet? I feel like we have a lot of 
> these projects now, all doing mostly the same thing.
>

Thanks for asking. I'll try to shed some light on the differences as I see 
them, and hopefully the people behind Dieter/Stefon (they're very similar) 
can add some details into their thinking. I haven't seen Comet, and google 
didn't help much either. Can you share a link?

As for Optimus vs Stefon: First of all it's a difference in focus. Stefon 
focuses on being an asset pipeline modelled after Sprockets in Rails. It 
lets you write LESS, CoffeeScript, Haml - turning it into CSS and 
JavaScript. Optimus is not about transpiling from other languages, but 
about frontend optimization. As such, it rewrites your urls to include 
cache busters and serves your assets with far-future expires headers, so 
they can be cached aggressively in production. As I add more features to 
optimus, they too will focus around better frontend performance - and not 
more languages to be transpiled.

While this is the main point in my mind, there are also other differences 
that aren't just details that everyone will agree on. :-) These two come to 
mind:

1. Stefon serves assets live in development, but requires a build step in 
production to precompile the files. Optimus does not require a build step, 
but compiles your asset when the server starts. 

2. Stefon creates bundles by having custom .stefon files with edn-flavored 
lists of files in your directories of static assets. Optimus also needs a 
list of bundles, but does so using Clojure in your program. I would think 
that Stefons' approach is better if your frontend developers are not 
comfortable editing the Clojure code, while Optimus' approach allows more 
programatic control.

I hope I haven't misrepresented Stefon in any way - these are my 
impressions. Since I'm a front-end optimization nut, these arguments were 
enough to sway me to create a different package. It would be several major 
breaking changes to Dieter and Stefon's architectures and APIs, and I 
didn't think I would get anywhere fighting for these changes in github 
issues.

 

> I also don't totally understand why they're all done as Ring middleware 
> instead of lein/maven plugins. Maybe this is my Java background talking, 
> but that seems to me to be the logical place to put this sort of thing.
>

Front-end development with a compilation step is pretty horrible. There's 
also the case that the URL to a static asset and its location on disk is 
entirely different after optimization.

Hope that answers your questions somewhat decently. And if it didn't, maybe 
you'll be swayed by the argument that a little competition is a good thing 
for the community. :)

- Magnar

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[ANN] Optimus - a Ring middleware for frontend performance optimization.

2013-11-24 Thread Magnar Sveen
I just open sourced optimus. README and code 
here: https://github.com/magnars/optimus

Optimus is a Ring middleware for frontend performance optimization.

It serves your static assets:

   - in production: as optimized bundles
   - in development: as unchanged, individual files

In other words: Develop with ease. Optimize in production.

*Features*

Depending on how you use it, optimus:

   - concatenates your JavaScript and CSS files into bundles.
   - minifies your JavaScript with UglifyJS 
2
   - minifies your CSS with CSSO 
   - adds cache-busters to your static asset URLs
   - adds far future Expires 
headers

Also, if you're using Angular.JS:

   - prepopulates the Angular template 
cache with 
   your HTML templates.



https://github.com/magnars/optimus

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.