<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vidal Vasconcelos</title>
    <description>The latest articles on DEV Community by Vidal Vasconcelos (@vidalvasconcelos).</description>
    <link>https://dev.to/vidalvasconcelos</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F34475%2Fa00bb5fe-e5b9-45fb-b811-a5f07d195e33.jpg</url>
      <title>DEV Community: Vidal Vasconcelos</title>
      <link>https://dev.to/vidalvasconcelos</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vidalvasconcelos"/>
    <language>en</language>
    <item>
      <title>Creating an application from scratch with Aurelia</title>
      <dc:creator>Vidal Vasconcelos</dc:creator>
      <pubDate>Thu, 17 Jun 2021 20:22:47 +0000</pubDate>
      <link>https://dev.to/vidalvasconcelos/creating-an-application-from-scratch-with-aurelia-71p</link>
      <guid>https://dev.to/vidalvasconcelos/creating-an-application-from-scratch-with-aurelia-71p</guid>
      <description>&lt;p&gt;I was introduced to Aurelia there by 2016, but at the time I did not give much importance, another javascript framework? I do not need this. A lot has changed since then, and my opinion has changed radically on this aspect of the javascript community. I currently love reading about new perspectives and ways of thinking and working with javascript.&lt;/p&gt;

&lt;p&gt;First, let's the definitions, Aurelia is a Javascript framework for creating web applications, mobile, and desktop that takes advantage of simple conventions to empower your creativity. This is the quote from Aurelia's official website, but in fact, it's a collection of modules that will help you create any Javascript or Typescript application.&lt;/p&gt;

&lt;p&gt;Aurelia was created by Rob Eisenberg who created the Durandal and Caliburn and has great similarities with the Angular 2, which is not surprising since Rob worked on the team that developed Angular 2.&lt;/p&gt;

&lt;p&gt;But the big difference between the two is the philosophy of how the developer interacts as the framework. In Aurelia, the conventions are above the settings which leave the developer free to focus on the business rules.&lt;/p&gt;

&lt;p&gt;So let's focus on the code that is what matters most to us, create a folder and boot your git repository and inside it install the dependencies we'll need, running.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now we have a ./node_modules with all of our dependencies, add it to your &lt;code&gt;.gitignore&lt;/code&gt; just to not forget.&lt;/p&gt;

&lt;p&gt;Our app will be a SPA, which means that the browser needs an index to hit and, load all files from application, so let’s create an index.html at the root of our application.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Basically a standard HTML boilerplate, however, if you notice the &lt;/p&gt; tag it contains an unusual property: aurelia-app="main". Yes, like other frameworks, Aurelia also has an entry point where will execute code so by placing this property Aurelia will inject its contents into the DOM and will invoke its start main module.

&lt;p&gt;The main module invoke “boot” basically loads the default settings and switches on the debug mode that will spit the logs on the console.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This file may end up getting complex, but at first, we just need to set root our app.ts, which I prefer to keep in a specific folder called app, the only changes are the path that you pass as a string, but feel free.&lt;/p&gt;

&lt;p&gt;My app.ts basically is a Typescript class, which has a unique string property called message.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Remember the configurations conventions? Simple like this, this class already has bound with my template app.html.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;More before running our app exists a problem, we have not yet configured the Webpack to process our Typescript and Aurelia files. For this to work, let’s now create some necessary files like &lt;code&gt;tsconfig.json&lt;/code&gt; and &lt;code&gt;webpack.config.js&lt;/code&gt;, I will not go into detail about &lt;code&gt;tsconfig.json&lt;/code&gt;, json it deserves a separate post on it.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;It basically informs the webpack which loaders will be responsible for processing each type of file and where we want it to spit out the processed files, which in our case will be the folder at the root of our project.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now let’s run our app…&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_WgLvFlU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qz84ipzk35j386ky8b2y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_WgLvFlU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qz84ipzk35j386ky8b2y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can check the complete code on my Github: &lt;a href="https://github.com/vidalvasconcelos/aurelia-minimal"&gt;vidalvasconcelos&lt;/a&gt; and also the material on which I am based, such as the site &lt;a href="https://aurelia.io/home"&gt;Aurelia&lt;/a&gt; and &lt;a href="https://ilikekillnerds.com/2017/03/creating-minimal-aurelia-typescript-webpack-application-scratch"&gt;Dwayne Charrington&lt;/a&gt; articles.&lt;/p&gt;

</description>
      <category>ts</category>
      <category>aurelia</category>
      <category>scratch</category>
    </item>
  </channel>
</rss>
