# \[ANN\] Wee 2.0.0 released (Rack, Continuations, Refactoring)

**URL:** <https://www.ruby-forum.com/t/ann-wee-2-0-0-released-rack-continuations-refactoring/164919>\
**Category:** Ruby\
**Created:** [April 7, 2009, 12:14pm UTC](https://www.ruby-forum.com/t/ann-wee-2-0-0-released-rack-continuations-refactoring/164919 "2009-04-07T12:14:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaeln](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaeln](https://www.ruby-forum.com/u/michaeln)\
**Post date:** [April 7, 2009, 12:14pm UTC](https://www.ruby-forum.com/t/ann-wee-2-0-0-released-rack-continuations-refactoring/164919/1 "2009-04-07T12:14:18Z")

</div>

Hi all,

Around 4 years have passed since the last release of Wee.

# What is Wee?

Wee is a Seaside-inspired [1](http://www.seaside.st/) web-framework for building highly-dynamic  
component-based web-applications.

# What’s new?

- 100% Rack based
- Support for continuations
- JQuery AJAX support
- Ruby 1.9 ready

# Distinctive Features

Wee is not just another web framework. It is completely different.

## Continuations

You can use continuations to model the page flow of the your  
application, in the same way as you’d call a method in a GUI  
application. Continuations are optional; nothing in Wee depends on them.  
Example:

# you can write code like this:

if callcc YesNoMessageBox.new(‘Really?’)  
# do something  
else  
# something else  
end

Without continuations one has to use (ugly) Continuation Passing Style  
(CPS):

call YesNoMessageBox.new(‘Really?’) do |res|  
if res  
# do something  
else  
# something else  
end  
end

## Backtracking

Backtracking means that the user can naturally use the browsers back  
button despite Wee’s statefulness. This is not taken for granted for  
stateful web frameworks. Behind the scenes, Wee keeps multiple states  
of the application around with only little help by the programmer.

## Components

Contrary to the widely used model/view/controller (MVC) paradigm, Wee  
tighly couples the controller and the view within a _component_.  
Components itself are highly decoupled from the rest of the application  
and can be reused to construct more complex applications. The powerful  
programmatic HTML rendering approach further reduces wasting the  
programmers mind by avoiding switching files (controller/view) or  
languages (Ruby/HTML). Therefore in Wee everything is written in Ruby.  
The programmatic HTML renderer is not just a simple HTML builder, it  
provides very powerful methods for easily generating HTML constructs  
and registering callbacks. Example:

# 

# Generating a tag

# 

# select an object from these items

items = [1, 2, 3, 4]

# the labels shown to the user

labels = items.map {|i| i.to\_s}

# render it

r.select\_list(items).labels(labels).callback {|choosen| p choosen}

# render a multi-select list, with objects 2 and 4 selected

r.select\_list(items).multi.labels(labels).selected([2,4])

=== Call/Answer mechanism ===

From callback handlers you can call other components which in turn  
replace the current components view. The called component can later  
return (or answer) back to the calling componenent. Example:

class YesNoMessageBox \< Wee::Component  
def initialize(msg)  
super()  
@msg = msg  
end

```
 def render(r)
   r.bold(@msg)
   r.form do
     r.submit_button.value('YES').callback { answer true }
     r.space
     r.submit_button.value('No').callback { answer false }
   end
 end

```

end

# Use call (or callcc) as in the Continuation section above

# to call a component:

call YesNoMessageBox.new(‘Really?’)

## The classical Hello World Example

require ‘rubygems’ if RUBY\_VERSION \< “1.9”  
require ‘wee’

class HelloWorld \< Wee::Component  
def initialize  
super  
add\_decoration Wee::PageDecoration.new(title=“Hello World”)  
end

```
 def render(r)
   r.h1 "Hello World from Wee!"
   r.div.onclick_callback { p "clicked" }.with("click here")
 end

```

end

Wee.run(HelloWorld) if **FILE** == $0

# Now point your browser to [http://localhost:2000/](http://localhost:2000/)

## Installation

gem install wee

## More Resources

[http://rubyforge.org/projects/wee](http://rubyforge.org/projects/wee)  
[http://www.ntecs.de/projects/wee/doc/rdoc/](http://www.ntecs.de/projects/wee/doc/rdoc/)

> **[GitHub - mneumann/wee: A high-level, light-weight web framework for Ruby with...](https://github.com/mneumann/wee)**
>
> A high-level, light-weight web framework for Ruby with many ideas from Seaside. - GitHub - mneumann/wee: A high-level, light-weight web framework for Ruby with many ideas from Seaside.

Regards,

Michael

---

<div class="post-metadata">

**Author:** ![michaeln](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaeln](https://www.ruby-forum.com/u/michaeln)\
**Post date:** [April 7, 2009, 12:40pm UTC](https://www.ruby-forum.com/t/ann-wee-2-0-0-released-rack-continuations-refactoring/164919/2 "2009-04-07T12:40:28Z")

</div>

Michael N. wrote:

> Hi all,
> 
> Around 4 years have passed since the last release of Wee.

Strange that my posting didn’t get through to ruby-talk ☹

---

<div class="post-metadata">

**Author:** ![michaeln](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaeln](https://www.ruby-forum.com/u/michaeln)\
**Post date:** [April 7, 2009, 1:50pm UTC](https://www.ruby-forum.com/t/ann-wee-2-0-0-released-rack-continuations-refactoring/164919/3 "2009-04-07T13:50:56Z")

</div>

For some (yet) unknown reasons my announcement didn’t make it to  
ruby-talk. You can read the full text here:

[http://www.ruby-forum.com/topic/183615#802610](http://www.ruby-forum.com/topic/183615#802610)

Regards,

Michael

---

<div class="post-metadata">

**Author:** ![michaeln](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaeln](https://www.ruby-forum.com/u/michaeln)\
**Post date:** [April 7, 2009, 1:29pm UTC](https://www.ruby-forum.com/t/ann-wee-2-0-0-released-rack-continuations-refactoring/164919/4 "2009-04-07T13:29:03Z")

</div>

Michael N. wrote:

> Michael N. wrote:
> 
> > Hi all,
> > 
> > Around 4 years have passed since the last release of Wee.
> 
> Strange that my posting didn’t get through to ruby-talk ☹

(I’ll try to post again. Sorry for any inconveniences)

Hi all,

Around 4 years have passed since the last release of Wee.

# What is Wee?

Wee is a Seaside-inspired [1](http://www.seaside.st/) web-framework for building highly-dynamic  
component-based web-applications.

# What’s new?

- 100% Rack based
- Support for continuations
- JQuery AJAX support
- Ruby 1.9 ready

# Distinctive Features

Wee is not just another web framework. It is completely different.

## Continuations

You can use continuations to model the page flow of the your  
application, in the same way as you’d call a method in a GUI  
application. Continuations are optional; nothing in Wee depends on them.  
Example:

# you can write code like this:

if callcc YesNoMessageBox.new(‘Really?’)  
# do something  
else  
# something else  
end

Without continuations one has to use (ugly) Continuation Passing Style  
(CPS):

call YesNoMessageBox.new(‘Really?’) do |res|  
if res  
# do something  
else  
# something else  
end  
end

## Backtracking

Backtracking means that the user can naturally use the browsers back  
button despite Wee’s statefulness. This is not taken for granted for  
stateful web frameworks. Behind the scenes, Wee keeps multiple states  
of the application around with only little help by the programmer.

## Components

Contrary to the widely used model/view/controller (MVC) paradigm, Wee  
tighly couples the controller and the view within a _component_.  
Components itself are highly decoupled from the rest of the application  
and can be reused to construct more complex applications. The powerful  
programmatic HTML rendering approach further reduces wasting the  
programmers mind by avoiding switching files (controller/view) or  
languages (Ruby/HTML). Therefore in Wee everything is written in Ruby.  
The programmatic HTML renderer is not just a simple HTML builder, it  
provides very powerful methods for easily generating HTML constructs  
and registering callbacks. Example:

# 

# Generating a tag

# 

# select an object from these items

items = [1, 2, 3, 4]

# the labels shown to the user

labels = items.map {|i| i.to\_s}

# render it

r.select\_list(items).labels(labels).callback {|choosen| p choosen}

# render a multi-select list, with objects 2 and 4 selected

r.select\_list(items).multi.labels(labels).selected([2,4])

## Call/Answer mechanism

From callback handlers you can call other components which in turn  
replace the current components view. The called component can later  
return (or answer) back to the calling componenent. Example:

class YesNoMessageBox \< Wee::Component  
def initialize(msg)  
super()  
@msg = msg  
end

```
 def render(r)
   r.bold(@msg)
   r.form do
     r.submit_button.value('YES').callback { answer true }
     r.space
     r.submit_button.value('No').callback { answer false }
   end
 end

```

end

# Use call (or callcc) as in the Continuation section above

# to call a component:

call YesNoMessageBox.new(‘Really?’)

# The classical Hello World Example

require ‘rubygems’ if RUBY\_VERSION \< “1.9”  
require ‘wee’

class HelloWorld \< Wee::Component  
def initialize  
super  
add\_decoration Wee::PageDecoration.new(title=“Hello World”)  
end

```
 def render(r)
   r.h1 "Hello World from Wee!"
   r.div.onclick_callback { p "clicked" }.with("click here")
 end

```

end

Wee.run(HelloWorld) if **FILE** == $0

# Now point your browser to [http://localhost:2000/](http://localhost:2000/)

# Installation

gem install wee

# More Resources

- Wee at Rubyforge: [http://rubyforge.org/projects/wee](http://rubyforge.org/projects/wee)

- Wee at GitHub: [GitHub - mneumann/wee: A high-level, light-weight web framework for Ruby with many ideas from Seaside.](http://github.com/mneumann/wee)

- Documentation: [http://www.ntecs.de/projects/wee/doc/rdoc/](http://www.ntecs.de/projects/wee/doc/rdoc/)

Regards,

Michael

---

<div class="post-metadata">

**Author:** ![michaeln](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@michaeln](https://www.ruby-forum.com/u/michaeln)\
**Post date:** [April 8, 2009, 9:01am UTC](https://www.ruby-forum.com/t/ann-wee-2-0-0-released-rack-continuations-refactoring/164919/5 "2009-04-08T09:01:25Z")

</div>

On Apr 7, 2009, at 3:39 AM, Michael N. wrote:

> Strange that my posting didn’t get through to ruby-talk ☹

I tried to post to announce BlueCloth 2.0 today and it still hasn’t  
come through either.
