Skip to content

Releases: vaadin/flow

0.0.16

10 Feb 07:48
Compare
Choose a tag to compare
0.0.16 Pre-release
Pre-release

New features

  • Let NavigationHandler define HTTP status codes
  • Let onLocationChange set HTTP status codes
  • Let location change handlers reroute to another navigation handler
  • Support customizing prerender for Components
    • Method getPrerenderElement() can be used to customise pre rendering
  • Remove web components from pre-render HTML
  • Resolve includes before actual parsing in templates
  • Cache parsed templates based on a hash of the inputs

Fixes

  • Preserve white space inside text nodes in templates
  • Use consistent getter/setter order in tutorial
  • Use pageXOffset instead of scrollY to support IE11
  • Remove references to inheritable thread locals in javadocs
  • Show prerender HTML to user
  • Included Template should have correct parent TemplateNode

Demos

No changes

Tutorials

No changes

All changes

https://github.com/vaadin/hummingbird/milestone/19?closed=1

JavaScript Integration helpers

25 Jul 08:52
Compare
Choose a tag to compare
Pre-release

New features

  • Provide $element to template event handlers
    • (click)="$server.clickOnText($element.textContent)
    • Refers to the element that has the listener, not $event.target
  • Generalize @EventHandler from Template into a Component feature
    • $server callbacks available in element.$server on the client side
    • @EventHandler public void MyComponent.publishedMethod(int someNumber); on the server defines the method, theElement.$server.publishedMethod(42) on the client invokes the method
  • Add Element.callFunction for invoking JavaScript methods on elements
    • e.g. myWebComponent.getElement().callFunction("setValue",12)

Fixes

  • Throw an exception if arrays are used in a Template Model
  • Ensure assertion errors are not shown as empty messages
  • Fix unclear error message for @EventHandler method with non-void return type
  • Don't include <script> from Template into pre-render HTML

Demos

No changes

Tutorials

All changes

https://github.com/vaadin/hummingbird/milestone/18?closed=1

Model subproperties and scroll position restoration

15 Jul 10:18
Compare
Choose a tag to compare

New features

  • Restore body scroll position when navigating back to a previously opened view
  • Support Template Model subproperties in JavaScript expressions
    • <span>{{greeting ? greeting.text : "No greeting available"}}</span>
  • @Uses annotation for importing HTML, JavaScript and StyleSheet dependencies from other component classes. See tutorial for demo

Fixes

  • Fix <body> location in prerender HTML
  • Add more info on exception messages for TemplateModel propertyType
  • Explicitly disallow NaN and Infinity in the model instead of just silently producing the wrong result
  • Add a missing tutorial link for Creating a Component Container

Demos

Fixed address book table position to be fixed.

Tutorials

All changes

https://github.com/vaadin/hummingbird/milestone/17?closed=1

Lots of small fixes

06 Jul 09:13
Compare
Choose a tag to compare
Lots of small fixes Pre-release
Pre-release

New features

  • Introduce @Synchronize to specify property synchronization declaratively

Fixes

  • Support inline styles for the root element in an Html component
  • Allow remote super dev mode connections by default
  • Ensure debug logging cannot cause application to fail
  • Allow setting the same parent view many times
  • Ensure that NaN doubles do not end up in the JSON
  • Format floating point numbers in the model in Java in the same way as in JS
  • Include path segment in router error message
  • Reduce network usage by using a pool for reused immutable values
  • Bind state nodes deferredly to avoid missing updated data

Demos

No demo updates this time.

Tutorials

Updated tutorials about using @Synchronize with Components and Web Components

All changes

https://github.com/vaadin/hummingbird/milestone/16?closed=1

Pre-rendering

29 Jun 07:46
Compare
Choose a tag to compare
Pre-rendering Pre-release
Pre-release

New features

  • Pre-rendering of the initial view
    • Enables search engines to index the application
    • Shows the view to the end user before any JavaScript has been loaded and initialized
  • Support for testing pre-rendering through ?prerender=only/no
  • Stylesheets are immediately loaded. Previously the client engine was started before loading any dependencies.
  • Possibility to override how the error view is created by using the RouterConfiguration.setErrorHandler method.

