Xojo 2020 R1 was released today. The last major release of Xojo came nearly 9 months ago. This much anticipated release has a completely rewritten from the ground up Web API that takes Xojo web applications to a whole new level in terms of look and feel with themes, new controls, and new functionality. This release also brings a ton of new and improved functionality to desktop applications too. Let’s dive into it!
Web 2.0
The elephant in the room in this release is Web 2.0. Web 2.0 is a complete reimagining of what Xojo web applications look like.
Controls galore. Web 2.0 comes with all of the web 1.0 control (see exception below) and a host of new controls that look and feel really nice. Among the new controls: Audio Player, Breadcrumb, Chart, Date Picker, Pagination, Search Field, and a host of specific TextField types like email, number, password, and telephone.
Every standard control (buttons, text fields, etc) have a wide variety of new options that I think will make developers happy. The new WebListbox has monster changes and I really can’t do it justice in this review. Among some of the big additions is the ability to load data dynamically using the WebDataSource. If you’ve used iOS in Xojo it acts pretty much the same way and allows you to have practically unlimited numbers of rows of data and it will load the data as the user scrolls. This means you don’t have to page your data (though you can if you want by loading the data manually in combination with the new Pagination control).
Even more interesting are the new WebListbox Cell Renderer classes. In this release there are four built-in with DateTimeRenderer, ImageRenderer, StyleRenderer, and TextRenderer (the default renderer that doesn’t need any special action on your part). The DateTimeRenderer lets you specify the Date and Time format styles but also a Relative Style (like “Today” and “Yesterday” values with time) and it also localizes the data to the users locale. The ImageRenderer is pretty straightforward to view images, the Style lets you set the style of an individual listbox cell and, of course, the TextRenderer is the default. The WebSDK example comes with a Button Cell and Color Cell renderer too so it should be exciting to see what developers do with for this.
While Web 1.0 had WebStyles they really were hard to use. Web 2.0 uses Bootstrap and that gives you an incredible amount of variety available in your Xojo web applications. While there’s a default bootstrap theme there is no theme editor in this initial release but it’s not so hard to change the theme on your own. One way to change the theme is to go to https://pikock.github.io/bootstrap-magic/, save the css file to your computer, rename the file to boostrap.min.css and add to your project. Users can download pre-made bootstrap 4 themes from bootswatch.com. Unfortunately the IDE doesn’t render these themes very well but it works at runtime.
Web 2.0 projects compile only to standalone now so you no longer have the option of using a cgi version. Xojo Cloud users automatically get load balancers for your applications and you get the same number of application instances as you number of cores on your server plan.
While most of Web 2.0 is very exciting and enticing those that have an existing Web 1.0 project will most likely not be very happy. The conversion process is a one way process and not everything converts. WebAnimator does not have a Web 2 counterpart and WebStyles are completely reimagined so while the compiler won’t complain if your code uses an old WebStyle it’s pretty much ignored. I would even say that the conversion to Web 2 is broken to the point where it would be easier to rewrite your project into Web 2 than it is to try and convert it. Default control heights in Web 2.0 (38 pixels tall but depends on the theme) are considerably bigger than Web 1 (22 pixels) so I find it hard to imagine that most layouts wouldn’t need considerable work to get correct for Web 2.0. It sucks, but that’s the reality of it.
There are some missing parts in the IDE that are disappointing as well. The WebToolbar and WebStyle editors are missing in Web 2.0 but the good thing is that both can be created in code. Web 2.0 does not have control sets implemented at this point.
It’s also disappointing that not all of the Web 2.0 examples are working properly or are so simple as to be useless in learning how to use Web 2.0 (I’m looking at the WebListBox examples). The documentation for Web 2.0 isn’t as clear cut as I’d like too and I disagree with some of the property groupings for the Inspector. For example in a WebLabel and WebLink there are Font properties to set the font properties but a WebTextArea does not have this and you have to manually set them via the Style property. Why does one control have it exposed and another one does not? Xojo has one shot to impress developers with this release and inconsistency is a bad look in my opinion.
Everything Non-Web 2.0
While Web 2.0 is by far the biggest part of 2020 Release 1 but it is not the only important change. Here are some of the highlights.
Desktop Changes
Listbox Header drawing events. New in R1 is ListBox.HeaderBackgroundPaint and HeaderContentPaint. This allows the developer to have total control over the drawing of the headers. Want to draw an image, or change the background color, or even change the sort indicators? No problem now with these two events.
TextArea now has a UnicodeMode that allows you to change the way the control treats characters. The default is Native and that doesn’t change anything. The Characters setting counts by the single character regardless of the byes used and the Codepoints setting counts by number of Unicode Codepoints (bytes) it requires. The Codepoints way is what you’d have to use for an emoji. This is a nice addition from the the old Xojo Framework. They also now have a String.Characters iterator.
For years Xojo developers have had to rely on third party plugins to create PDF documents in Xojo applications. New in 2020 R1 is the PDFDocument class that allows you to create a PDF document fairly easily using simple graphics object commands. PDFDocument does not support transparency so you’ll have to consider the order that you’re drawing items and you might find it hard to create some forms of documents. All in all this is a great addition to the product that many people will like. PDFDocument is available in all targets excepts iOS. It’s not perfect but for many users it will be good enough and hopefully they’ll add some features to it in future releases.
Linux applications now have a Normalize Control Sizes build option. It normalizes the controls widths/heights, removing theme specific padding and adjustments to make controls on any Linux distribution look similar.
XojoScript’s can now be saved in their compiled form into a MemoryBlock and that means you can read and write them to a file. This should allow XojoScripts to be considerably faster since they may not have to be recompiled every time they’re used. If you use XojoScript I think you will really like this feature.
HTMLViewer has a new event called JavaScript request that gets raised when using the ExecuteJavaScript and ExecuteJavaScriptSync methods. This should eliminate the need to use third-party code to do the same thing.
Project loading and compiling of desktop applications is considerably improved. In my testing it’s about the same speed as Xojo 2019 R1.1. Gone is the slow down users experienced after they did a check project.
There are dozens of other bug fixes and changes that I could tell you about but I’ll leave the joy of reading the release notes to you. Why should I have all that fun?
Overall Impression
Xojo 2020 R1 is a huge release that’s been in the making for long time (if we’re being honest the wait was too long). Web 2.0 has a lot of exciting new features, controls, theming options that should excite developers. Converting projects is very hard and I think learning the new controls is harder than it needs to be with incomplete documentation and examples that are either not working or weak. I really don’t have a real good feel for how stable Web 2 is simply because I’m not working on any web projects currently. I suspect that there are bugs to be found as more people start stress testing it. But it’s a good start and I look forward to the missing pieces being filled in as time goes on.
Obviously Web 2.0 is the big star of this release but the PDFDocument class is a great addition that users have been asking for years. The other bug fixes and changes are also big and even if you aren’t a Xojo web developer this is a big and important release. I’ve been using R1 for desktop apps (Mac and Windows only) and I’ve found it to be stable and I have no complaints (other than no being able to turn off API 2 items).
What say you Xojo developers? Is Web 2.0 worth the wait? Is is stable? What do you think it’s lacking? What do you think about the desktop changes?