You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/upgrading/index.adoc
+119Lines changed: 119 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -872,3 +872,122 @@ Vaadin uses the [filename]`{project directory}/src/main/frontend/` directory as
872
872
== Removed Deprecations
873
873
874
874
APIs deprecated earlier have now been removed. The following linked GitHub issue lists these removals — link:https://github.com/vaadin/flow/issues/21396[Remove deprecated API in Flow 25.0].
875
+
876
+
== Upgrading Add-ons
877
+
878
+
Some add-ons may require updates to work with Vaadin 25. This section gives an overview of the most common required changes.
879
+
880
+
=== Java-based Add-ons
881
+
882
+
This section covers add-ons that provide Flow components implemented in Java.
883
+
884
+
==== JSON RPC Changes
885
+
886
+
Flow's RPC mechanism now uses Jackson 3 instead of Elemental JSON. Using `elemental.json.JsonObject` or `elemental.json.JsonArray` types in the following places is no longer supported:
887
+
888
+
- Passing parameters to `Element.executeJs` or `Element.callJsFunction`
889
+
- Handling parameters from client-side RPC calls in `@ClientCallable` methods
890
+
- Mapping data from custom events using `@EventData`
891
+
892
+
Use the respective Jackson 3 types, such as `ObjectNode` and `ArrayNode`, instead.
893
+
894
+
=== Frontend-based Add-ons
895
+
896
+
This section covers add-ons that provide custom web components implemented in TypeScript or JavaScript.
897
+
898
+
==== Lumo Javascript Modules
899
+
900
+
The Lumo Javascript modules have been removed, as such imports such as the following no longer work and should be removed:
In general these imports were used to ensure Lumo custom CSS properties were defined globally. However, this should not be done by add-ons, but rather by the application that uses the add-on. As such, there is no alternative import to use in add-ons.
913
+
914
+
If the add-on provides a demo HTML page, the Lumo theme can be imported there using a link tag for example:
915
+
[source,html]
916
+
----
917
+
<!-- Assuming the demo HTML page is in a folder such as `demo` in the project root -->
Lumo Javascript mixins have not been removed and can still be used to inject common styles into custom components:
922
+
[source,js]
923
+
----
924
+
import { inputField } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';
925
+
926
+
class MyInputField extends LitElement {
927
+
static get styles() {
928
+
return [
929
+
inputField,
930
+
css`...`
931
+
];
932
+
}
933
+
}
934
+
----
935
+
936
+
==== Lumo Global Typography
937
+
938
+
Previously you could apply the Lumo global typography styles to a custom component's shadow root like so:
939
+
940
+
[source,js]
941
+
----
942
+
import { typography } from "@vaadin/vaadin-lumo-styles";
943
+
944
+
class MyComponent extends LitElement {
945
+
static get styles() {
946
+
return [
947
+
typography,
948
+
css`...`
949
+
];
950
+
}
951
+
}
952
+
----
953
+
954
+
This would result in Lumo styles being applied to text nodes and basic HTML elements (headings, links) in the component’s shadow root.
955
+
956
+
This is not possible anymore in v25, as the respective Typography module has been converted into a CSS file. If you need to apply Lumo typography styles to basic HTML elements in your component’s shadow root then you can copy the relevant styles into your component’s styles.
957
+
958
+
==== Theme Structure
959
+
960
+
Previously, theme-specific component styles and entry-points were located in `theme/lumo` / `theme/material` folders. In Vaadin 24 an import for a component was then resolved to either folder, depending on which theme was applied using the `@Theme` annotation. In Vaadin 25 this mechanism does not work anymore.
961
+
962
+
Regardless of whether the add-on supports multiple themes or not, all styles should be placed in the component's source file by using the `static get styles()` Lit API.
963
+
964
+
If the add-on wants to support the two official Vaadin themes (Aura or Lumo), then the component can implement `ThemeDetectionMixin`, which automatically adds an attribute to the component based on the active theme. This attribute can then be used to target theme-specific styles rules:
965
+
966
+
[source,js]
967
+
----
968
+
import { ThemeDetectionMixin } from '@vaadin/vaadin-themable-mixin/theme-detection-mixin.js';
969
+
970
+
class MyComponent extends ThemeDetectionMixin(LitElement) {
971
+
static get styles() {
972
+
return css`
973
+
:host {
974
+
/* Common / functional styles */
975
+
}
976
+
:host([data-application-theme="aura"]) {
977
+
/* Aura-specific styles */
978
+
}
979
+
:host([data-application-theme="lumo"]) {
980
+
/* Lumo-specific styles */
981
+
}
982
+
`;
983
+
}
984
+
}
985
+
----
986
+
987
+
If the add-on supports custom themes, then styles for those themes can be provided as separate CSS files that an application using the add-on can import.
988
+
989
+
==== Mixins
990
+
991
+
`ThemableMixin` and `registerStyles` are planned to be removed in a future Vaadin version. Consider migrating add-on components to Lit and use the `get styles() { ... }` API to define styles instead.
992
+
993
+
`ControllerMixin` has been removed. If an add-on component relies on controllers it should be converted to Lit which provides the same API natively.
0 commit comments