Fixes

  • All special characters are now correctly encoded when sent to the client.
  • Template parsing is now case sensitive
    • Binding to camelCase properties in a template now works
    • Binding to camelCase class names in a template now works
  • Element.getAttribute("style") and Element.getStyle() works correctly for template elements
  • Previous inline styles are correctly cleared when using Element.setAttribute("style","...")
  • Boolean attributes are correctly rendered as attr instead of attr=""
  • Overridable methods in ViewRenderer get more context for making decisions and avoiding to calculate the same values multiple times.

Demos

No demo updates this time.

Tutorials

No tutorial updates this time.

All changes

https://github.com/vaadin/hummingbird/issues?q=milestone%3A0.0.12

Bean import filters

22 Jun 08:15
Compare
Choose a tag to compare
Bean import filters Pre-release
Pre-release

New features

  • When importing a bean to the template model, you can define that some of the bean properties should be excluded from the model
    • The same annotations are also supported on list setters, where they will apply to each item in the imported list.
public interface MyModel extends TemplateModel {
  @Exclude("id", "password") // includes all other properties
  public void setUser(User user);

  @Include("firstName", "lastName") // excludes all other properties
  public void setPerson(Person person)
}
  • View instance creation is pluggable to enable integration with e.g. Spring or CDI
  • Client side exception messages are shown as a floating overlay in the browser when production mode is not active
  • @Id can now be used in template classes to inject Element instances. Previously only component instances could be injected.

Fixes

  • Eliminated memory leak caused by redeploying Hummingbird
  • The $server variable is now properly populated inside *ngFor
  • @HtmlImport dependencies are now always loaded before @JavaScript
  • Atmosphere dependency updated to be compatible with Jetty 9.3
  • Fixed browser version check so that the embedded browser in Eclipse on OS X is no longer considered outdated
  • Renamed Element methods for increased clarity:
    • getOwnTextContent renamed to getText
    • setTextContent renamed to setText
    • getTextContent renamed to getTextRecursively

Demos

  • Address book demo updated to only import some parts of the bean and to support editing and saving through the form Java HTML

Tutorials

All changes

https://github.com/vaadin/hummingbird/issues?q=milestone%3A0.0.11

JavaScript in template bindings

15 Jun 07:17
Compare
Choose a tag to compare
Pre-release

New features

  • Support for using JavaScript expressions in model bindings
<span>{{firstName + ' ' + lastName}}</span>
<div [class.hidden]="itemCount == 0">Items available: {{itemCount}}</div>
  • Support for using multiple bindings and @include statements in the same text node
<span>Hello {{name}}</span>

<span>{{firstName}} {{lastName}}</span>

<div>
    @include header.html@
    @child@
    @include footer.html@
</div>
  • Support for getting a list of beans from a model. Like with other getters, the returned list is a proxy object which can be modified to update the model
public interface EmployeesModel extends TemplateModel {
    public List<Employee> getEmployees();
}
  • An error message is shown to the end user if loading of a resource (CSS/JS/HTML) fails
  • Client-side "debug" mode is now only based on whether the server-side production mode setting
    • ?debug in the query string has no effect
  • Low level API for importing a bean into a given part of the model
TemplateModel.importBean(String modelPath, Object bean, Predicate<String> propertyNameFilter)
  • Low level API for importing a list of beans, optionally filtering what bean properties to include
TemplateModel.importBeans(String modelPath, List<T> beans, Class<T> beanType, Predicate<String> propertyNameFilter)

Fixes

  • For loops in templates are optimized to only update the changed parts instead of recreating the full DOM
  • Changed default push transport from long polling to websockets
  • Element.getOuterHTML() no longer throws exceptions for template elements with a class attribute

Demos

  • Hello world template demo updated to use JavaScript expressions Java HTML
  • Address book demo updated to use the new model API Java HTML
  • Web site demo updated to use the new model API Java HTML

Tutorials

All changes

https://github.com/vaadin/hummingbird/issues?q=milestone%3A0.0.10

Beans and lists in template model

08 Jun 07:35
Compare
Choose a tag to compare
Pre-release

