The starting point
Therefore, ES6 modules and dependency management involve a great deal of conceptual work. How to divide the code into modules? Where to host the modules? Which modules must be in the public npm registry, and which ones internally only in Artifactory? Which versioning scheme should we use with npm? How to deal with snapshots and locally checked-out modules with multiple dependencies? This last point, in particular, was very hard to find a solution for, and it ultimately resulted in the team deciding in favor of using pnpm.
Once we had defined the migration goal, the team was able to tackle the next step: the migrator.
2. Code migration at the touch of a button
The migrator is a Java program that updates our existing source code automatically and without any substantial manual intervention following the conventions defined in the prototype. Various tasks transform the code and perform jobs such as inserting imports or using the keywords class and extends. Not only does the program update the framework code, but also the project code, which is based on the framework – an important feature for our customer projects.
«We developed the migrator iteratively: During the development, we ran the migration continuously and built and deployed the migrated code, ensuring that we would identify errors quickly, which the developers could then correct.»
André WegmüllerSoftware Engineer at BSI
Problems occurred particularly in those areas where developers had departed from established patterns in the old code. We then analyzed these spots on a case-by-case basis. Depending on the situation, we either corrected and standardized the old code or adapted a migrator task in a way that allowed us to process the relevant code spots.
3. From Eclipse to IntelliJ
In the meantime, part of the team focused on the conversion in the development environment: away from Eclipse and on to IntelliJ. For Eclipse Scout, BSI had developed its own Eclipse plug-ins to be able to work more efficiently. We now had to migrate these plug-ins. Gradually, configuration files and launch configurations were made available for IntelliJ. The team continuously created documentation on topics such as installation, getting started, or key shortcuts to make the switch to IntelliJ as easy as possible. All developers were able to use the workspace with either Eclipse or IntelliJ at any time. To keep maintenance costs low, we will be maintaining only the IntelliJ configurations going forward.
4. Weekend migration
It is only natural that there were some minor problems in the first few days that we needed to resolve. In addition, the switch to IntelliJ involves a big adjustment and a learning curve for seasoned Eclipse users.
«Overall, however, we are happy about the new code, the great IDE support for Web technologies, and the tools we have with the state-of-the-art tool stack.»