Vaadin Flow 2.2.0 is a feature release of the Java Framework for Vaadin 14.2 that includes a number of new features and enhancements.
EDIT 2021-01-28: Added mention of changed behavior with styles in exported web components.
Changes Since 2.2.0.rc1
- Warranty Fix:
BeforeLeaveEvent::postpone
method not preventing browser URL updates (#3619) - Fixed missing npm install when there are frontend changes pulled from version control to the project (#8182)
For all changes, see changes since rc1
2.2 Feature Highlights
Automatic Node.js and npm installation
- If no global or local Node.js installation is found Node.js will be automatically installed to ~/.vaadin
- Only requires the first project to install as later can use the same installation
- No need to have Node.js installed for CI
- Uses proxy data from
- System properties
- {project}/.npmrc
- ~/.npmrc
- Environment variables
Better frontend dependency management by using pnpm AKA performant npm
- Packages are by default cached locally and linked instead of downloaded for every project
-> Faster recurring builds in comparison to npm (benchmarks) - Only one
package.json
file used, reducing complexity (previously another file was in/target
)
-> More reliable build when updating Vaadin version - No migration needed, see differences here for more information about what has changed
- For running pnpm on a CI server, please see details here
NOTE: npm is still used by default in 14.2, so you need to explicitly enable pnpm
Fire routing life-cycle BeforeEnterEvent
from parent -> child order
This change affects the ordering of routing events and the timeline when routing components are created.
After this change, routing events are fired in the following order:
- Global routing handlers are invoked
setParameter
is invoked for the topmost navigation layer (main layout)BeforeEnterHandler
handler is invoked for the topmost navigation layer (main layout) if implemented- Next level component instances are created, and steps 2-3 triggered for that layer
Before this change, all routing components were created eagerly, and events were fired from child->parent order with first setParameter
invoked, then global handlers and last BeforeEnterHandler
s.
This change fixes a design flaw and prevents developers from accidentally compromising application security when routing components are not created if the end-user does not have access to them.
In case this change would break your existing Vaadin 10+ project, please open an issue.
Minor improvements in 2.2
- Upgrade byte buddy dependency (Java 14 support) (#7918) (beta1)
- Full resynchronization of the client and server (#7631) (alpha14)
- Shortcuts now support multiple components to listen on (alpha13)
- Improve server start-up time in development mode by skipping ES5 transpilation for webpack by default (alpha13)
- Allow setting custom template parser in npm-mode (alpha13)
- It is easier to create forms with "save-as-draft" type of functionality by using
Binder::writeBeanAsDraf(BEAN)
(forward ported from vaadin/framework#11833) (alpha12) - Form bindings can now be triggered between required and non-required state with
setRequiredEnabled(boolean)
(partly fixes #5030) (forward ported from vaadin/framework#11834) (alpha12) HasOrderedComponents
now provides access to the child components withStream<Component> getChildren()
without casting it toComponent
(alpha12)VaadinContext
accepts attributes for storing based on super types withsetAttribute(Class<T>, T)
(alpha12)- In development mode, webpack bundles are not compressed #6662 (alpha12)
- Introduction of
VaadinConfig
andHandlerHelper
for non-servlet environments (replacingServletConfig
&ServletHelper
) (alpha7) - Added
Page.open(String url, String windowName)
(alpha7) - Added
isIpad()
andisIOS()
toExtendedClientDetails
to replace non-workingWebBrowser
versions (both broken for iPads with iOS 13) (alpha7) - Optimized application server memory usage by reducing
stats.json
file size
-> This drops the production stats size for megabundle by default from 40mb to 1.9mb or in Bakery App Starter from 42mb to 686kb (alpha4) - Support for Portlet 3.0 for Pluto portal with an add-on - documentation and demo
Known Issues and Limitations in 2.2
- pnpm is not able to resolve dependencies to git commits with the "short" hash format. See details and workaround from #7406.
Breaking or behavior changes since 2.1
- Exported web components are rendered inside a shadow root to avoid leaking styles into the host page (#5363).
Deprecations since 2.1
com.vaadin.flow.component.ShortcutRegistration::getOwner
is deprecated in favor ofgetOwners
which returns all possible ownerscom.vaadin.flow.router.BeforeEvent::getRouteTargetType
is deprecated in favor ofgetRerouteTargetType
com.vaadin.flow.server.FallibleCommand
is deprecated in favor ofcom.vaadin.flow.server.frontend.FallibleCommand
com.vaadin.flow.server.ServletHelper
is deprecated in favor ofcom.vaadin.flow.server.HandlerHelper
com.vaadin.flow.server.startup.ApplicationRouteRegistry::getInstance(javax.servlet.ServletContext)
is deprecated in favor ofgetInstance(com.vaadin.flow.server.VaadinContext)
- Certain constants that are not meant for public usage in
Constants
are now deprecated
Dependency Updates in 2.2
- Following webpack dependencies have been updated:
- webpack-cli 3.3.0 -> 3.3.11
- webpack-dev-server 3.3.0 -> 3.10.3
- webpack-babel-multi-target-plugin 2.1.0 -> 2.3.3
- copy-webpack-plugin 5.0.3 -> 5.1.1