Blog

Vaadin 7 Beta

By  
Joonas Lehtinen
Joonas Lehtinen
·
On Sep 15, 2012 6:44:00 AM
·

After almost a year of development, the beta version of Vaadin 7 is finally here. Since the original mission statement, a lot has been done. While we did not manage to get in all of the planned features, we added some more - even managed to integrate the whole Google Web Toolkit into Vaadin.

 

Before diving in the details, please note two things: 1) Bear with us when you find rough edges - this is still beta and more importantly, 2) please do report any and all issues and imperfections you bump into. We really need your help in order to deliver an outstanding Vaadin 7.

Beta Changes Everything

With the previous alpha-releases we have already delivered refactored forms, a new windowing API, a new communication layer, JavaScript extensions and even included GWT. You can read more about these in the alpha 1, alpha 2 and alpha 3 announcements and in the Vaadin 7 wiki.

So what do we have in store for the beta? Because we do not want change the API after beta, our team made tons of changes for this release. Here are some of the more notable changes since alpha 3:

  • New packaging
  • Differential state transfers with change listeners
  • SASS implementation
  • Heartbeat for browser window close detection
  • Simplified CSS layout
  • Horizontal and Vertical layouts that do not calculate any more (except in some special cases)
  • Easier to use listeners: ex. addClickListener() instead of addListener()
  • Add-ons can now add content and meta-data to the startup page
  • Many of the core API:s are now refactored – again (see below)
  • New locking mechanism for background threads
  • Public field based state classes in addition to accessor based ones
  • Automated detection what state changes should be sent to client
  • Automated state change delegation to widget methods

 

As there are too many things to explain in one blog post, I'll summarize just a couple below. For more details, see the release notes.

Hello World - Again

Beta 1 brings major core API changes. Let me underline the depth of this: Do you think you know how to write a Hello World with Vaadin 7? Really?

public class MyVaadinUI extends UI {
   protected void init(final WrappedRequest request) { 
      addComponent(new Label("Hello world!"));
   }
}

 

Yes, that is a Vaadin application. Or to be accurate, it is not. The Application class is no more (except in the legacy package). The new way of building with Vaadin is UI. For those who tried out the alpha releases, this is just a rename of Root.

We have simplified the core concepts of Vaadin. There is no more "Main window" that somewhat represented "browser", no Application that was often explained to be "just a vaadin session" and no ApplicationContext that had to be always cast to be useful. A set of Vaadin UI components on a web page is now simply called UI and they live within a Page. The state of the components is stored in VaadinSession, which is (by default) stored in HttpSession. Wouldn't that sound quite like it always should have been?

Seven Shiny Packages Under the Tree

Vaadin 7 alpha 3 was a huge 50+MB jar. Yes, really. We heard your screams of pain loud and clear, so now the distribution is properly divided into seven jars:

vaadin-server-7.0.0.beta1.jar has the everything you need to program with Vaadin on the server-side. It depends on bunch of other packages, but these will get included in your project by your dependency management system.

vaadin-client-7.0.0.beta1.jar contains all client-side classes used to program on the client-side. If you have been using GWT, this is where you find all the gwt-user.jar contents among others.

vaadin-shared-7.0.0.beta1.jar is shared by the client and the server. It is a dependency for both, so your dependency management should take care of it automatically.

vaadin-client-compiled-7.0.0.beta1.jar contains the precompiled default widgetset. This is used to avoid Java to JavaScript compilation when you are working on the server-side

vaadin-themes-7.0.0.beta1.jar contain all Vaadin themes Reindeer, Runo, Chameleon, Base and Liferay.

vaadin-client-compiler-7.0.0.beta1.jar includes all the tools needed to compile Java to JavaScript as well as other bits and pieces in the GWT toolbox.

vaadin-theme-compiler-7.0.0.beta1.jar contains our implementation of the SASS compiler. This is needed for theme development, if you prefer SASS over CSS like we do.

And then there are normal source and javadoc packages available for the above as well.

All this packaging and their dependencies are automatically handled and downloaded when you are using Maven, Ivy, Groovy or some similar build-system. If you still prefer to download and manage everything manually, we have collected all the packages and their dependencies to vaadin-all-7.0.0.beta1.zip

What Did We Miss?

Some of the initially planned and very important features did not make it to the beta 1. These include:

  • Server-push
  • Taglib for easy JSP/JSF integration
  • WAI-ARIA support
  • On the fly translation support

Please do accept our apologies for this. We did our best, but ran out of time. We still plan to deliver all of these in a future minor release. To begin with, the preliminary plan for 7.1 is to include server-push, a redesigned table component (yes, finally) as well as support for using many of the Vaadin widgets on the client-side applications.

There are still some really important projects going on in parallel with Vaadin 7.0. These are not ready yet:

  • Vaadin Eclipse Plug-in with Vaadin 7 support. The work is in progress to integrate Apache Ivy for dependency management.
  • Marko Grönroos is writing a new edition of the Book of Vaadin that will cover Vaadin 7. It is still far from ready. We will release draft editions later this year, with no timebox for the final edition. It is ready when it is ready. Hopefully before the end of the year.
  • Sampler and demos are still to be updated. We are working on them and plan to add demo coverage iteratively - starting from Vaadin 7.0 release.

Getting Started

Maven

The easiest way of getting started would be with Maven. If you prefer command-line, you can create a new project with:

mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.0.0.beta1 -Dpackaging=war

Then just compile and run with:

mvn package jetty:run

Your application will be running on http://localhost:8080/

Protip: If you won't be using add-ons or writing any client-side code, you can skip fairly slow initial client-side compilation by deleting AppWidgetSet.gwt.xml under src/main/java and removing the widgetset init-param from src/main/webapp/WEB-INF/web.xml. Without your custom widgetset, a precompiled default widgetset is used instead.

Eclipse / IntelliJ / Netbeans

At the moment, you should use Maven with the preferred IDE of yours. Early version of the Eclipse plugin can be downloaded from http://vaadin.com/eclipse/experimental, but it still has way too many rough edges.

Waiting for Your Feedback

Help yourself, test and report back to us. General comments, feedback and rants are welcome on the forums – tell us what you think.

But most importantly, please post bugs reports to dev.vaadin.com.

One more thing. When the Vaadin 7.0.0 will be out? While we did plan that to be on Oct 1, we really do not know the exact release date. We will keep releasing weekly updates to beta until it looks good and polished.

Happy hacking!

Joonas Lehtinen
Joonas Lehtinen
Joonas is the CEO and co-founder of Vaadin. He has been working with web app development tools and technologies for over 20 years and speaks frequently in Java conferences around the world. Joonas lives is San Jose, CA, with his wife and 10 year old son. You can follow him on Twitter – @joonaslehtinen
Other posts by Joonas Lehtinen