All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.7.0 - 2024-11-29
Warning
This release contains refactorings and deprecations that might break existing code.
The refactoring should make the use case and scope of the builder-like classes, interfaces and methods more obvious. It introduces a common naming pattern for interfaces and classes:
-
Interface
[HTML|MathML|SVG]Element<Scope>Methods
: These interfaces contain default methods to work with a specific aspect of an HTML, MathML or SVG element.Some examples are
ElementAttributeMethods
HTMLElementDataMethods
HTMLInputElementMethods
SVGElementStyleMethods
-
Class
[HTML|MathML|SVG](Element|Container)Builder
: Concrete builders that encapsulate an HTML, MathML or SVG element. The builders implement the method interfaces to work with the element.Some examples are
HTMLElementBuilder
HTMLInputElementBuilder
SVGContainerBuilder
See https://hal-console.gitbook.io/elemento/builder-api#classes-and-interfaces for more information.
-
HasElement<E extends Element, B extends TypedBuilder<E, B>>
has been deprecated and is split into more specific interfaces:ElementAttributeMethods<E, B>
ElementClassListMethods<E, B>
ElementConsumerMethods<E, B>
ElementContainerMethods<E, B>
ElementEventMethods<E, B>
ElementIdMethods<E, B>
ElementHTMLMethods<E, B>
ElementTextMethods<E, B>
-
HasHTMLElement<E extends Element, B extends TypedBuilder<E, B>>
has been deprecated and is split into more specific interfaces:HTMLElementAttributeMethods<E, B>
HTMLElementDataMethods<E, B>
HTMLElementStyleMethods<E, B>
HTMLElementVisibilityMethods<E, B>
-
Container<E extends Element, B extends TypedBuilder<E, B>>
has been deprecated. It is replaced byElementContainerMethods<E, B>
-
ElementsBag
has been deprecated. It should be replaced by using the standard collection API. -
Finder<E extends Element, B extends TypedBuilder<E, B>>
has been deprecated. It is replaced byElementQueryMethods<E, B>
-
HasInputElement<E extends HTMLInputElement, B extends TypedBuilder<E, B>>
andInputElementBuilder<E extends HTMLInputElement, B extends TypedBuilder<E, B>>
have been deprecated. They are replaced byHTMLInputElementMethods<E, B>
andHTMLInputElementBuilder<E, B>
. -
LazyElement
has been deprecated. It should be replaced by using late initialization inIsElement.element()
.
HasMathMLElement<E extends MathMLElement, B extends TypedBuilder<E, B>>
has been deprecated and is replaced byMathMLElementStyleMethods<E, B>
:
HasSVGElement<E extends SVGElement, B extends TypedBuilder<E, B>>
has been deprecated and is replaced by more specific interfaces:SVGElementDataMethods<E, B>
SVGElementStyleMethods<E, B>
1.6.11 - 2024-11-21
- Bump Elemental to 1.2.3
- Bump JUnit to 5.11.3
- Remove custom clipboard support (
org.jboss.elemento.Clipboard
), which is now available in Elemental 1.2.3 aselemental2.dom.Navigator.clipboard
1.6.10 - 2024-09-22
- Make
Elements.insert*()
methods null-safe
1.6.9 - 2024-09-13
- Fix bug in
BodyObserver
removing wrong elements on detach due to a wrong CSS attribute selector. See also https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Attribute_selectors- Wrong selector:
<attribute>*=<id>
- Correct selector:
<attribute>~=<id>
- Wrong selector:
1.6.8 - 2024-08-21
- Add
Elements.isElementInView(HTMLElement)
based on https://gist.github.com/Marco-Prontera/6d9d1a9cead48f44e8dabd8ff5310ecf
1.6.7 - 2024-07-30
- Add
Logger.initFrom(elemental2.dom.Location)
1.6.6 - 2024-07-30
- Return a unique label from
Logger.time
methods
- Remove deprecated methods:
HasElement.id()
1.6.5 - 2024-07-18
- Add
Logger.group
andLogger.time
methods
1.6.4 - 2024-07-18
Not an official release. Please don't use!
1.6.3 - 2024-07-18
- Make
By.selector()
public
- Bump J2CL processors to 0.7
- Bump JUnit to 5.10.3
1.6.2 - 2024-06-09
- Add
Page.attach()
- Add
Page.detach()
1.6.1 - 2024-05-15
- Fix bug in attach/detach observer
1.6.0 - 2024-05-10
-
Add
ButtonType
enum andElements.button(ButtonType)
-
Add
@Loader
annotation andloader
attribute for@Route
annotation -
Add options for router annotation processors:
places.package
: The package name of the generated class for the annotated places.places.class
: The class name of the generated class for the annotated places.
-
Rename loader classes:
Loader<T>
→LoadData<T>
LoadData
→LoadedData
-
Add support for loaders in router annotation processors
-
Change default name of the generated class for the annotated places
GeneratedPlaces
→AnnotatedPlaces
-
Simplify router annotation processors
1.5.1 - 2024-05-08
-
Add methods to modify the text node of an element:
Elements.textNode(elemental2.dom.Element, String)
Elements.textNode(IsElement<E>, String)
-
Add overloaded methods to bind events in
HasElement
:HasElement.on(EventType<V,?>, boolean, EventCallbackFn<V>)
HasElement.on(EventType<V,?>, AddEventListenerOptions, EventCallbackFn<V>)
-
Add
Logger.isEnabled(Level)
to check if a level is enabled for a logger -
Add debug log statements logger to attach/detach implementation
- Fix multiple attach/detach handlers for an element
1.5.0 - 2024-05-06
- Add support for routes with parameters:
/contacts/:contactId
- Add asynchronous loaders for places
- Add place(s) builder API and nested places
- Optimize logging implementation
1.4.12 - 2024-04-30
-
Add support for category based log levels
-
Export methods to JavaScript to control log levels (for instance from the browser dev tools)
org.jboss.elemento.logger.Logger.setLevel(String level)
- sets the global log levelorg.jboss.elemento.logger.Logger.setLevel(String category, String level)
- overrides the log level for one categoryorg.jboss.elemento.logger.Logger.resetLevel(String category)
- resets the log level for the category to the global log level
- Fix logging of objects using
String.valueOf()
1.4.11 - 2024-04-26
- Fix logging methods to include variable arguments.
- Fix place manager to include the query part of the initial URL.
1.4.10 - 2024-04-26
- Logger module with a small, opinionated wrapper around
console.log
.
1.4.9 - 2024-04-22
- Add router processor using Crysknife CDI.
1.4.8 - 2024-04-15
- Widen
Elements.textNode()
methods to acceptElement
, instead ofHTMLElement
.
1.4.7 - 2024-04-15
PlaceManager.href(String)
andPlaceManager.href(Place)
to return the href for a route/place.Elements.textNode(HTMLElement)
andElements.textNode(IsElement<E>)
to return the text of the first text node (if any) or the text content of the element.
1.4.6 - 2024-04-14
- Added
sources
classifier in BOM
1.4.5 - 2024-04-13
- Added missing dependency definitions for packaging
gwt-lib
in BOM
1.4.4 - 2024-04-13
- Migrate from
jar
togwt-lib
packaging
1.4.3 - 2024-04-08
- Add parameter
routes.package
for the routes annotation processor to specify the package name of the generatedRoutes
implementation. If not specified, the package name defaults toorg.jboss.elemento.router
.
1.4.2 - 2024-03-20
- Fix API doc issues
1.4.1 - 2024-03-20
- Replace Freemarker with JavaPoet
1.4.0 - 2024-03-11
- New module
elemento-flow
- Samples are now part of Elemento
1.3.3 - 2024-03-05
- Inverted link selector for place manager
1.3.2 - 2024-03-05
- Fix 404 handling in place manager
1.3.1 - 2024-03-04
- Add
PlaceManager.base(String)
to set a base URL for the place manager.
1.3.0 - 2024-03-01
Elemento now contains a very basic place manager. The place manager is minimal invasive and built around a few simple concepts:
Route
: Annotation that can be used to decorate pages. An annotation processor collects all classes annotated with@Route
and generates an implementation ofRoutes
.Routes
: Provides a map of places and their corresponding pages.Place
: Data class that represents a place in an application. A place is identified by a route, and can have an optional title and a custom root element.Page
: Interface that represents a collection of HTML elements.PlaceManager
: Class responsible for managing the routing and navigation within an application.
1.2.13 - 2024-02-06
HasElement.run(Consumer<B>)
to executes code in the context of the builder
- Deprecate
HasElement.id()
in favour ofHasElement.uniqueId()
1.2.12 - 2024-01-15
- Add support for
elemental2.dom.AddEventListenerOptions
inEventType.bind()
methods - Add method
Elements.isElementInView(HTMLElement, HTMLElement, boolean)
to check if an element is (partially) visible within the viewable area of its container
1.2.11 - 2023-12-14
- Add support for
<picture/>
element - Add
Scheduler
class with methoddebounce(int timeout, Callback callback)
- Add
ClassList
class to add, remove, replace, toggle and iterate over CSS classes
1.2.10 - 2023-12-12
-
Add clipboard support
-
Add method to generate UUIDs:
Id.uuid()
-
Add methods to register a resize observer for elements:
Elements.resizeObserver(IsElement<E>, ResizeCallback)
Elements.resizeObserver(HTMLElement, ResizeCallback)
1.2.9 - 2023-11-30
- Fix bug in
Attachable
1.2.8 - 2023-11-28
-
Add overloaded
style()
methods toHasSVGElement
:style(String style)
: Appends the given style to the existing styles of an element.style(String style, boolean append)
: Appends or sets the given style of an element.style(String property, int value)
: Sets the given style property on an element.style(String property, String value)
: Sets the given style property on an element.style(String property, int value, boolean important)
: Sets the given style property on an element.style(String property, String value, boolean important)
: Sets the given style property on an element.
-
Add methods to debug elements. Both methods return a string representation of the given element with all attributes, but without the child elements (only the number of child elements is included).
Elements.toString(IsElement<E>)
Elements.toString(Element)
1.2.7 - 2023-10-29
- Optimize attach/detach implementation
1.2.6 - 2023-10-24
- Add method
Attachable.unregister(HTMLElement)
- Fix method
HasHTMLElement.style(String property, String value, boolean important)
1.2.5 - 2023-10-24
-
Add overloaded
style()
methods toHasHTMLElement
:style(String style)
: Appends the given style to the existing styles of an element.style(String style, boolean append)
: Appends or sets the given style of an element.style(String property, int value)
: Sets the given style property on an element.style(String property, String value)
: Sets the given style property on an element.style(String property, int value, boolean important)
: Sets the given style property on an element.style(String property, String value, boolean important)
: Sets the given style property on an element.
1.2.4 - 2023-10-18
-
New methods
Elements.isAttached(IsElement<E>)
andElements.isAttached(Node)
to test if an element/node is attached to the DOM by using the
Node.isConnected
property.
- Changed method
HasHTMLElement.style(String)
to append a style definition rather than overwrite the existing styles.
1.2.3 - 2023-10-18
Not an official release - please don't use!
1.2.2 - 2023-10-10
- Add method
HasElement.textNode(String text)
to change the text of the first text node while preserving existing child elements.
- Remove unused source path from
org.jboss.elemento.Core
GWT module definition
1.2.1 - 2023-10-05
HasInputElement.value()
: Method to set the value on input elements
EventType.getName()
: Use the public fieldname
instead
1.2.0 - 2023-09-11
- Split Elemento into three modules:
- Core:
org.jboss.elemento:elemento-core
- SVG:
org.jboss.elemento:elemento-svg
- MathML:
org.jboss.elemento:elemento-mathml
- Core:
- Rename classes:
*Html*
->*HTML*
- Remove support for GWT.com dependencies, only GWT project dependencies are supported in 1.2.x and above. If you still depend on GWT.com, please stick with Elemento 1.1.x
1.1.4 - 2023-08-28
-
Refactor interfaces to better follow the soc design principle:
HasElement
: Provides methods and default implementations for modifying elements.HasHtmlElement
: Provides methods and default implementations for modifying HTML elements.HasInputElement
: Provides methods and default implementations for modifying input elements.Container
: Provides methods and default implementations for adding elements.Finder
: Provides methods and default implementations for finding elements.
This enables better composition of features for builders.
1.1.3 - 2023-08-25
- Refactor builder classes for simple (empty) and container-like HTML and SVG elements
1.1.2 - 2023-08-25
Not an official release - please don't use!
1.1.1 - 2023-08-23
- Add support for basic SVG elements
- Rename
HtmlContent*
classes toHtmlContainer*
1.1.0 - 2023-08-23
Not an official release - please don't use!
1.0.15 - 2023-08-20
- Add methods to set
int
andboolean
(aria) attributes:ElementBuilder.attr(String, boolean)
ElementBuilder.attr(String, int)
ElementBuilder.aria(String, boolean)
ElementBuilder.aria(String, int)
- Add code snippets to the API documentation.
1.0.14 - 2023-08-20
Not an official release - please don't use!
1.0.13 - 2023-08-03
- Upgrade to Java 17
- Bump Elemental2 from 1.1.0 to 1.2.0
1.0.12 - 2023-08-03
- Upgrade to Java 17
- Bump Elemental2 from 1.1.0 to 1.2.0
1.0.11 - 2023-01-29
- Add safety check to mutation observer
- Upgrade JUnit to 5.9.2
1.0.10 - 2022-03-28
- Update GitHub release workflow
- Fix GWT.com related release process
1.0.9 - 2022-03-28
- Add documentation for GWT.com related release
- Fix GWT.com related release process
- Fix wrong GWT.com module names
1.0.8 - 2022-03-25
Starting with this release, Elemento comes with GWT.com compatible versions. The GWT.com compatible versions end with
suffix -gwtcom
. To use it replace
<dependency>
<groupId>org.jboss.elemento</groupId>
<artifactId>elemento-core</artifactId>
<version>1.0.8</version>
</dependency>
with
<dependency>
<groupId>org.jboss.elemento</groupId>
<artifactId>elemento-core</artifactId>
<version>1.0.8-gwtcom</version>
</dependency>
The GWT.com compatible versions differ in the following points:
<dependency>
<groupId>org.gwtproject.event</groupId>
<artifactId>gwt-event</artifactId>
</dependency>
<dependency>
<groupId>org.gwtproject.safehtml</groupId>
<artifactId>gwt-safehtml</artifactId>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
</dependency>
<inherits name="org.gwtproject.event.Event"/>
<inherits name="org.gwtproject.safehtml.SafeHtml"/>
<inherits name="com.google.gwt.event.Event"/>
<inherits name="com.google.gwt.safehtml.SafeHtml"/>
import org.gwtproject.safehtml.shared.SafeHtml;
import org.gwtproject.event.shared.HandlerRegistration;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.web.bindery.event.shared.HandlerRegistration;
1.0.7 - 2022-03-22
- Add dependabot
- License check
- Checkstyle rules
- Code format and import sorter
- Automate release process using GitHub actions
- Update documentation
- Update links to API documentation
- Move away from git flow
- Change default branch
develop
→main
- Adjust branch names in CONTRIBUTING.md
- Adjust URLs for distribution management
- Move samples to its own repository: https://github.com/hal/elemento-samples
1.0.3 - 2020-11-25
The only change is that the minimal Java version is now Java 1.8.
1.0.2 - 2020-10-27
- Upgrade gwt-safehtml to 1.0.0-RC1
1.0.1 - 2020-07-13
- Upgrade to Elemental2 1.1.0
- Downgrade minimal Java version to 1.8
1.0.0 - 2020-05-28
Elemento 1.0.0 introduces many breaking changes:
The maven coordinates, GWT module and the packages have changed.
Please use the following maven coordinates:
<dependency>
<groupId>org.jboss.elemento</groupId>
<artifactId>elemento-core</artifactId>
</dependency>
Inherit this GWT module:
<module>
<inherits name="org.jboss.elemento.Core"/>
</module>
The packages have been flattened and renamed. All Elemento classes are now in the package org.jboss.elemento
.
Elemento works with both J2CL and GWT. No classes from com.google
are used. The only dependencies you'll need are:
com.google.elemental2:elemental2-core
version 1.1.0com.google.elemental2:elemental2-dom
version 1.1.0com.google.elemental2:elemental2-webstorage
version 1.1.0org.gwtproject.event:gwt-event
version 1.0.0-RC1 andorg.gwtproject.safehtml:gwt-safehtml
version 1.0.0-RC1
You can use Elemento with GWT 2.8, 2.9 or J2CL. See the samples for more details about how to setup your dependencies.
The templating part has been moved to crysknife. Crysknife is a CDI implementation for J2CL / GWT3. Crysknife already contains most of the templating code of Elemento, integrates nicely with CDI and offers some extra features like GSS support on top of that.
The motivation behind this is that we don't want to have two very similar and competing template solutions.
All classes and methods marked as @deprecated
have been removed:
org.jboss.gwt.elemento.core.Widgets
org.jboss.gwt.elemento.core.HasElements
org.jboss.gwt.elemento.core.builder.ElementsBuilder.get()
org.jboss.gwt.elemento.core.builder.ElementsBuilder.css(String, boolean)
org.jboss.gwt.elemento.core.builder.HtmlContent.addAll(HasElements)
org.jboss.gwt.elemento.core.LazyElement.asElement()
org.jboss.gwt.elemento.core.Elements.elements()
Support for GWT widgets as defined by com.google.gwt:gwt-user
has been dropped. If you really need support for
widgets, you have to stick with
the latest 0.9.x-gwt2 version.
0.9.6 - 2019-11-27
- New method to select multiple classnames
- Fix endless loop for attachables
- Remove method to wrap a body element (there's only one body element)
0.9.5 - 2019-11-14
Attachable
interface- Typesafe CSS selector API
- Wrap HTML elements as builders
- Generate unique IDs
- Overloaded methods for IsElement
- Unified API: All classes which represent an element implement
IsElement<E extends HTMLElement>
and have aE element()
method.
0.9.3 - 2019-10-17
- PR #72: Add readOnly, disabled, required and placeholder methods in InputBuilder (thanks @alejandrocq)
- Fix #71: Upgrade npm dependencies for todomvc-app-css and todomvc-common (thanks @cristian-spiescu for reporting)
0.9.2 - 2019-10-17
- Add methods to generate unique IDs
- Add search event type
- Upgrade to JUnit 5
0.9.1 - 2019-07-02
- Fixes #69 (thanks @ibaca)
0.9.0 - 2018-12-05
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.
ElementsBuilder
is now a real builder and implementsTypedBuilder<Iterable<HTMLElement>, ElementsBuilder>
.
IsElement<E extends HTMLElement>
: The method to return the element was renamed from asElement() to element().Elements.collect()
replacesElements.elements()
HasElements
: Will be removed w/o replacement. Please useIterable<HTMLElement>
instead.ElementBuilder.asElement()
andElementBuilder.element()
: In order to cleanup the API and to avoid multiple methods which do (or return) the same thing, builders won't no longer implementIsElement<E>
. Please useget()
instead. A builder is a builder and not an element.LazyElement.asElement()
: Please useLazyElement.element()
instead.ElementsBuilder.addAll(HasElements)
: Please useElementsBuilder.addAll(Iterable)
instead.HtmlContent.addAll(HasElements)
: Please useHtmlContent.addAll(Iterable)
instead.Elements.elements()
: Please useElements.collect()
instead.Widgets.asElement(IsWidget)
: Please useWidgets.element(IsWidget)
instead.Widgets.asElement(Widget)
: Please useWidgets.element(Widget)
instead.Widgets.asElement(com.google.gwt.dom.client.Element)
: Please useWidgets.element(com.google.gwt.dom.client.Element)
instead.Widgets.asWidget(IsElement)
: Please useWidgets.widget(IsElement)
instead.Widgets.asWidget(HTMLElement)
: Please useWidgets.widget(HTMLElement)
instead.
0.8.7 - 2018-09-12
- Add message and visibilitychange events (thanks @ibaca)
- Fix #65: Chrome 69 breaks org.jboss.gwt.elemento.core.BodyObserver (thanks @mseele)
0.8.6 - 2018-07-11
- Add load event (thanks @mseele)
- Fix for #61: For each loop in body observer throws class cast exception in Chrome
0.8.5 - 2018-07-06
- New methods in
org.jboss.gwt.elemento.core.Elements
to get notified when an element is added to and removed from the DOM
0.8.4 - 2018-07-04
- Fix for IE11 which does not support multiple arguments for classList.add() & classList.remove() (thanks @mseele)
0.8.3 - 2018-06-19
- Fix safe HTML artefact name (thanks @vegegoku)
0.8.2 - 2018-04-25
- Add more insert before/after utility methods to Elements class (thanks @anbuck)
- Depends on the ported gwt-event
org.gwtproject.event:gwt-event
(thanks @vegegoku)
0.8.1 - 2018-03-26
No code changes compared to 0.8.0, but implements the new versions & branches as outlined in the [J2CL / GWT3 documentation](https://github.com/hal/elemento#j2cl--gwt3.
0.8.0 - 2018-03-22
- Prepare Elemento for J2CL / GWT3
- Elemento (core & template) no longer depends on
gwt-user
- Replace safe HTML implementation with https://github.com/Vertispan/gwt-safehtml/
- Move widget related code to new maven module
elemento-widget
0.7.1 - 2018-03-02
- Fix #46: Internet Explorer JavaScriptException when using template expressions
0.7.0 - 2017-12-11
- Split maven module
elemento-template
intoelemento-template-api
andelemento-template-processor
0.6.2 - 2017-12-07
- Add safe HTML support for expressions
- Update documentation
- Upgrade GWT to 2.8.2 and GWT maven plugin to 1.0-rc-9
- Upgrade Elemental to 1.0.0-beta-3 (thanks to @niloc132)
0.6.1 - 2017-09-19
- Add support for Dagger (thanks @tyler-ham)
- Include TodoMVC sample based on Dagger and HTML templates (thanks @tyler-ham)
- Update documentation
0.6.0 - 2017-09-18
- Close #31: Replace Handlebars like expressions
{{foo}}
with Freemarker like expressions${foo}
Bugfixes
- Fix #32: Use type parameter of IsElement in generated code
- Fix #33: Adjust maven shade plugin configuration
- Fix #34: Remove usage of GWT.create() and com.google.gwt.safehtml.shared.SafeHtml
- Remove Guava dependency
0.5.2 - 2017-09-06
- Add support for custom elements in
@DataElement
annotations - Add public factory of
EventType
so users can define their own events
- Update documentation
0.5.1 - 2017-07-25
- Add Errai sample
- Add code to verify that subtypes of
HTMLElement
are mapped to the right HTML elements
- Rename
TypeBuilder.asElement()
toTypeBuilder.get()
- Change
HtmlContent.add(HtmlElement)
toHtmlContent.add(Node)
- Update documentation
0.5.0 - 2017-07-11
First release to be available at Maven Central Switch to Apache2 license
- Add elemental2 inherits
- Auto-detect GIN on template processor
- Remove dependencies
- Guava
- JetBrains annotations
0.4.2 - 2017-06-26
- Add body builder
- Add a predicate and function to filter and map from nodes and/or elements to HTML elements
- Add method to create img tag with src
- Add builder for HTML input elements
- Add checks when adding CSS classes
- New
org.jboss.gwt.elemento.core.Key
enum for well-known keys - Add event type storage
- Revisit iterate & stream methods
- Enhance documentation