Image may be NSFW.
Clik here to view.
One of the more exciting technologies of past years is Electron. For those not familiar with Electron, a small background first. Electron was first created to enable the development of Github's Atom editor, which is meanwhile a highly popular a cross platform editor. Via Electron, it was possible to write the Atom editor code once with JavaScript and create desktop applications for Windows, macOS and Linux. Electron consists of the Chromium browser and node.js packaged in a native Windows, macOS or Linux executable. The application code consists of JavaScript, the layout and design of the appliction is equally done with web technologies HTML5 and CSS3. The Electron API meanwhile offers a wide set of bridges to the operating system the executable is running on and most parts of this API is of course fully operating system agnostic. As such, it is possible to use the local file system, use shell dialogs, clipboard access and much more. You can explore the Electron API here.
So, where does TMS WEB Core fit in? As you are aware, with TMS WEB Core, you can create web client applications in an RAD OO component based way. The web client runs JavaScript code that is compiled from your Pascal code. Connecting the dots, this JavaScript client application can of course also run under Electron and as such, offer the ability to have a desktop cross platform application for Windows, macOS and Linux, all with the same code base.
Although it is virtually dead-easy to let any JavaScript web client run via Electron in a desktop application, the real power comes from the bridge to the native operating system. And this means, using the Electron API which is a JavaScript API. As it is TMS WEB Core primary goal to facilitate Delphi developers to continue using the beloved Pascal language and a RAD component based development methodology, we've explored exposing the Electron API via components.
Therefore, during this 8th lab visit, we'd like to present you a first experimental version of a TMS WEB Core application running under Electron. It is a kind of Notepad editor. It uses the TWebMemo as editing control and to open and save text files to the local file system we have introduced TElectronOpenDialog, TElectronSaveDialog and also TElectronStringList. To have access to the application main menu, there is also the TElectronMainMenu. On the main form of the application, it looks like:
Image may be NSFW.
Clik here to view.
The TElectronOpenDialog and TElectronSaveDialog are nearly identical to the VCL counterparts TOpenDialog and TSaveDialog. As such, opening and saving local files from the TMS WEB Core application running as desktop application via Electron becomes as easy as:
Opening a local file:
var sl: TElectronStringList; begin ElectronOpenDialog1.Title := 'Select text file'; if ElectronOpenDialog1.Execute then begin sl := TElectronStringList.Create; sl.LoadFromFile(ElectronOpenDialog1.FileName); Meditor.Lines.Assign(sl); sl.Free; end; end;Saving to a local file:
var sl: TElectronStringList; begin ElectronSaveDialog1.Title := 'Save to text file'; if ElectronSaveDialog1.Execute then begin sl := TElectronStringList.Create; sl.Assign(MEditor.Lines); sl.SaveToFile(ElectronSaveDialog1.FileName); sl.Free; end;This application in action on the Windows operating system looks like:
Image may be NSFW.
Clik here to view.

Now that we have this proof of concept working, it is a matter of further wrapping the full Electron API in easy to use functions, classes, components. And that will enable you to create not only web client applications with TMS WEB Core, but also desktop applications that can be deployed to Windows, macOS, Linux. And this comes with many advantages. To name a few:
- Many existing web technologies can be used & integrated in the desktop application
- The UI look & feel can be created with web technologies, i.e. graphics artists can create the HTML template for you with designs that outshine any classic desktop application design
- A lot of code can be reused between web and desktop application if the company has a strategy for web access + desktop deployment
Lab visit feedback & win!
Our team loves to hear what you think about what is brewing in the lab, how you plan to use the upcoming features, what priority our team should give to it and if you have possibly interesting and/or creative ideas to make this even more powerful for Delphi developers. To reward your interaction & feedback, we'll pick 3 blog comments on October 15 that we liked the most and first prize is a free TMS WEB Core license, the 2nd and 3rd prize is a 50% discount coupon on TMS WEB Core. Let yourself hear to increase your chances!
Get started
Meanwhile, you can go ahead and explore the new & exciting territories of web client development that become available for Delphi developers with TMS WEB Core! You can download the trial version that is generally available, go ahead with the standalone version you purchased or with TMS WEB Core and additional tools that are all included in TMS ALL-ACCESS. Or you can come to see TMS WEB Core and discover and discuss it face to face with Bruno Fierens of tmssoftware.com showing it in London on October 23, 2018. Note also that in October, you can still take advantage of purchasing TMS WEB Core at launch price from 295EUR for a single developer license. From Nov 1, regular pricing will be active on TMS WEB Core (395EUR for a single developer license).