New features

  • Support for beans in template model
    public interface FormModel extends TemplateModel {
        public void setPerson(Person person);
        public Person getPerson();
    }
  • Getter for a bean returns a proxy object which is connected to the model (setters update the model values)
  • Setter for a bean copies the bean values into the model
  • Low level model API for handling beans in the model:
void TemplateModel.importBean(Object bean)
void TemplateModel.importBean(Object bean, Predicate<String> propertyNameFilter)
T TemplateModel.getProxy(String modelPath, Class<T> beanType)
  • Support for setting lists of beans in the model
public interface EmployeesModel extends TemplateModel {
    public void setEmployees(List<Employee> employees);
}
  • Support for setting attributes on template elements from Java
  • Support for binding to attributes in templates using [attr.placeholder]="modelPart"
  • Shorthand for setting boolean attributes: Element.setAttribute(String, boolean)
  • Shorthand for clearing an Input value: Input.clear()
  • All builds are automatically scalability tested using Gatling

Fixes

  • Use of the @Id annotation has been clarified in some tutorials

Demos

  • Initial version of an Address book demo Java HTML

Tutorials

All changes

Template model, inclusion, component mapping and class binding

31 May 10:45
Compare
Choose a tag to compare

New features

  • Template model with support for basic types: boolean, int, double, String
public class MyTemplate extends Template {
    public interface MyModel extends TemplateModel {
        public void setHelloText(String helloText);
        public String getHelloText();
    }
    @Override
    public MyModel getModel() {
        return (MyModel) super.getModel();
    }
}
  • Including a template in another template, e.g. <div>@include path/file.html@</div>
  • Support for inline <script> and <style> in templates
  • Class name bindings in templates, e.g.
<div [class.myclass]="myClassEnabled"></div>
public interface MyModel extends TemplateModel {
    public boolean isMyClassEnabled();
}
  • Mapping template elements to components using id, e.g.
<paper-slider id="myslider">
@Id("myslider") 
private PaperSlider mySlider;
  • Mapping an element to a Component using Component.from(Element)
  • More basic components wrapping HTML elements: Emphasis, H1, H2, H3, H4, H5, H6, Span
  • Support for using most Element features with template elements
    • Element properties
    • Synchronized properties
    • DOM event listeners
  • Element.getOuterHtml to return the outer HTML for an element
  • Support for boolean and int type properties in PropertyDescriptor
  • Support for sending Json values from the client to the server

Fixes

  • Correctly detect loading of CSS files in Safari again
  • Resolver.resolve and RouterConfiguration.resolveRoute return Optional instead of null
  • Propert handling of @EventHandling methods with varargs
  • Hello world session size reduced from 9.23KB to 5.97KB
  • RouterLink now has a getter for href
  • PropertyDescriptor can be used with any Element
  • An unresolvable route now returns 404 to the browser
  • Replaced LGPL CSS Parser library with Apache 2 ph-css

Demos

  • Web site demo updated to use template class bindings Java HTML
  • Hello world using templates updated to use template model Java HTML

Tutorials

All changes

Web components and template event handlers

23 May 07:53
Compare
Choose a tag to compare

New features

  • Server side event handlers for template, e.g.: (click)="$server.myMethod(input.value);"
  • Support for HTML imports through Page.addHtmlImport()
  • Support for defining dependency imports @StyleSheet, @JavaScript or @HtmlImport
  • Support for Polymer DOM operations through Polymer.DOM when Polymer is loaded
  • Support for setting inline styles using Element.setAttribute("style","...");
  • Attach events have an isInitialAttach method which can be used to react only to the first attach event
  • Attach events have an getUI() and getSession() helpers to provide easier access to the UI and Session
  • Updated API for all HTML components to use correct default values and return Optional<T> for attributes which are not always present

Fixes

  • Template.getParent() returns the parent instead of always throwing an exception
  • ThreadLocals are no longer inheritable to avoid referring to the wrong UI in background threads and to prevent memory leaks

Demos

  • Hello world using templates update to use server side template event handlers Java HTML
  • Integration demo of the Progress Bubble web component Java

New tutorials

All changes