Skip to content

Compare
Choose a tag to compare
@hpehl hpehl released this 05 Dec 08:26

This release adds one breaking change, some minor enhancements, and several deprecations. The main focus is to clean up the API for Elemento 1.0.

Breaking Changes

  • IsElement<E extends HTMLElement>: The method to return the element was renamed from asElement() to element(). The interface IsElement was introduced in Elemento as the counterpart to com.google.gwt.user.client.ui.IsWidget, which has a method asWidget(). As Elemento moves away from widgets and GWT 2, I'd like to reflect this in the API. That was the main motivation to rename the method in IsElement.

Enhancements

  • ElementsBuilder is now a real builder and implements TypedBuilder<Iterable<HTMLElement>, ElementsBuilder>.
  • Elements.collect() replaces Elements.elements().

Deprecations

  • HasElements: Will be removed w/o replacement. Please use Iterable<HTMLElement> instead.
  • ElementBuilder.asElement() and ElementBuilder.element(): In order to cleanup the API and to avoid multiple methods which do (or return) the same thing, builders won't no longer implement IsElement<E>. Please use get() instead. A builder is a builder and not an element.
  • LazyElement.asElement(): Please use LazyElement.element() instead.
  • ElementsBuilder.addAll(HasElements): Please use ElementsBuilder.addAll(Iterable) instead.
  • HtmlContent.addAll(HasElements): Please use HtmlContent.addAll(Iterable) instead.
  • Elements.elements(): Please use Elements.collect() instead.
  • Widgets.asElement(IsWidget): Please use Widgets.element(IsWidget) instead.
  • Widgets.asElement(Widget): Please use Widgets.element(Widget) instead.
  • Widgets.asElement(com.google.gwt.dom.client.Element): Please use Widgets.element(com.google.gwt.dom.client.Element) instead.
  • Widgets.asWidget(IsElement): Please use Widgets.widget(IsElement) instead.
  • Widgets.asWidget(HTMLElement): Please use Widgets.widget(HTMLElement) instead.

I'm looking forward to feedback about the API changes. Any ideas, suggestions, and critic are welcome. The goal is to improve and finalize the API in order to get closer to a 1.0 release.