Writing asynchronous applications in Node.js can be hard to learn, but except for some really simple cases, it cannot be avoided. Accessing a database is an example of an operation which is asynchronous by nature. It means that you have to wait for the results of a query, but while waiting, your program will continue to execute. For example, it can do some calculations or send another query to the database in parallel.
In a traditional, synchronous programming language like PHP, you could simply write:
$result = $connection->query( 'SELECT * FROM users WHERE id = 1' );
Tips for enhancing a traditional PHP/MySQL web application with a Node.js service.
While most of the web runs on the traditional PHP/MySQL stack, many new websites and web application use newer technologies, such as Node.js. A few years ago I wrote about the advantages of a solution which combines these two approaches, but I didn’t provide much technical details. In this article I will write about some technical challenges that you will face when implementing and deploying such solution, but first let’s briefly recap the most important reasons why such hybrid approach might be a good idea.
There are many…
A practical guide for deploying web applications from the git repository for developers.
The times where deploying an application to the server was done simply by copying files over FTP are long gone. Today there are many integrated CI/CD solutions which automate the deployment process and isolate you completely from the hardware and operating system. However, there are situations where you need more control over the infrastructure. If you prefer to host your web applications on a physical server or a cloud-based virtual machine, you may need to set up the deployment process on your own.
Many small development teams…
The mechanism of slots in Vue.js makes it easier to create universal, reusable components. Slots are very powerful and at first may seem hard to use, especially the more advanced variants. In this article, I will present a reusable grid component using scoped slots with dynamic names, but to make it easier to understand, I will start with some simpler examples.
If you’re using Vue.js, you probably already know the simplest kind of slot — the default slot:
Such slot is simply a placeholder for the component’s content. …
One of the things that I like about the Nuxt framework is its automatic routing capability. You just have to put all you page components into an appropriate folder structure and everything just works; you don’t have to write the rules for vue-router manually.
Recently I started working on a new project based on Vue.js and I wanted to do something similar, but for various reasons I didn’t want to use Nuxt. I found the vue-auto-routing package which was exactly what I was looking for. It’s essentially a small webpack plugin which automatically generates the routing configuration based on the…
Error handling is often an afterthought, something that is implemented late in the development cycle, sometimes even when the application is already running in production. But including error handling early in the design stage has many benefits. It makes development, testing and debugging easier, it also helps create a better user experience.
In a typical single page application, errors can be divided into ones that occur on the server side, in the API layer, and those occuring on the client side, in the front-end application. Of course they are connected and must be handled in a consistent way. …
It’s hard to imagine a modern web application without SVG graphics in the form of icons, logos and other elements of the user interface. A few years ago the typical way of managing SVG images was to use special web fonts which served as collections of icons, for example glyphicons. But these fonts usually contain a lot of icons that you don’t need. Today, the best and most efficient approach is to simply insert SVG images inline into the HTML markup.
When you use a front-end framework like Vue.js, it’s important to realize that a piece of SVG is not…
One thing that I’ve always liked about languages like PHP is that when you modify the code, you can immediately see the results — without recompiling or restarting the application.
Vuido is a framework for creating native desktop applications based on Vue.js. Application using Vuido can run on Windows, OS X and Linux, using native GUI components, and don’t require Electron.
I created the first prototype of Vuido a few months ago, simply to find out if it’s possible to use Vue.js in a desktop environment, and to get some early feedback. You can read about this prototype in my previous article. Since then, Vuido received almost 5,000 stars on GitHub and the early prototype turned into a pretty functional and stable version.
However, an important piece of the puzzle…
An introduction to Vuido, a framework for creating lightweight, native desktop applications using Vue.js. Application using Vuido can run on Windows, OS X and Linux, using native GUI components, and don’t require Electron.
Of course there is Electron and NW.js. They are great for creating large applications with complex user interface. But applications using those frameworks are in…