Xojo 2019 Release 2.1 hit the web today. If you are using R2 and any of API 2.0 this dot release is a must for you. I almost would have almost preferred this release to be called R3. The biggest change in Release 2.1 is that the API 2.0 events have been dropped from API 2.0 entirely. There are also quite a few other changes and bug fixes that might impact your projects too.
Removal of the API 2.0 events was a concession to the 3rd party Xojo market (myself included). There really was just no tenable way for Xojo developers to support both the old and new events simultaneously and after much lobbying and teeth gnashing they were removed.
If you had implemented the new Events the R2.1 IDE will rename them back to the old events. This is a good feature, but I’m always leery of the IDE changing code on me without my knowledge. I recommend making a backup of your project before using this release.
Not everything is perfect with API 2.0 as it’s still hard to provide backwards compatibility with versions of Xojo prior to R2.1. All of the new API 2.0 Properties and class Methods are significantly different and permanently change your source code that is not compatible with pre-API 2.0 versions of Xojo. To help with this Xojo has added a new compatibility flag under the Gear icon in the Inspector that works with classes and properties. You can check if the Object, Method, or Property is API 1 or API 2 compatible.
Really, these flags should be titled XojoVersion < 2019.021 and XojoVersion >=2019.02.1 to make it more clear. But in reality this means that a Xojo developer must be using Xojo 2019 R2.1 or better to take advantage of these flags. To be honest I’m still unclear on how these flags really work and the documentation regarding them is sparse.
Another change is a new menu option called Analysis Warnings under the Project Menu. This dialog lets you pick and choose which warnings to see when you Analyze your project. If you set “Item X is deprecated. You should use Item Y instead,” to false you will no longer receive the API 2.0 deprecation warnings. This is set to false by default so you won’t receive the deprecation warning unless you go looking for it.
The FolderItem class has new methods: CreateFolder, CopyTo, MoveTo, and Open that now raise exceptions.
Window.Controls is now Iterable and you can use them in a For Each Loop to iterate through all controls on a window.
The DateTime class now has an optional parameter that lets you specify the TimeZone.
There are ton of bug fixes. Here are some of the highlights:
The IDE no longer crashes on macOS 10.15 (Catalina) when clicking on a color swatch in the Inspector and then navigating to another control before closing the color picker.
RemoveAllRows no longer crashes the application under certain circumstances.
The Database Editor no longer throws exceptions when dropping table columns.
They fixed a number of memory leaks. This includes (but probably not limited to) ODBCDatabase when binding parameters to prepared statements, MSSQLServerDatabase when using Prepared statements. When database objects go out of scope or are set to nil.
There are numerous examples of Deprecations with Replacement warnings now working properly with various classes. Constants have been replaced with more enums and so on. There’s just a boatload things working better with API 2.0.
In general if you are already using R2 then you MUST upgrade to R2.1. If you’re not using R2 then I still suggest waiting for at least another cycle since more bugs will be found and probably a few more things tweaked.
If you feel like you’ve wasted your time with R2 I feel your pain. The whole R2 cycle was really long yet API 2.0 was rushed through without much thought about the existing Xojo community and ecosystem despite attempts at communicating this information. I just don’t see the benefits of disrupting the entire user base, 3rd party ecosystem, not to mention 20 years of documentation, internet search engine results and so on, for what, in my opinion, are arbitrary and meaningless name changes. Some of the name changes make little sense but that’s a different argument that I’ve made before.
Personally, I would have appreciated the approach that they took with the URLConnection class that replaced HTTPSocket. It was a new class and you didn’t have to use it. It is using the new style exceptions rather than relying on error codes and it is a complete break from the old class. They did this with DateTime and RowSet and I’m fine with those. But having FolderItem (and other classes) now doing double duty depending on *how* you create them is a long-term support disaster.
So there you go Xojo coders. Xojo 2019 R2.1 is out and it’s better than R2 and has major changes that make our lives a little easier. What are your thoughts about Xojo 2019 R2.1?
[Edit] Apparently the Analysis Warnings dialog is NOT new. I’ve just never noticed it and, until now, I guess I’ve never needed to care.