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 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 3000 rules that it can apply to make changes to Vaadin Framework and desktop applications.
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 is 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.
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 24. If you are not able to deploy Vaadin 24 in your organization for whatever reason, please reach out to your contact at Vaadin to discuss.
Dragonfly Transpiler does not support the modification of rules or addition of new rules. Your project may benefit from a customization of the default ruleset, however. If this is the case, we encourage you to 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.
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.
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.
There are two ways to perform the transformation process - either on all of the Java files in the workspace or a selection of files that you make in the 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 the Package Explorer is active — not the Project Explorer. Select in the Package Explorer which files and packages 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 will place three log files in the reports
folder of the user home. These 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 will no longer be compatible with your project settings. 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.