Docs

Documentation versions (currently viewingVaadin 25)
Documentation translations (currently viewingEnglish)

Dragonfly Transpiler

Modernize your application through automated refactoring.

Dragonfly is the engine that applies a preconfigured set of Vaadin Framework-to-Flow or Swing-to-Flow transformation rules to an application. Dragonfly Transpiler is a commercial tool that requires a valid license. The transpiler works by applying the transformation to the full set of sources in the current Maven module or Eclipse workspace, or by applying it to a selection of sources made by the developer in the Eclipse Project Explorer or Package Explorer.

Disclaimers

Dragonfly Transpiler is a simplified, default-setting configuration of the rich and configurable tool used by Vaadin specialists when performing Vaadin upgrades or Swing-to-Vaadin migrations. Dragonfly is a refactoring tool that works using the same approach as your Java compiler to identify the pieces of your source code and resolve in what libraries these pieces are declared. Dragonfly comes with over 10,000 rules that it can apply to make changes to Vaadin Framework and desktop applications. The transformations are deterministic and fully reproducible, and are not subject to AI whims.

Dragonfly has thousands of rules but your application uses libraries that are made up of tens of thousands of APIs and classes. If you discover that Dragonfly has a rule for every API in your application, it is a rare and fortunate coincidence and by no means the default expectation. Most applications get coverage percentages of between 70% - 90%. Still even with a partial solution, many developer teams have found that Dragonfly can significantly reduce the overall effort in a modernization project, reduce the number of errors found by users, increase consistency of the modernized code, and help deliver modernized applications to their users on or ahead of schedule.

The transformation rule coverage for Vaadin 7 and 8 API is already fairly extensive, but there is always room for improvement. If your project relies on features or add-ons that are not yet covered, please reach out to your contact at Vaadin to discuss.

Limitations

All Dragonfly transformation is applied to Java code only. Dragonfly does not change pom.xml files or SCSS files or modify directory structures.

Dragonfly assumes a transformation to the latest Vaadin 25 or 24. Transformation to the latest Vaadin 23 is also supported, although you need to enable it separately. Transformation to older Vaadin versions is not supported.

Dragonfly assumes a transformation from any Vaadin 7 or 8 version. Transformation from other Vaadin versions is not supported.

Dragonfly Transpiler does not support the modification of rules or addition of new rules locally. Your project may benefit from a customization of the default ruleset, however. If this is the case, please reach out to your contact at Vaadin to discuss how this could work. Vaadin has a standard service called "Fine-tuning" where Vaadin experts can quickly extend the ruleset with the rules you require.

Some of the transformation rules don’t perform an actual code transformation, but only add a comment about why there was no automated conversion and what should be done about it. This usually happens when there is no corresponding feature in the target version, or the corresponding feature is used very differently. These situations can also lead to partial transformations where, for example, a method gets renamed to match the new API, but the parameter is now of wrong type and cannot be trivially converted to match. The purpose of those comments is to guide the manual or AI-assisted completion of the upgrade.

If you choose to bypass the commercial helpers, which provide many direct counterparts to Vaadin 7 and 8 features for a smoother transition, a significantly larger portion of the upgrade may need to be completed manually. Feature Pack enables a faster and more reliable upgrade path with fewer behavior changes, and it’s available through the same subscription.

Warning

Dragonfly will modify the source code in your workspace. It is advised to ensure you are working on a safe copy before proceeding. Dragonfly processes all of the files in your workspace or your selection in one single batch. How long this batch takes will depend on how many lines of code you have in your input. Performance will vary depending on the specs of your system but a good rule of thumb to start with is to expect about 10 minutes for each block of 100 000 lines of code.

Requirements

The following requirements apply for both Eclipse and Maven Plug-In versions.

Dragonfly requires JDK 17 for runtime. This does not necessarily mean that your application should compile with Java 17. You can execute Dragonfly on JDK 17 while your application refers to an earlier JDK for compilation.

Dragonfly makes use of Java Development Tools (JDT) from Eclipse Foundation. Minimum required JDT version is 3.34.0. Maven plugin automatically handles this requirement, but Eclipse version consumes JDT from Eclipse environment itself. You can verify your JDT version in Help > About Eclipse > Installation Details. In Plug-Ins tab, search for org.eclipse.jdt.core and verify your version. The earliest Eclipse version that has 3.34.0 by default is 2023-06, so please make sure that you are using 2023-06 or later. Earlier versions may cause unstable behavior or fail to work at all.

Installing

You can install the Dragonfly Transpiler for Eclipse through the Eclipse Marketplace, https://vaadin.com/eclipse, or https://marketplace.eclipse.org/content/vaadin-tools.

Operating

Once you’ve installed Dragonfly, a Migration Menu option appears in the main Eclipse menu.

If you don’t want to use the default configurations, first update your preferences within Settings.. from the Migration Menu.

The transformation process can be performed in two ways - either on all of the Java files in the workspace or a selection of files that you make in the Project Explorer or Package Explorer.

Process entire workspace

Launch the transformation by selecting Transform Swing to Vaadin or Transform Vaadin 7/8 to Vaadin from the Migration Menu.

Process just those files you have selected

Switch your view so that either Project Explorer or Package Explorer is active. Select in the project tree which files, packages, modules, or projects you wish to transform. Then launch the transformation by selecting Transform Selection Swing to Vaadin or Transform Selection Vaadin 7/8 to Vaadin from the Migration Menu.

Verifying Execution

When processing is complete, Dragonfly places three log files in the reports folder of the user home, or another target directory that has been configured within Settings... In current plugin versions some basic status information about the run, as well as the report file locations, are also logged to Eclipse console.

The report files include a changereport and a csvreport that give information on which rules have been executed and how they have changed the sources, and a log file that contains information about execution time for each source in the project.

Finishing

Before your application can successfully build, there are a number of steps to complete manually.

Modify pom.xml or build.gradle

Your changed application is no longer compatible with your earlier project settings, so those needs to be updated. Things to consider include introducing or updating the Vaadin version, updating the Java and Spring versions to match the version required by Vaadin, removing references to old Vaadin addons or Desktop libraries, and adding references to the Vaadin Feature Pack product.

Fix the code

The assumption is that there will be a lot of errors in your code. These should be immediately visible in Eclipse by inspecting the Java problems in the Problems view and by seeing red markings appear in the code window. By analyzing the Dragonfly Transpiler log files and filtering for rules not executed, and by analyzing the error log in the problems view, you can move forward smartly so you can eliminate all errors linked to each non-converted API in one go.