Web development rendering

I do not quite understand the meaning of rendering in the context of web development. When I read about browser architecture, rendering is something like displaying downloaded content from the Internet. On the other hand, there are definitions of client and server rendering (without mentioning the browsers). For example, in the Backbone.View class, we use the render method, which is responsible for connecting data with markup.

Out of the context of web development, there is a Wiki definition:

Rendering is the process of creating an image from a model (or a model in what collectively can be called a scene file), using computer programs. In addition, the results of such a model can be called rendering

How to understand this concept?

Thanks.

+6
source share
2 answers

Rendering is the process of collecting data (if any) and loading related templates (or simply passing the results directly). Then apply the collected data to the related templates. The final output is sent to the user.

This concept is exactly the same for the client and server. In the client, when using Backbone.View, the render method is more like a regular method in which you can put your visualization in it. You can call it draw , this is completely normal. The basic concept of Backbone.View is that you get your data from somewhere (mainly from this.model ) and then load the related templates (from the DOM using $ ('# template-id'). Html () or using the text requirejs plugin to load templates using AJAX requests). Once you have the data and the template, you can use your own template engine and "make" the final output, and then add it to the DOM so that users can see it.

The server will probably do the same, and then send the final output so that the browser can "display" it. However, there are some minor differences. On the client side, you download your templates using ajax requests or from the DOM, on the server side you are likely to download your templates from the hard drive. As for the data, on the client side you get your data using ajax requests or the data is already embedded in the server response (built-in javascript objects). On the server side, you will receive your data from the database (or cache) or from third-party services

+7
source

Studying the various methods of arrays, I came across the word "render" in explaining the understanding of the concept and, by definition, breaking the word in grammatical format: this means to repeat, to give in, to return. You can only return what was collected by extracting "such as data", and display this information back. Hope this helps. 1st answer to the questions.

+1
source

Source: https://habr.com/ru/post/944861/


All Articles