<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Frontend - Inero Software - Software Consulting</title>
	<atom:link href="https://inero-software.com/tag/frontend/feed/" rel="self" type="application/rss+xml" />
	<link>https://inero-software.com/tag/frontend/</link>
	<description>We unleash innovations using cutting-edge technologies, modern design and AI</description>
	<lastBuildDate>Fri, 11 Mar 2022 11:12:50 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://inero-software.com/wp-content/uploads/2018/11/inero-logo-favicon.png</url>
	<title>Frontend - Inero Software - Software Consulting</title>
	<link>https://inero-software.com/tag/frontend/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">153509928</site>	<item>
		<title>Angular: How to manage back-end long-running asynchronous tasks</title>
		<link>https://inero-software.com/angular-how-to-manage-back-end-long-running-asynchronous-tasks/</link>
		
		<dc:creator><![CDATA[Waldemar Korłub]]></dc:creator>
		<pubDate>Tue, 20 Oct 2020 13:48:28 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Company]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[DeliverM8]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[websockets]]></category>
		<guid isPermaLink="false">https://sandbox-www.devel.inero.com.pl/?p=3080</guid>

					<description><![CDATA[<p>Today we’re going to talk about managing back-end long-running asynchronous tasks in Angular. This term may seem long and scary to you, but don’t freak out. After reading this article you’re going to be familiar with this concept and even be able to handle this use case in your own&#8230;</p>
<p>Artykuł <a href="https://inero-software.com/angular-how-to-manage-back-end-long-running-asynchronous-tasks/">Angular: How to manage back-end long-running asynchronous tasks</a> pochodzi z serwisu <a href="https://inero-software.com">Inero Software - Software Consulting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><br />
Today we’re going to talk about managing back-end long-running asynchronous tasks in Angular. This term may seem long and scary to you, but don’t freak out. After reading this article you’re going to be familiar with this concept and even be able to handle this use case in your own projects.</p>
<h3><span style="color: #511b73;"><b>Why Angular?</b></span></h3>
<p>At Inero Software we are using Angular at the front-end side of most of our projects and that is not without a reason.</p>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<ul>
<li>It is suitable for big software systems because of its component-based architecture which provides a higher quality of code, better maintainability, and code reusability.</li>
<li>Native Typescript support, Typescript means Types and that means safer code.</li>
<li>Angular, unlike other frameworks, is fully stacked with predefined solutions to problems you may approach, you don’t have to think about which library to use for every single implementation case whether it be routing, reactive programming, or making Http requests.</li>
</ul>
<p><img decoding="async" data-attachment-id="1596" data-permalink="https://inero-software.com/?attachment_id=1596" data-orig-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-software-glify-10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-1596 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #511b73;"><b>What’s a back-end long-running asynchronous task?</b></span></h3>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />The easiest way to understand what’s a back-end long-running asynchronous task is to explain it with an example of our product which possesses this kind of task.</p>
<p>At <a href="https://inero-software.com/inero-software-team-work/">Inero Software</a> we are developing a product called <a href="http://deliverm8.com">DeliverM8</a> which is a delivery optimization platform. It has many functionalities but let’s focus on the important one for today&#8217;s article. Imagine that you run a company that is delivering products all around the country. You need a system that would display to you how many products and which products to put onto a truck and also <i>how</i> should they be ordered so that everything fits nicely.</p>
<p>Input requires the following data:</p>
<ul>
<li>How many products should be delivered?</li>
<li>What are their sizes?</li>
<li>Where do they go? (so we know which products should be on the beginning or end of the truck etc.)</li>
</ul>
<p>The output is a 3d visualization which looks like this:</p>
<p><img fetchpriority="high" decoding="async" data-attachment-id="3093" data-permalink="https://inero-software.com/angular-how-to-manage-back-end-long-running-asynchronous-tasks/deliverm8_packing_example/" data-orig-file="https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example.png" data-orig-size="1280,720" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="DeliverM8_Packing_Example" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example-300x169.png" data-large-file="https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example-1030x579.png" tabindex="0" role="button" class="aligncenter wp-image-3093 size-full" src="https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example.png" alt="A visualisation of elements" width="1280" height="720" srcset="https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example.png 1280w, https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example-300x169.png 300w, https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example-768x432.png 768w, https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example-1030x579.png 1030w, https://inero-software.com/wp-content/uploads/2020/10/DeliverM8_Packing_Example-533x300.png 533w" sizes="(max-width: 1280px) 100vw, 1280px" /></p>
<p>As you may imagine &#8211; it does take time for a backend service to create output like this, the AI that stands behind <a href="https://inero-software.com/machine-learning-professionals/">DeliverM8</a> logic runs millions of operations per second in order to find the best optimal available element arrangement. This is <b>the back-end long-running asynchronous task</b>. Depending on the input this may take up to <b>10 minutes </b>and of course freezing of the frontend application until the data is retrieved is the last thing that we need, so what should we do?</p>
<p><img decoding="async" data-attachment-id="1596" data-permalink="https://inero-software.com/?attachment_id=1596" data-orig-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-software-glify-10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-1596 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #511b73;"><b>Approaches</b></span></h3>
<p>A DISCLAIMER: All examples are made with Angular, but the concepts mentioned below can easily be applied to any other frameworks/languages.</p>
<h4><span style="color: #511b73;"><b>Synchronous</b></span></h4>
<p>Probably the worst option out there but should be mentioned nevertheless. If in fact, the user shouldn’t be using the application, while he is waiting for the response, then you can just put some kind of modal loading screen while the user awaits the data and the problem is solved.</p>
<h5><span style="color: #511b73;">How:</span></h5>
<p>You send a single POST request that tells the backend to start the calculations and return the data within the response of the beforementioned request.</p>
<h5><span style="color: #511b73;"><b>Example:</b></span></h5>
<pre>public loadTrucks(loadTruckData): Observable&lt;Route[]&gt; {
return this.http.post&lt;Route[]&gt;('/api/load-trucks', loadTruckData);
}
</pre>
<p><img decoding="async" data-attachment-id="1596" data-permalink="https://inero-software.com/?attachment_id=1596" data-orig-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-software-glify-10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-1596 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h4><span style="color: #511b73;"><b>Polling</b></span></h4>
<p>Now polling is a slightly better option if the user wants to use the application while the data is loading and you don’t have that much time to invest in the solution and/or your backend is not providing you with WebSockets then polling is the way to go.</p>
<p>Polling means checking the status of (a backend endpoint in this case ), especially as part of a repeated cycle. Translating it to front-end language means making a get request every few seconds to see if the asynchronous task is finished. For backend that would mean creating a new GET endpoint that would return the calculated data. (if in fact it has been calculated before)</p>
<p>Not the most elegant solution out there but still pretty usable!</p>
<h5><span style="color: #511b73;"><b>How:</b></span></h5>
<p>We make one POST request that informs the backend to start the calculations and one more GET request to get the output data.</p>
<p>One of the ways of polling is combining RxJs’s <i>timer</i> with <i>switchMap</i>. Also remember to unsubscribe, because all sorts of intervals can easily produce memory leaks, in this example, we are using <i>takeUntil</i> operator that unsubscribes from the observable when it’s component is destroyed.</p>
<h5><span style="color: #511b73;"><b>Example:</b></span></h5>
<pre>timer(0, 5000).pipe( switchMap(() =&gt; this.truckService.getLoadedTrucks()), takeUntil(this.stopPolling) )
</pre>
<p><img decoding="async" data-attachment-id="1596" data-permalink="https://inero-software.com/?attachment_id=1596" data-orig-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-software-glify-10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-1596 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h4><span style="color: #511b73;"><b>Websockets</b></span></h4>
<p>Websocket is a communication protocol (just like HTTP) “for a persistent, bi-directional, full duplex TCP connection from a user’s web browser to a server”. Basically what it means is that with WebSockets you can send out the data from the server and receive it in your frontend application without making any unnecessary requests (like you would using polling).</p>
<p>With the Websocket approach, you would send an HTTP POST request to start calculating the truckload. And at the same time, you would establish a WebSocket connection between the Frontend application and the server so that when the backend tasks finish the output is sent through that WebSocket connection.</p>
<h5><span style="color: #511b73;"><b>How:</b></span></h5>
<p>Send HTTP POST request that informs the backend to start the calculations and listen on Websocket connection with a backend that returns data when the calculations finish</p>
<h5><span style="color: #511b73;">Example:</span></h5>
<p>At first, you connect to a WebSocket:</p>
<pre>public connect() {
const socket = new <b><i>WebSocket</i></b>(this.webSocketUri);
this.stompClient = Stomp.over(socket);
this.stompClient.connect({},
() =&gt; this.subscribe()
}

</pre>
<p>And later on, you subscribe to its values:</p>
<pre>this.stompClient.subscribe('/user/queue/truck-load-updates-queue', (msg: Stomp.Frame) =&gt; {
const msgBody = <b><i>JSON</i></b>.parse(msg.body);
...
});
</pre>
<p>The subscription above is triggered after the calculation is done.<br />
<img decoding="async" data-attachment-id="1596" data-permalink="https://inero-software.com/?attachment_id=1596" data-orig-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-software-glify-10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-1596 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #511b73;"><b>Conclusion</b></span></h3>
<p>That’s it!</p>
<p>I’ve described to you the problem of back-end long-running asynchronous tasks and various ways of handling them in the frontend application.</p>
<p>Websockets are the best way to go if you are struggling with this problem, but if the user doesn’t mind getting his application blocked (or maybe it is intended to block the app for the time being) for the time when the backend is performing its tasks then you can simply go with KISS principle and just make one synchronous request.</p>
<p>Polling is also an option if the developers don’t feel like implementing WebSockets and additional network movement is of no concern.</p>
<p>Thanks for reading! And I hope you liked the article 🙂</p>
<p>Artykuł <a href="https://inero-software.com/angular-how-to-manage-back-end-long-running-asynchronous-tasks/">Angular: How to manage back-end long-running asynchronous tasks</a> pochodzi z serwisu <a href="https://inero-software.com">Inero Software - Software Consulting</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3080</post-id>	</item>
		<item>
		<title>What&#8217;s after Angular?</title>
		<link>https://inero-software.com/whats-after-angular/</link>
		
		<dc:creator><![CDATA[Waldemar Korłub]]></dc:creator>
		<pubDate>Thu, 16 Jul 2020 07:40:35 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Company]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[flutter]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[react]]></category>
		<category><![CDATA[reactivity]]></category>
		<category><![CDATA[svelte]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webassembly]]></category>
		<category><![CDATA[webcomponents]]></category>
		<guid isPermaLink="false">https://sandbox-www.devel.inero.com.pl/?p=2905</guid>

					<description><![CDATA[<p>&#160; The frontend world is currently ruled by 3 colossuses known as Angular, React.js, and Vue.js, but are there any other alternatives? And if so, are they worth using? Let’s take a quick look at what else is out there as we see it in our team. The Standard Besides&#8230;</p>
<p>Artykuł <a href="https://inero-software.com/whats-after-angular/">What&#8217;s after Angular?</a> pochodzi z serwisu <a href="https://inero-software.com">Inero Software - Software Consulting</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>&nbsp;</p>
<p>The frontend world is currently ruled by 3 colossuses known as Angular, React.js, and Vue.js, but are there any other alternatives?</p>
<p>And if so, are they worth using? Let’s take a quick look at what else is out there as we see it in <a href="https://inero-software.com/inero-software-team-work/">our team</a>.</p>
<h3><span style="color: #511b73;"><b>The Standard</b></span></h3>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />Besides Angular (my main go-to when it comes to the frontend development) there is its main rival &#8211; React. <a href="https://www.g2i.co/blog/react-separation-of-concerns">Since React is a library not a framework like Angular, by definition it gives you more freedom when it comes to the composition of your application and development style that you want to approach</a>. React is known for its JSX syntax which allows you to mix javascript with HTML and CSS code.</p>
<p>Vue.js is different from React in this matter. It is structured like web-component so it’s separated into js, CSS, and HTML. Another thing that differs Vue.js from Angular and React.js is its origin. Vue is the only “independent” framework. What do I mean by that? There is no big company behind it like in other cases where Angular comes from Google and React has been created by Facebook. Vue.js is a better choice than Angular and React when you are looking for a small app or a quick MVP development. That is because setting up a project and its configuration in Vue takes much less time than in frameworks mentioned earlier.</p>
<p>Okay, but where’s the new stuff you say? There you go:</p>
<p><img decoding="async" data-attachment-id="1596" data-permalink="https://inero-software.com/?attachment_id=1596" data-orig-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-software-glify-10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-1596 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #511b73;"><b>Web Components</b></span></h3>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />Web components as it states on its website are: “&#8230;a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps. Custom components and widgets build on the Web Component standards, will work across modern browsers, and can be used with any JavaScript library or framework that works with HTML.”.</p>
<p>So essentially what it means is that you can create universal components with Web Components API which you can use with literally any framework (or no framework at all) that supports HTML and these components should work correctly on all modern browsers.</p>
<p>Probably the most popular library for creating web components right now is Polymer.<br />
Polymer is a JavaScript library based on Web Components API created by Google employees.<br />
Most important reasons for why Polymer is favored by Web Components developers are:<br />
• Data binding – Connects data from a custom element to its local DOM element. Both one-way and two-way.<br />
• Polymer CLI – Includes a build pipeline, a boilerplate generator for creating elements and apps, a linter, a development server, and a test runner.<br />
• Conditional and repeat templates – Gives you the ability to use loops and if statements in HTML<br />
And there’s much much more.</p>
<p><img decoding="async" data-attachment-id="1596" data-permalink="https://inero-software.com/?attachment_id=1596" data-orig-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-software-glify-10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-1596 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #511b73;"><b>WebAssembly</b></span></h3>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />A different approach was proposed by creators of WebAssembly which basically allows you to use low-level languages like for example C, C++, and Rust to create web applications by compiling them to WebAssembly binary instruction format – assembly-like language that runs with near-native performance.</p>
<p>You probably wonder how is it possible to develop a web app with this kind of languages. Well, Wasm (WebAssembly) provides you with JS API, which contains all the functionalities that you would need in web development.</p>
<p>So is WebAssembly going to replace JavaScript in the web development world?</p>
<p>Not really. It is more of an addition to the current web technology stack. Wasm should be used in certain situations, and that situations are asset-heavy performance-needing applications. Usually with a lot of computations and 3d dynamic scenes. Here are a few examples of Wasm applications that should give you an idea of what I am talking about: Google Earth, Figma, AutoCad web.</p>
<p><img decoding="async" data-attachment-id="1596" data-permalink="https://inero-software.com/?attachment_id=1596" data-orig-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-software-glify-10" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" data-large-file="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png" tabindex="0" role="button" class="aligncenter wp-image-1596 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png" alt="Separating icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10-80x80.png 80w, https://inero-software.com/wp-content/uploads/2018/11/inero-glify-10.png 208w" sizes="(max-width: 80px) 100vw, 80px" /></p>
<h3><span style="color: #511b73;"><b>Flutter</b></span></h3>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />Another tool on the list is Flutter. Flutter originally was supposed to create mobile applications (and it still does), but in Flutter 1.9 web support has been added.<br />
Flutter uses Dart language and only this one language is used to develop applications for every intention is its frontend, backend, or mobile devices. So in theory your code for a mobile app or web app should not be that much different from each other.</p>
<p>One interesting thing about Flutter is a fact that it has built-in Material Design and Cupertino (iOS styled components) so it comes with a variety of very useful widgets and other advantages that those UI libraries offer (like motion APIs), you can check those out here.</p>
<p>This was just a really brief introduction to different frontend options out there, I’m going to make more detailed insight into those in next blog posts.</p>
<p>Now, at last, but not least:</p>
<h3><span style="color: #511b73;"><b>Svelte</b></span></h3>
<p><img decoding="async" data-attachment-id="2873" data-permalink="https://inero-software.com/digital-twins-a-dynamic-software-model-of-reality/inero-glify-08-2/" data-orig-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-orig-size="208,208" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="inero-glyph" data-image-description="" data-image-caption="" data-medium-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" data-large-file="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png" tabindex="0" role="button" class="alignleft wp-image-2873 size-thumbnail" src="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png" alt="Paragraph icon" width="80" height="80" srcset="https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-80x80.png 80w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08-50x50.png 50w, https://inero-software.com/wp-content/uploads/2019/10/inero-glify-08.png 208w" sizes="(max-width: 80px) 100vw, 80px" />Svelte has been introduced in 2016 by its creator Rich Harris. Stating that it’s going to use a truly reactive approach, but before we get into it let’s quickly describe what Svelte actually is.<br />
Svelte is a JavaScript component framework similar to React or Vue but with a few major differences.</p>
<p>Probably the most important difference is the fact that Svelte does not have a virtual DOM. React and Vue both are using Virtual DOM and because of that, the browser itself has to convert their declarative structures into DOM operations. I won’t go into details of how does virtual DOM works, but basically, what it does it checks the state of the whole application before and after the change and looks for differences in those both states and then applies what’s different to real DOM (this operation is called diffing), sounds like a lot of unnecessary comparisons, right?</p>
<p>Here comes the reactivity.</p>
<p>Svelte unlike React runs at build time which means that svelte code is compiled to imperative code which updates DOM when and where it needs to. This is obviously a big performance boost.</p>
<p>You probably started to wonder why is virtual DOM used by those big frameworks like React or Vue then. I think I can use a quote from the Svelte creator’s blog:</p>
<p>“Virtual DOM is valuable because it allows you to build apps without thinking about state transitions, with performance that is generally good enough. That means less buggy code, and more time spent on creative tasks instead of tedious ones. But it turns out that we can achieve a similar programming model without using virtual DOM — and that&#8217;s where Svelte comes in”</p>
<p>Another thing that Svelte introduces is its own reactive statements which look like this:</p>
<pre>$: console.log(`the count is ${count}`);</pre>
<p>Essentially what it&#8217;s going to do is &#8211; it is going to log the string whenever count property changes and the only thing that you need to do to use it is to put $: in front of a statement which you want to become reactive. To give you a better idea of how is it working I&#8217;m going to create a component in which you can type your first name and last name assign them to fullName property and display it.</p>
<pre class="language-javascript">&lt;script&gt;
 let firstName = '';
 let lastName = ''
 $: fullName = firstName + lastName
&lt;/script&gt;

&lt;input bind:value={firstName}/&gt;
&lt;input bind:value={lastName}/&gt;
{fullName}</pre>
<p>I will not go into details of everything that&#8217;s happening here but what you should know that bind:value is a two-way binding so the properties are being updated while typing in the input. The important part here is the dollar syntax. Thanks to it fullName property is changed at the same moment as user is typing anything in any of those two inputs.</p>
<p>Of course, nothing is stopping you from writing a larger code with dollar syntax. If I wanted to update fullName only if firstName starts with letter &#8220;A&#8221; I could write something like this:</p>
<pre>let fullName = '';
$: {
  if(firstName[0] === 'A') {
      fullName = firstName + lastName;
   }
}</pre>
<p>Now, to display the difference in code written in React (which Svelte is most of the cases compared to) and Svelte. We’re going to create a simple app that is going to display how many seconds passed since it’s creation. (Inspired by Stateful Component on <a href="https://reactjs.org/">React website</a>).</p>
<p>Here’s the code which you would write in those two frameworks:</p>
<p>React:</p>
<pre>class Timer extends React.Component {
    constructor(props) {
      super(props);
      this.state = { seconds: 0 };
    }

    tick() {
      this.setState(state =&gt; ({
       seconds: state.seconds + 1
    }));
    }

    componentDidMount() {
        this.interval = setInterval(() =&gt; this.tick(), 1000);
    }

    render() {
      return (
       &lt;div&gt;
        Seconds: {this.state.seconds}
      &lt;/div&gt;
    );
  }
}

ReactDOM.render(
&lt;Timer /&gt;,
document.getElementById('timer-example')
);</pre>
<p>Svelte:</p>
<pre>&lt;script&gt;
 let seconds = 0;
 setInterval(() =&gt; seconds += 1, 1000);
&lt;/script&gt;

&lt;div&gt;
Seconds: {seconds}
&lt;/div&gt;</pre>
<p>You can see the difference right?<br />
Both of those applications do exactly the same job, but it is immediately noticeable how much code was needed in the React app and also how readable it is with its state, setState, and rendering functions. At the same time, Svelte requires about 8 lines of pretty, easily understandable code to get the task done.</p>
<p>If you are interested in what else Svelte has to offer and to understand better why this framework could be worth trying I deeply encourage you to watch Rich Harris speech.</p>
<p>&nbsp;</p>
<p><iframe title="Rich Harris - Rethinking reactivity" width="1191" height="670" src="https://www.youtube.com/embed/AdNJ3fydeao?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>Artykuł <a href="https://inero-software.com/whats-after-angular/">What&#8217;s after Angular?</a> pochodzi z serwisu <a href="https://inero-software.com">Inero Software - Software Consulting</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2905</post-id>	</item>
	</channel>
</rss>
