Hybrid app implementations have enhanced the ability of web developers to deliver desktop apps. Despite this, there is a downside — with increased flexibility, developers run the risk of decreased performance and increased memory consumption. This is because desktop apps run application code locally on your machine. Unfortunately, the future of desktop apps still lies in native code, and because of this, we cannot compromise on the performance and memory usage.
That said, however, there are tradeoffs developers can make. We can reuse front-end developer knowledge to build desktop apps using web technologies via Electron.
How can I create a Sencha Boilerplate application?
To get you started with Sencha Ext JS conveniently, the Sencha CMD provides a starter app that contains the minimum boilerplate code to kickstart your application development process with Ext JS. To create the starter app, run the following command in your terminal.
sencha -sdk <path-to-ExtSDK> generate app -classic StarterApp ./senchaelectrontutorial
How can I create a dedicated Electron app directory inside the Sencha project?
To create an Electron app inside your Sencha Ext JS project, you will need to build the application using Sencha CMD from your Sencha starter app directory. The following command builds the Sencha application and puts the build inside the electron/app directory within the starter app directory.
sencha app build -des electron/app
What is an easy way to install dependencies in my Electron app?
In order to install dependencies inside your Electron app using npm, you need to create a package.json file inside the electron directory. Once that is done, go ahead and install the dependencies for your Electron app using npm.
npm install electron-prebuilt -save
npm install electron-packager --save-dev
How can I create an executable file for my Electron application?
So far, we have seen how to create an Electron app using the Sencha Ext JS application framework. Using this basic starting point, you can build to create a much more meaningful and usable app for your use case.
After developing the app, you will need to create its executable file to run it as a desktop application. You can package your Electron app into an executable file using the npm command below.
npm run-script package
As you can see, creating an Electron-based desktop application with Sencha ExtJS is pretty easy and quick. Electron and ExtJS work together very well and are highly recommended to create both simple and complicated desktop applications with a seamless user experience.
Ready to get started with Sencha Ext JS? Head over to Sencha Ext JS and create your own desktop apps with Sencha and Electron now.