github vaadin/flow 0.0.10
JavaScript in template bindings

latest releases: 23.3.31, 24.3.11, 23.5.1...
pre-release7 years ago

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

Don't miss a new flow release

NewReleases is sending notifications on new releases.