Limitations of MPR
- Legacy Components & Layouts
- Custom UIs
- Multiple UIs Not Supported
- VaadinServlets Not Supported
- Latest Extended Maintenance
- Changing Legacy Themes
- No ViewScope
UI.getCurrent()
- PhantomJS
- Java 8+
- Old Browsers
- Vaadin Board
- Z-Indexes
Using MPR in your project to port a legacy application to Vaadin Flow has some known limitations. This is the current list of those limitations. However, these limits and list may change over time as new features are implemented.
Legacy Components & Layouts
It’s possible to add a legacy component to a Flow layout, but not a Flow component to a legacy layout.
The LegacyWrapper
class and the HasLegacyComponents
mixing interface only work for adding legacy components or views in a Flow layout, and not the other way around.
Custom UIs
Custom UIs are supported, but not building the application in there.
Custom legacy UIs can be used to host configuration settings, but can’t be used as a layout. You need to convert your UIs layouts to be in components, and then wrap them with a LegacyWrapper
and add them to a Flow layout. Custom UIs can be used as long as they extend MprUI, the root navigation target is annotated with @LegacyUI(*.class)
and you don’t use UI.setContent();
.
Multiple UIs Not Supported
Additionally, because of the need of the MprUI
, multiple legacy UIs aren’t supported. They need to be converted to a legacy layout and then wrapped in a LegacyWrapper
for Flow to use them.
This means, for example, that TouchKit doesn’t work with MPR.
VaadinServlets Not Supported
MPR has a special servlet called, MprServlet
. It knows how to map each request to the appropriate framework. This makes legacy VaadinServlets unusable in an application controlled by the MPR. If you need custom functionality, you can use the VaadinServlet provided by Flow instead.
See Flow documentation on Dynamic content for details.
Latest Extended Maintenance
The latest Vaadin 7 or Vaadin 8 extended maintenance version Is required. Multiplatform Runtime is only supported when using the latest version of Vaadin 7 or Vaadin 8, which are only available to customers who have purchased Extended Maintenance. See releases and pricing for details.
== CDN & FETCH
CDN and FETCH aren’t supported for the widget set mode.
When using MPR, you can’t use a Content Delivery Network (CDN) for the widget set. As a result, the following configuration should be removed from the pom.xml
file:
-
<vaadin.widgetset.mode>cdn</vaadin.widgetset.mode>
or -
<vaadin.widgetset.mode>fetch</vaadin.widgetset.mode>
Changing Legacy Themes
Runtime changing of the legacy theme isn’t supported. When using the @MprTheme
annotation, the legacy theme is set at startup time. It can’t be changed dynamically after the application has been started.
No ViewScope
No ViewScope in Flow Spring add-on. The Vaadin 14 Spring add-on doesn’t have a feature comparable with @ViewScope
. When using MPR with Spring, that scope isn’t supported. Use @RouteScope
instead.
UI.getCurrent()
The UI.getCurrent()
is no longer automatically inherited into the spawned thread.
This code no longer works when running with MPR:
button.addClickListener(event -> {
new Thread(() -> {
UI.getCurrent()
.access(() -> Notification.show("Hello from thread"));
}).start();
});
As a workaround, store the value of UI.getCurrent()
in a variable inside the click listener. The thread can then use this:
button.addClickListener(event -> {
UI ui = UI.getCurrent();
new Thread(() -> {
ui.access(() -> Notification.show("Hello from thread"));
}).start();
});
PhantomJS
PhantomJS isn’t supported. The PhantomJS project is no longer maintained, and Flow doesn’t officially support it. Old Vaadin projects that rely on PhantomJS should use alternatives when using MPR, such as headless browsers.
Java 8+
Java 8+ is required. Since the application managed by the MPR is a Flow application, it requires Java 8+ runtime to work.
Old Browsers
Old browsers aren’t supported. Browser support for MPR applications is based on the running Vaadin version. For Vaadin 14, those include Internet Explorer 11 with transpilation, and evergreen browsers (the latest versions of Chrome, Firefox, Opera, Safari and Edge). For Vaadin 15 and newer, IE11 and Safari versions older than 13 are no longer supported.
Vaadin Board
Vaadin Board 1.1.0 isn’t supported. Since Vaadin Board 1.1.0 requires Polymer 2, and Vaadin 24.5.8 requires Lit, Vaadin Board isn’t compatible with Vaadin 24.5.8 and can’t be used as a legacy component.
Z-Indexes
Z-indexes of the modern Vaadin Design System aren’t aligned with legacy. Components using overlays and popups in Vaadin 7 and Vaadin 8 are organized in different z-indexes from similar components in the modern Vaadin Design System. Thus it’s possible that some combinations of them don’t work.
For example, using such Vaadin 7 and 8 components with LegacyWrapper in Dialog may not work as expected.
A05C0162-8020-48AA-BF0D-D29D1F6CAEF1