<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[hello JS - Medium]]></title>
        <description><![CDATA[A JavaScript community where you can learn and grow as a developer. Join helloJS, embrace JavaScript! - Medium]]></description>
        <link>https://medium.com/hello-js?source=rss----3dddcca454bf---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>hello JS - Medium</title>
            <link>https://medium.com/hello-js?source=rss----3dddcca454bf---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 12 Nov 2026 20:54:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/hello-js" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introduction to Ionic 4]]></title>
            <link>https://medium.com/hello-js/introduction-to-ionic-4-d0f4f1ad6bdc?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/d0f4f1ad6bdc</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ionic]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[hybrid-app-development]]></category>
            <dc:creator><![CDATA[Jscrambler]]></dc:creator>
            <pubDate>Mon, 11 Feb 2019 09:50:40 GMT</pubDate>
            <atom:updated>2019-02-11T09:50:40.295Z</atom:updated>
            <content:encoded><![CDATA[<figure><a href="https://blog.jscrambler.com/introduction-to-ionic-4/?utm_source=medium.com&amp;utm_medium=referral"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CcUktE8K6mA2MULJ.jpg" /></a></figure><p>In this post, we’ll introduce Ionic 4, learn about its new features and finally show you how to install and use the Ionic CLI v4 to generate a new Ionic project based on Angular 7.</p><p>We’ll also introduce the new Ionic 4 ecosystem comprised of new tools like <strong>Stencil</strong>, <strong>Capacitor</strong> and modern browser technologies such as web components, shadow DOM and CSS variables.</p><p>Ionic 4 is the latest version of Ionic and the best Ionic yet! It’s a mobile UI library that embraces modern browser technologies but also the new Angular 7 tooling and features.</p><p>Ionic 4 lets you use your preferred JavaScript or TypeScript front-end library or framework such as Angular, Vue, Preact, React or jQuery to build mobile applications so you are no longer forced to use TypeScript and Angular.</p><p>While Ionic is now framework-agnostic, Ionic developers that still want to use Ionic with Angular will get support from the Ionic team with the ionic/angular package, just like Ionic 3 and the previous versions.</p><p>Now, let’s introduce the technologies behind the new Ionic.</p><h3>Stencil</h3><p><a href="https://stenciljs.com/">Stencil</a> is an open-source tool created by the Ionic team to help them easily build the Ionic Core with standard compliant web components.</p><p>Stencil is a web components compiler which allows you to use framework-like constructs such as <a href="https://stenciljs.com/docs/templating-jsx/">JSX templates</a>, <a href="https://stenciljs.com/docs/router">routing</a>, data binding and TypeScript classes and decorators to easily build web components — but your final application is completely based on web components that run natively on modern browsers.</p><p><strong>The new Ionic uses Stencil behind the curtain — which means you don’t need to use it when developing Ionic apps but you can use Stencil to author web components or create full Progressive Web Apps with or without the Ionic UI components.</strong></p><h3>Web Components</h3><p>Web components are a series of standards defined by the W3C. They allow front-end developers to build components that are natively interpreted by modern web browsers.</p><p>Among the technologies related to web components are <strong>Custom Elements</strong> and <strong>Shadow DOM</strong>.</p><h3>Custom Elements</h3><p>Using <a href="https://html.spec.whatwg.org/multipage/scripting.html#custom-elements">Custom Elements</a>, you can extend HTML and create new tags or reuse and extend the components authored by other developers. This native browser API is the base of <a href="http://webcomponents.org/">web components</a>. It provides a native way of creating reusable components using vanilla JavaScript with HTML and CSS.</p><p><strong>Thanks to Custom Elements, we can re-use Ionic UI components in modern web browsers natively without any frameworks or run-times.</strong></p><h3>Shadow DOM</h3><p><a href="https://www.w3.org/TR/shadow-dom/">Shadow DOM</a> is another native browser API that allows the encapsulation of DOM elements and CSS styles independently from the other code in an HTML document. It provides a way to attach a hidden DOM (called <strong>shadow root</strong>) to an element using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow">Element.attachShadow()</a> method.</p><p><strong>Using Shadow DOM helps to easily consume Ionic UI components from any web application by encapsulating the CSS styles.</strong></p><h3>CSS Variables/Custom Properties</h3><p>Just like typical programming languages, where variables are used to hold typed values, they can similarly be used to store values in CSS such as colors, widths, heights and font properties, among others. Developers are now able to define <strong>CSS variables</strong>, then reference and reuse them throughout the document. They can also be accessed from JavaScript which can be further explored to add advanced features such as dynamic theming. Although most developers call them CSS variables, they are actually <strong>Custom Properties</strong>.</p><p><strong>In Ionic, CSS Variables are the core of the components theming. Developers can easily modify the overall look and feel (or themes) of the application UI just by changing a few variables, without resorting to Sass and complex build tools</strong>.</p><h3>Ionic Native</h3><p><a href="https://ionicframework.com/docs/native/">Ionic Native</a> provides a TypeScript wrapper for Cordova plugins for easily adding native device (Android and iOS) functionalities into your Ionic mobile application. It’s basically a set of community maintained plugins.</p><p>Starting with version 5, <strong>Ionic Native</strong> is also framework independent. That means you can now use the wrappers outside of Angular. Check out the new <a href="https://beta.ionicframework.com/docs/native/">Native API Docs</a>.</p><h3>Migrating to Ionic 4</h3><p>You can migrate your existing Ionic 3 application to Ionic/Angular v4 by following the <a href="https://beta.ionicframework.com/docs/building/migration/">migration guide</a> and use this <a href="https://github.com/ionic-team/v4-migration-tslint">official migration tool</a> by Ionic which automatically detects most of the <a href="https://github.com/ionic-team/ionic/blob/master/angular/BREAKING.md">breaking changes</a> and automatically fixes some issues.</p><h3>Generating a New Ionic Project with The Ionic CLI</h3><p><a href="https://github.com/ionic-team/ionic-cli">The Ionic Command Line Utility or CLI</a> is the official and primary tool — provided by the Ionic team — to create and build mobile apps based on Ionic and Cordova (or also Capacitor).</p><p>You can use the Ionic CLI to generate a project based on many starters. It is also used for:</p><ul><li>serving apps locally;</li><li>running apps in emulators or actual devices;</li><li>building the final packages;</li><li>generating various features such as pages;</li><li>connecting to Ionic Pro services.</li></ul><p>The Ionic CLI v4 comes with new features, such as experimental support for <a href="https://capacitor.ionicframework.com/">Capacitor</a> — a new alternative to Cordova built by the Ionic team to create cross-platform apps for mobile (Android and iOS), desktop (thanks to <a href="https://electronjs.org/">Electron</a>) and the web (as <a href="https://developers.google.com/web/progressive-web-apps/">PWAs</a>).</p><figure><a href="https://blog.jscrambler.com/protecting-hybrid-mobile-apps-with-ionic-and-jscrambler/?utm_source=medium.com&amp;utm_medium=referral"><img alt="" src="https://cdn-images-1.medium.com/max/720/0*dvQ4ZWX4_PzFrPsd.jpg" /></a></figure><h3>Installing The Ionic CLI v4</h3><p>To generate Ionic/Angular v4 projects, you need to install the Ionic CLI v4. Before installing the CLI, make sure you have the following requirements:</p><ul><li>The latest version of Node.js and npm. You can run node --version to check if Node.js is installed. If not, simply head to the <a href="https://nodejs.org/en/download/">official website</a> and grab the binaries for your system.</li><li>If you want to target Android, you also need Java and Android SDK installed. You can download JDK 8 from the <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">official website</a> and Android Studio — which is used for downloading the Android SDK — from its <a href="https://developer.android.com/studio/">official website</a>. Also, make sure you configure environment variables such as ANDROID_SDK_ROOT.</li><li>If you want to target iOS, you need to have a macOS with the <a href="https://developer.apple.com/xcode/">Xcode</a> IDE. You can download Xcode from the <a href="https://developer.apple.com/download/">official website</a> or through the Apple Store.</li></ul><p>Now, you can install the Ionic CLI globally from npm using the following command:</p><pre>npm install -g ionic</pre><blockquote><em>Depending on your npm configuration, you may need to use </em><em>sudo on Linux/Mac or use an Administrator command prompt on Windows if you want to install packages globally.</em></blockquote><h3>Creating a New Project</h3><p>After installing the Ionic CLI v4, you can create a new Ionic project using the ionic start command and specifying the name and a starter template such as:</p><ul><li>the <em>blank</em> starter: A blank project with one home page;</li><li>the <em>tabs</em> starter: A simple project with tabs;</li><li>or the <em>sidemenu</em> starter: A simple project with a side menu.</li></ul><p>You also need to specify the type of framework to use with the --type=angular option, which is new in the Ionic CLI v4 (for now, the CLI supports only Angular).</p><p>Head over to your terminal and run the following command:</p><pre>ionic start myApp blank --type=angular</pre><p>The CLI will ask you if you want to integrate Cordova. Answer Yes if you want to target native iOS and Android or No if you just want to create a Progressive Web App with Ionic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/0*nemKUdsBRR73XTZq.png" /></figure><p>This is a screenshot of the directory structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/319/0*sXdPTB_exXGdMeCH.png" /></figure><p>Most work you’ll do will be inside the src/app/ folder, which contains the root app component and module and any other directories for pages and components.</p><h3>Serving the Application</h3><p>You can run and debug your Ionic application right in the browser using the ionic serve command. This is one of the benefits of hybrid mobile development — you don&#39;t need to use emulators or actual mobile devices until you need to test native device features (presuming you can&#39;t mock the feature in the browser).</p><p>Head back to your terminal, navigate inside your project and serve your application using:</p><pre>cd myApp<br>ionic serve</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qf58qlSu0XKEMgmJ.png" /></figure><p>Your application will be available from localhost:8100.</p><p>You can also use the <a href="https://beta.ionicframework.com/docs/cli/build">ionic build</a> command for building the final application. Check all the available commands from the <a href="https://ionicframework.com/docs/cli/">docs</a>.</p><h3>Conclusion</h3><p>In this post, we introduced the new Ionic 4 library and its new ecosystem, which comprises the tools and technologies behind the new powerful features. We also installed the Ionic CLI v4, created and served a new project based on Angular. Similarly, you should now be able to create a new Ionic 4 app and use the Ionic CLI v4.</p><p><strong>If you’re building Ionic applications with sensitive logic, be sure to protect them against code theft, tampering, and reverse-engineering by following </strong><a href="https://blog.jscrambler.com/protecting-hybrid-mobile-apps-with-ionic-and-jscrambler/?utm_source=medium.com&amp;utm_medium=referral"><strong>our guide</strong></a>.</p><p><em>Originally published on the </em><a href="https://blog.jscrambler.com/introduction-to-ionic-4/?utm_source=medium.com&amp;utm_medium=referral"><em>Jscrambler Blog</em></a><em> by Lamin Sanneh.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0f4f1ad6bdc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/introduction-to-ionic-4-d0f4f1ad6bdc">Introduction to Ionic 4</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[14 JavaScript Conferences in 2019 Every Developer Should Attend]]></title>
            <link>https://medium.com/hello-js/14-javascript-conferences-in-2019-every-developer-should-attend-e61f64c12905?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/e61f64c12905</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Jscrambler]]></dc:creator>
            <pubDate>Fri, 11 Jan 2019 12:13:34 GMT</pubDate>
            <atom:updated>2019-01-11T12:13:34.400Z</atom:updated>
            <content:encoded><![CDATA[<figure><a href="https://blog.jscrambler.com/14-javascript-conferences-in-2019-every-developer-should-attend/?utm_source=medium.com&amp;utm_medium=referral"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LcBx7-C1WnSC2jtF.jpg" /></a></figure><p>JavaScript is now stronger than ever. The numbers say it all: JavaScript developers are the <a href="https://stackify.com/popular-programming-languages-2018/">second most sought-after</a> (going head to head with Java) and <a href="https://octoverse.github.com/projects">JS completely dominates GitHub</a> in terms of pull requests.</p><p>Part of the reason behind JavaScript’s success is its active community. JS developers are masters in collaboration, not only in terms of pull requests but also by <strong>setting up meetups and conferences</strong>. With JS frameworks surging in popularity, they now have their own conferences across the globe.</p><p>As a JavaScript developer, you should really consider attending some of these conferences. In this article, we highlight 14 unmissable JavaScript Conferences in 2019, ordered by date.</p><h3>EmberConf</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/0*PWyxtcQMDUts48DG.png" /></figure><p>This Ember.js conference is “a gathering of the uniquely ambitious”. The 3-day event brings to stage the Ember Core team, leading community contributors and the visionaries that keep shaping Ember’s horizon.</p><p>If the event is anything like the framework, expect it to be solid, well-mannered, and a place to get things done.</p><ul><li>March 18–20 | Portland, OR, USA</li><li><a href="https://emberconf.com/">Website</a> | <a href="https://twitter.com/emberconf">Twitter</a></li></ul><h3>VueConf US</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*SCcDS48GtvR36kG6.png" /></figure><p>Vue has been a <a href="https://madewithvuejs.com/github-star-history">GitHub rising star</a> since 2017. Many have dubbed it the React-challenger and its community has grown into a thriving one. VueConf US goes beyond talks, challenging developers to present their projects in lightning talks and participate in workshops.</p><p>In case you’re building with Vue (or planning to), don’t miss the chance to hit Tampa and join in the fun.</p><ul><li>March 25–27 | Tampa, FL, USA</li><li><a href="https://us.vuejs.org/">Website</a> | <a href="https://twitter.com/vueconfus">Twitter</a></li></ul><h3>ng-conf</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/0*v6yEwrer4p61_xng.png" /></figure><p>“The world’s biggest Angular conference”, ng-conf quickly leads attendees from dev mode to full-on party mode. In 2018, the event’s <a href="https://www.youtube.com/watch?v=dIxknqPOWms">opening keynote</a> revealed new Angular features, and the after parties included a movie night and the famous ng-party.</p><p>ng-conf truly sets itself apart from other events by challenging attendees to engage with several “UnConference” activities, including an escape bus, ng-yoga, and countless quests.</p><ul><li>May 1–3 | Salt Lake City, UT, USA</li><li><a href="https://www.ng-conf.org/">Website</a> | <a href="https://twitter.com/ngconf">Twitter</a></li></ul><h3>React Europe</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*eVnUGCGNazulP24y.png" /></figure><p>Europe’s original React conference, React Europe brings together the most passionate people from the core team and the coolest people from the community.</p><p>With React still being the <a href="https://2018.stateofjs.com/front-end-frameworks/overview/">#1 choice</a> for front-end JS frameworks, the event focuses on the horizon, bringing to discussion how futuristic tech will empower the new generation of web apps.</p><ul><li>May 23–24 | Paris, France</li><li><a href="https://www.react-europe.org/">Website</a> | <a href="https://twitter.com/ReactEurope">Twitter</a></li></ul><h3>JSConf</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*5c6SZxxlemihO5VD.png" /></figure><p>Rather than being a single conference, JSConf spans across different countries and dates. The most notable events include:</p><p><strong>JSConf EU</strong> — brings the “labour-of-love” for the JS community with memorable speakers while providing visitors with several side “quests”. It also brings a scholarship program for individuals from underrepresented groups.</p><ul><li>June 1–2 | Berlin, Germany</li><li><a href="https://2019.jsconf.eu/">Website</a> | <a href="https://twitter.com/jsconfeu">Twitter</a></li></ul><p><strong>JSConf Asia</strong> — Southeast Asia’s largest web developer conference and the meeting place of tech giants, JS/CSS masters, and notable influencers. In 2018, it featured the likes of <a href="https://twitter.com/jaffathecake">Jake Archibald</a>, <a href="https://twitter.com/una">Una Kravets</a>, and <a href="https://twitter.com/twholman">Tim Holman</a>.</p><ul><li>June 14–16 | Singapore</li><li><a href="https://2019.jsconf.asia/">Website</a> | <a href="https://twitter.com/jsconfasia">Twitter</a></li></ul><p><strong>JSConf US</strong> — held in sunny Carlsbad, California, encourages attendees to venture outside their comfort zone. The event features a “choose your own adventure” program, which enables visitors to go surfing, golfing, and even riding a helicopter.</p><ul><li>August 11–15 | Carlsbad, CA, USA</li><li><a href="http://tickets.jsconf.us/">Website</a> | <a href="https://twitter.com/jsconfus">Twitter</a></li></ul><h3>Chain React</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/0*FcHQbg8jNk8PThKg.png" /></figure><p>React Native keeps growing as developers’ <a href="https://2018.stateofjs.com/mobile-and-desktop/overview/">framework of choice</a> for building cross-platform mobile apps. Chain React, promoted by Infinite Red, started in 2017 as a meeting place for React Native enthusiasts, but quickly grew in popularity.</p><p>In 2018, the event attracted 500 attendees and notable speakers, including <a href="https://twitter.com/radexp">Radek Pietruszewski</a>, <a href="https://twitter.com/kenza_iraki">Kenza Iraki</a>, and <a href="https://twitter.com/notbrent">Brent Vatne</a>. In 2019, the event is expected to keep growing, with more attendees, speakers, and vendors.</p><ul><li>July 11–12 | Portland, OR, USA</li><li><a href="https://infinite.red/ChainReactConf">Website</a> | <a href="https://twitter.com/ChainReactConf">Twitter</a></li></ul><h3>JSCamp</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*vhtYAXCuisJukSm5.jpg" /></figure><p>A great excuse to visit sunny Barcelona during summertime, JSCamp is a JavaScript event built by developers for developers. The event begins with a day filled with workshops and activities, which is followed by the two-day single-track conference.</p><p>JSCamp is all about connecting with other developers and refreshing ideas — open source, JS frameworks, and much more.</p><ul><li>July 18–19 | Barcelona, Spain</li><li><a href="https://jscamp.tech/">Website</a> | <a href="https://twitter.com/jscamp">Twitter</a></li></ul><h3>Node Summit</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/0*wYFlrDz1vQCKoioZ.png" /></figure><p>Node.js is pretty much everywhere. Enterprises, developers, decision-makers, and enthusiasts gather in San Francisco’s Node Summit to push the boundaries of the industry.</p><p>With more than 1000 attendees and 80 speakers, the conference goes on for two official days (plus a zero-day for early bird tickets). With trainings and multiple tracks, the event provides a great opportunity to evolve technical skills.</p><ul><li>July (TBA) | San Francisco, CA, USA</li><li><a href="https://www.nodesummit.com/">Website</a> | <a href="https://twitter.com/nodesummit">Twitter</a></li></ul><h3>BrazilJS Conf</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*OUP86DSwzbJ9qss5.jpg" /></figure><p>The Brazillian JavaScript community is huge and has a major presence in online channels. BrazilJS packages all this enthusiasm into a single major event where the community comes together.</p><p>The conference has roots dating back to 2011 and has grown with the mission of bringing the highest quality content to Brazil. The 2012 edition hosted <a href="https://twitter.com/BrendanEich">Brendan Eich</a>, and the event has since brought several high-profile speakers, including <a href="https://twitter.com/wycats">Yehuda Katz</a> and <a href="https://twitter.com/rauchg">Guillermo Rauch</a>.</p><ul><li>August (TBA) | Porto Alegre, Brazil</li><li><a href="https://braziljs.org/conf/">Website</a> | <a href="https://twitter.com/braziljs">Twitter</a></li></ul><h3>AngularConnect</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/0*ID3VsiRqDnrIahTv.png" /></figure><p>Europe’s largest Angular conference, AngularConnect does its name justice by marking the meeting place for Angular developers, industry players, and core members of Google’s Angular team.</p><p>Angular Connect is also a strong contributor to the Angular community, sponsoring several meetups. If you’re considering joining them in London in 2019, apart from all the networking and learning, expect a healthy dose of chilling and… dinosaurs.</p><ul><li>September 19–20 | London, UK</li><li><a href="https://angularconnect.com/">Website</a> | <a href="https://twitter.com/angularconnect">Twitter</a></li></ul><h3>ReactiveConf</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*e0rd5_7XvHXn8AMT.png" /></figure><p>At the heart of Europe, in the city of 100 spires, functional programming gets Reactive in a three-day long festival where innovation is the keyword.</p><p>The event’s unique format consists of 2 conference days across 2 stages and a festival day. The conference will host over 60 speakers, which will deal not only with React, but with all cutting-edge mobile and web tech stacks. There will be plenty of time to explore Prague and join parties.</p><ul><li>October (TBA) | Prague, Czech Republic</li><li><a href="https://reactiveconf.com/">Website</a> | <a href="https://twitter.com/ReactiveConf">Twitter</a></li></ul><h3>JSFoo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/0*iCcqS4ymz1UK_1WF.png" /></figure><p>JavaScript is hugely popular in India, and its community thrives both digital and offline. JSFoo has been around since 2011 and has grown into a cornerstone of the Indian JS community. Besides the Bangalore event, HasGeek (the organizing community) has expanded JSFoo to <a href="https://jsfoo.in/2019-pune/">Pune</a> in January and organizes <a href="https://reactfoo.in/">ReactFoo</a> in March.</p><p>The event usually goes on for two days filled with talks that cover both the front-end and back-end ecosystems and also feature case studies of Vue.js, GraphQL, ReasonML and others.</p><ul><li>October (TBA) | Bangalore, India</li><li><a href="https://jsfoo.in/">Website</a> | <a href="https://twitter.com/jsfoo">Twitter</a></li></ul><h3>NodeConf EU</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*BoGmDhG45cSMB0mG.png" /></figure><p>Europe gets its largest Node.js event in Ireland. Mostly attended by developers and engineers, the conference is a must-attend due to its abundance of quality speakers, workshops and friendly atmosphere.</p><p>NodeConf EU is all about the community. Chances are you will surely meet in person some legendary members of the JavaScript development scene.</p><ul><li>November 10–13 | Kilkenny, Ireland</li><li><a href="https://www.nodeconf.eu/index.html">Website</a> | <a href="https://twitter.com/nodeconfeu">Twitter</a></li></ul><h3>dotJS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*hAAnvjIQdIRATxAP.png" /></figure><p>The dot conferences movement spans several topics — security, AI, CSS, and JS. This unique conference format seeks to be TED-like in its quality and delivery. All talks are highly curated, with past speakers the likes of <a href="https://twitter.com/john_papa">John Papa</a>, <a href="https://twitter.com/ahejlsberg">Anders Hejlsberg</a>, and <a href="https://twitter.com/sugarpirate_">Lauren Tan</a>.</p><p>dotJS also brings training for emerging technologies such as Vue.js and GraphQL, seeking to inspire JavaScript developers to keep innovating.</p><ul><li>November (TBA) | Paris, France</li><li><a href="https://www.dotjs.io/">Website</a> | <a href="https://twitter.com/dotJS">Twitter</a></li></ul><p>With dozens (possibly even hundreds) of JavaScript events sprouting all over the globe, the future of JavaScript looks brighter than ever. All of the events we feature on this list have great feedback from the community, so definitely consider attending some in 2019!</p><p>If you’re looking to improve your own JavaScript skills, be sure to check out our multiple tutorials on <a href="https://blog.jscrambler.com/tag/react">React</a>, <a href="https://blog.jscrambler.com/tag/angular">Angular</a>, <a href="https://blog.jscrambler.com/tag/vue-js">Vue</a>, <a href="https://blog.jscrambler.com/tag/node-js">Node.js</a>, <a href="https://blog.jscrambler.com/tag/mobile">Mobile Development</a> and other <a href="https://blog.jscrambler.com/tag/web-development">web resources</a>.</p><p>Also, if you’re building apps with important logic or intellectual property, learn how you can <a href="https://jscrambler.com/code-integrity/?utm_source=medium.com&amp;utm_medium=referral">protect them</a> against code theft and reverse-engineering.</p><p><em>Originally published at </em><a href="https://blog.jscrambler.com/14-javascript-conferences-in-2019-every-developer-should-attend/?utm_source=medium.com&amp;utm_medium=referral"><em>blog.jscrambler.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e61f64c12905" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/14-javascript-conferences-in-2019-every-developer-should-attend-e61f64c12905">14 JavaScript Conferences in 2019 Every Developer Should Attend</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to NativeScript]]></title>
            <link>https://medium.com/hello-js/introduction-to-nativescript-3f67d635a656?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/3f67d635a656</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[hybrid-app-development]]></category>
            <category><![CDATA[nativescript]]></category>
            <category><![CDATA[mobile-development]]></category>
            <dc:creator><![CDATA[Jscrambler]]></dc:creator>
            <pubDate>Thu, 15 Nov 2018 07:40:19 GMT</pubDate>
            <atom:updated>2018-11-15T07:40:18.988Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JcJFieTTQh6nLibM.jpg" /></figure><p>There are quite a few reasons to use cross-platform or hybrid frameworks. For starters, <strong>it’s easier to maintain a single code base</strong>. Also, existing developer skills can be leveraged to develop apps. Quite a few hybrid frameworks are available for developers. The majority of those are based on Apache Cordova or WebView-based. Then there is C# based Xamarin which is a cross-compiled framework. NativeScript is one such platform.</p><p>NativeScript is developed and maintained by Progress Telerik. It is a JIT compiled framework and its code runs inside a JS Virtual Machine, which is bundled together with the application. It uses v8 runtime for Android and JavaScriptCore for iOS. As a reference, React Native uses JavaScriptCore on both Android and iOS platforms. If you’re interested in a <strong>comparison between NativeScript, React Native and Ionic</strong>, see our <a href="https://blog.jscrambler.com/react-native-vs-ionic-vs-nativescript-a-practical-guide/">practical guide</a>.</p><p>NativeScript uses a combination of XML, JS and CSS for development. Official Support for Angular and TypeScript is also available. At the time of writing, community support for Vue is available.</p><p>It currently supports the following stacks:</p><ul><li>JavaScript</li><li>TypeScript</li><li>Angular</li><li>Vue</li></ul><p>Details regarding the starter templates for each stack can be viewed <a href="https://docs.nativescript.org/app-and-screen-templates/app-templates">here</a>. For the purposes of this tutorial, <strong>we will consider the Angular stack</strong> from this point forward.</p><h3>NativeScript 5.0</h3><p>Recently, NativeScript 5.0 was released by Progress Telerik. Improvements in this version are more relevant to tooling and developer experience. Features in this version are listed below:</p><ul><li>Hot Module Replacement (HMR).</li><li>Interactive tns create command.</li><li><a href="https://docs.nativescript.org/angular/ui/layouts/layouts#ios-safe-area-support">Safe Area</a> support in iOS.</li><li>Create plugins with tns plugin create</li><li>Support for different app IDs for iOS and Android.</li><li>Vue.js support for all NativeScript UI components.</li><li>(breaking-change) Migration to support Android library APIs v28.</li><li>(breaking-change) Dropped support for X-Code 8 &amp; iOS 10.12 Sierra.</li></ul><h3>Tooling</h3><p>This the area where NativeScript shines. NativeScript has an outstanding tooling support.</p><p>You can work with NativeScript in 2 ways.</p><h3>On a Local machine</h3><ul><li>Install CLI / GUI Tool</li><li>Setup Work Environment (Android/iOS works).</li><li>Fire your favorite IDE (NativeScript has good support for Visual Studio code).</li><li>Code — Debug — Test on Live Device/Emulator.</li></ul><p>We can install NativeScript using the following command</p><pre>npm install -g nativescript</pre><p>The CLI can perform the following tasks:</p><ul><li>Create project from templates (tns install)</li><li>Run project on devices (tns run)</li><li>Debug applications (tns debug)</li><li>Manage Platforms (tns platform)</li><li>Manage Plugins (tns plugin)</li><li>Check work environment (tns doctor)</li><li>Setup work environment (tns setup)</li><li>Support for ChromeDev Tools &amp; Safari Inspect</li></ul><p>You can also use <a href="https://www.nativescript.org/nativescript-sidekick">NativeScript Sidekick</a> to manage projects. Sidekick is an Electron app which provides a GUI interface for the NativeScript CLI. As with most Electron Apps, memory consumption is an issue. It is recommended to have at least 8 GB of RAM.</p><h3>Using a WebIDE</h3><p>Alternatively, NativeScript has a WebIDE known as <a href="https://play.nativescript.org/">NativeScript PlayGround</a>. On this site, you can:</p><ul><li>Create Apps from Templates.</li><li>Drag and Drop Interface for UI Components.</li><li>Generate Wrapper Code for UI components.</li><li>Open App in local Devices Akin to Expo(React Native) and Ionic View.</li><li>Hot Reload &amp; debug on Devices.</li><li>Manage Projects.</li></ul><p>This is very handy if you want to give NativeScript a test run. To test the project, download the Playground Apps for <a href="https://play.google.com/store/apps/details?id=org.nativescript.play">Android</a> and <a href="https://itunes.apple.com/us/app/nativescript-playground/id1263543946?mt=8&amp;ls=1">iOS</a> and scan the QR codes.</p><h3>Project Structure</h3><p>To create a project from a template directly, use the create command with --template param:</p><pre>tns create SampleProject --template tns-template-blank-ng</pre><p>This will create a project named SampleProject based on the blank angular template. For a complete list of arguments, use:</p><pre>tns help create</pre><h4>Interactive Project Creation</h4><p>NativeScript 5.0 allows you to create projects interactively. Invoke tns create without any Params.</p><pre>tns create</pre><p>The interactive project creation is straightforward. In the first step, set your app’s name (we will name it “Sample Project”); then, choose a stack (we will choose “Angular”); finally, pick a template (in our case, “Hello World”). This will generate our project folder.</p><p>This is the standard project structure of a NativeScript App.</p><pre>├── angular.json<br>├── App_Resources<br>├── CODE_OF_CONDUCT.md<br>├── hooks<br>├── LICENSE<br>├── node_modules<br>├── nsconfig.json<br>├── package.json<br>├── package-lock.json<br>├── platforms<br>├── README.md<br>├── src<br>├── tsconfig.json<br>├── tsconfig.tns.json<br>└── webpack.config.js</pre><p>The package.json file has a key known as &quot;id&quot;. This is your Application Identifier or Package Name. To publish your app to the Play Store or iTunes, you are required to have a unique id.</p><pre>&quot;id&quot;: &quot;org.nativescript.SampleProject&quot;,</pre><p>With NativeScript 5, individual App IDs can now be specified as below.</p><pre>&quot;id&quot;: {<br>            &quot;ios&quot;: &quot;org.nativescript.SampleProjectIOS&quot;,<br>            &quot;android&quot;: &quot;org.nativescript.SampleProjectAndroid&quot;<br>        }</pre><p>The source code of the application is in the src folder:</p><pre>├── app<br>│   ├── app.component.html<br>│   ├── app.component.ts <br>│   ├── app.module.ts<br>│   ├── app-routing.module.ts<br>│   └── home<br>│       ├── home.component.html   <br>│       ├── home.component.ts<br>│       ├── home.module.ts <br>│       └── home-routing.module.ts<br>├── app.css<br>├── main.ts<br>└── package.json</pre><p>Depending on the templates, you will have TypeScript files, JavaScript Files, XML files and CSS/SASS files.</p><p>Run the app on an Android device using the command</p><pre>tns run android</pre><p>This will initialize the app in an Android device.</p><h3>UI: Layouts and Styling</h3><h3>Layouts</h3><p>As mentioned before, NativeScript uses XML as a layout template. The child components/widgets are arranged in Layout containers. By default, 6 Layouts are available:</p><ul><li>StackLayout: Elements are stacked horizontally and vertically.</li><li>GridLayout: A rectangular grid with rows and columns.</li><li>AbsoluteLayout: You can set the location of child elements exactly in this layout.</li><li>FlexLayout: This is based on CSS Flex Layout. However, it is non-conforming.</li><li>DockLayout: Elements in dock layout are positioned on edges. The last element takes up remaining space.</li><li>WrapLayout: Elements in WrapLayout are arranged in a grid of rows and columns. If space runs out, the remaining elements are placed in the next row/column depending on orientation.</li></ul><p>You can read more about layouts in the <a href="https://docs.nativescript.org/angular/ui/layouts/layout-containers">documentation</a>.</p><h3>Styling</h3><p>NativeScript elements are styled using CSS. However, the properties which can be styled are limited. Here is the complete <a href="https://docs.nativescript.org/ui/styling">list of properties</a> which can be styled.</p><p>CSS properties can be declared</p><ul><li>Application-wide</li><li>Inline on elements</li><li>Page Specific CSS</li></ul><h3>Interacting with the Backend</h3><p>Currently, the Angular template of NativeScript comes with Angular 6.1. We can use <a href="https://docs.nativescript.org/angular/ng-framework-modules/http#http">HttpClientModule</a> to interact with a web service.</p><p>Altrnatively, we can also use <a href="https://docs.nativescript.org/ns-framework-modules/fetch">fetch</a> or <a href="https://docs.nativescript.org/ns-framework-modules/http">tns-http</a> to interact with web services.</p><h3>Debugging</h3><h3>Web Browser Inspect</h3><p>We can debug the application using Chrome Inspect (For Android) and Safari Inspect (for iOS). To run the application in debug mode on Android, use the command</p><pre>tns debug android</pre><p>A URL will be generated in the terminal window. This URL will provide you with a console and debugger.</p><h3>Hot Module Replacement</h3><p><a href="https://webpack.js.org/concepts/hot-module-replacement/">Webpack’s</a> hot module replacement was introduced in NativeScript version 5.0. Previously, changes would be reflected in the device/emulator with an app reload. With hmr the changes are updated live without app reload, <em>i.e.</em> they are reflected instantly.</p><p>Currently, the feature is beta and requires the nativescript-dev-webpack dependency to work. This reduces development time drastically.</p><p>To use hmr, you will have to update the CLI to version 5.0 and install nativescript-dev-webpack in the project folder (if not present). Additionally, Angular projects require additional steps as outlined <a href="https://github.com/NativeScript/nativescript-angular/wiki/HMR">here</a>.</p><pre>npm i nativescript-dev-webpack --save</pre><p>After installation, use the flag --hmr with tns run command to start the app on a device/emulator.</p><pre>tns run android --hmr</pre><pre>tns run ios --hmr</pre><h3>tns Preview</h3><p>Preview mode was introduced in version 5.0. tns preview bundles the app and generates a QR code like NativeScript PlayGround. You scan the QR code and load app via NativeScript Playground App. This is very handy if your development machine is non-macOS and you want to test the App in an iPhone. As with playground, plugin support is limited in preview mode.</p><pre>tns preview</pre><h3>Extending the project with plugins</h3><p>The default project template has limited features and functionality. We can extend the functionality using NativeScript Plugins. The <a href="https://market.nativescript.org/?tab=plugins">NativeScript MarketPlace</a> provides you with a list of published plugins. An individual plugin page has information about:</p><ul><li>Platform (Android / iOS / Both)</li><li>NativeScript Version (2 / 3 / 4 / 5)</li><li>Webpack Support</li><li>Demo App in Plugin Page</li><li>TypeScript Support</li><li>License Information</li><li>Travis CI Support</li></ul><p>Verified plugins have support for the latest Android &amp; iOS versions, support for latest NativeScript platforms, Weekly Travis CI Builds, support for all NativeScript templates and demo apps in the plugin repository.</p><p>Plugins can be managed using Sidekick. However, they are not available in the Playground. Some common plugins are listed below.</p><p>Plugins can be installed using the following command.</p><pre>tns plugin add plugin_name</pre><p>Since NativeScript plugins are available in the npm repository, you can also use</p><pre>npm i plugin_name --save</pre><h3>Conclusion</h3><p>This was a brief overview of the framework. We would suggest you to take NativeScript for a spin using <a href="https://play.nativescript.org/">Playground</a>.</p><p>If you encounter any issues getting started with NativeScript, be sure to refer to the <a href="https://docs.nativescript.org/">official documentation</a> or join their <a href="https://developer.telerik.com/wp-login.php?action=slack-invitation">Slack community</a>.</p><p><em>Originally published at </em><a href="https://blog.jscrambler.com/introduction-to-nativescript/"><em>blog.jscrambler.com</em></a><em> by </em><a href="https://blog.jscrambler.com/author/karan"><em>Karan Gandhi</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f67d635a656" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/introduction-to-nativescript-3f67d635a656">Introduction to NativeScript</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Type System in JavaScript: What It Is and Why It Matters]]></title>
            <link>https://medium.com/hello-js/type-system-in-javascript-what-it-is-and-why-it-matters-1c7782f77941?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/1c7782f77941</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Jscrambler]]></dc:creator>
            <pubDate>Mon, 29 Oct 2018 07:28:14 GMT</pubDate>
            <atom:updated>2018-10-29T07:28:13.993Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P_CJi_9ovBD2PQv6.jpg" /></figure><p>JavaScript is characterized as a dynamic and weakly typed programming language. The ability to manipulate DOM elements in a dynamic way <strong>is empowering to the developer</strong>. At the onset, it seems like dynamic typing frees the developer from extraneous code. To some, adding a stricter type system becomes an impediment to developers’ productivity.</p><p>In the early web, JavaScript was scarce. The demand for rich user interaction didn’t make sense for static web pages. JavaScript’s footprint was often dwarfed by CSS and images. In more recent years, this demand for rich client-side interfaces has <a href="https://w3techs.com/technologies/details/cp-javascript/all/all">exponentiated</a>. It is safe to assume <strong>JavaScript is the programming language of the web</strong>.</p><p>But, as code bases grow, and more contributors add to its complexity, can a type system start to make sense? As bugs and complexity increases, code quality becomes the focus on how fast a team can deliver.</p><h3>What Is A Type System?</h3><p>In JavaScript, a type system adds type safety checks to a program. This can happen at compile time or during the execution of the code. Given the dynamic nature of JavaScript, you can assign a string to a variable then use this same variable like a number. A type system will flag these programming mishaps and let you know of a possible error.</p><p>A type system can look like a <strong>data contract</strong>. The programmer specifies what a variable is for. This enables code readers to know what the original author intends. Imagine a type system as a formal contract and an effective way to communicate program specs.</p><p>A type system is much like a mini unit test. The type checking system lets the programmer know whether the test passes or fails. This frees the original author from having to specify type intent in an actual unit test.</p><p>You can use a type system to <strong>automate type safety checks</strong>. This becomes your first line of defense towards thwarting bugs in the code.</p><h3>Why Does It Matter?</h3><p>Dynamic or duck typing is great for prototypes and quick proof of concepts. Prototype code increases the productivity of a single developer. When a prototype comes from a small team, the velocity is high, because communication is much easier. Once this makes it to production, however, it can grow into a maintenance nightmare. There is a point where bugs can bring any software project down to a crawl.</p><p>There is value in defining a specific type to a variable and having a system that validates types. Any programmer unfamiliar with the program can read and understand type definitions. The type system is the data contract to communicate program specifications to newcomers. As more contributors add to the program, data types form a way to validate assumptions.</p><blockquote><em>Type systems build the architecture necessary to communicate intent and clean design. Beauty is in code built around strict data models that meet business requirements.</em></blockquote><p>Think of a type system as a <strong>safety net and a communication tool</strong>. Having explicit types with validation adds accountability to a team of programmers. When type checking is part of the build, it shields the code base from many bugs.</p><p>Empirical evidence suggests a <a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2017/09/gao2017javascript.pdf">15% bug reduction by adding a type system</a>. So, when facing a large enterprise-grade JavaScript project, it is a good idea have one — as it is an effective way to increase code quality and deliver faster.</p><h3>Type Safety Checks</h3><p>Time for the code. Let’s demonstrate a type system using React PropTypes without React. To illustrate the issue, I’ll fabricate a bug that can happen to anyone. Say we have a component for adding two numbers. Due to changes to the team, the original intent of the component gets forgotten. Dynamic typing can build tribal knowledge around data contracts which turn into a myth.</p><p>For example:</p><pre>const props = {<br>  x: 1,<br>  y: &#39;1&#39;<br>};</pre><pre>function addNumbersComponent(props) {<br>  return props.x + props.y;<br>}</pre><pre>addNumbersComponent(props);</pre><p>JavaScript allows this behavior and even gives you a return value too. It may not be what you expect but it does work without throwing any errors. There is permissiveness here that should make programmers pine for basic type checking.</p><p>To quell this behavior, one can do:</p><pre>const propTypes = {<br>  x: PropTypes.number,<br>  y: PropTypes.number<br>};</pre><pre>PropTypes.checkPropTypes(propTypes, props, &#39;props&#39;, &#39;addNumbersComponent&#39;);</pre><p><strong>PropTypes build a line of defense against type mishaps</strong> and gives you feedback. Having basic type checking warns you when there is a programmatic error. One idea is to fail the build when these warnings crop up in your JavaScript code.</p><p>This is the message you see when there is a warning with a type:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/0*NhGQ3r8YnB6Tnzgw.png" /></figure><p>There is value in this feedback because <strong>it automates type checking</strong>. In programming, the job is often to automate as much as possible and this includes type checking. The feedback loop can be shorter when type checking is part of the build. Note that this warning does not show up in a production build. Consider adding type checking as part of the unit tests to fail the build.</p><p>Feel free to play around with the sample code, it <a href="https://codepen.io/jscrambler/pen/VELRvK">is out on CodePen</a>.</p><h3>Conclusion</h3><p>A type system can be your first line of defense against bugs in production. Dynamic typing is good for prototypes with small teams but can fall short in enterprise-grade software. <strong>Large projects with poor coding architecture are at risk when documentation is lacking.</strong> A type system reduces risk, is a communication tool, and enhances the architecture.</p><p><strong>As JavaScript code bases grow both in size and complexity, there is value in type checking</strong>. A good type system builds on top of JavaScript native types and does basic type checking.</p><p>Consider adding type checking as part of a build to shorten the feedback loop. The less time it takes to get feedback, the faster you can thwart bugs.</p><p><em>Originally published at </em><a href="https://blog.jscrambler.com/type-system-in-javascript-what-it-is-and-why-it-matters/"><em>blog.jscrambler.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c7782f77941" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/type-system-in-javascript-what-it-is-and-why-it-matters-1c7782f77941">Type System in JavaScript: What It Is and Why It Matters</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Vue.js form-wizard]]></title>
            <link>https://medium.com/hello-js/using-vue-js-form-wizard-85ff421ff688?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/85ff421ff688</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Prajacta Khopkar]]></dc:creator>
            <pubDate>Mon, 27 Aug 2018 08:53:57 GMT</pubDate>
            <atom:updated>2018-08-27T08:53:56.842Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s no secret that Vue.js is gaining popularity — nearly 50% of developers surveyed in the <a href="https://stateofjs.com/">2017 State of JavaScript Survey</a> said that they want to learn this framework. Vue.js is flexible, lightweight, and there are a bunch of incredible tools that can help streamline code. One of my favorites packages is vue.js form-wizard.</p><p>Vue-form-wizard is a dynamic wizard with a simple interface for splitting forms without external dependencies, which makes it easier to manage tab wizards for larger forms &amp; processes. The vue-form-wizard provides you with built-in functions by just setting up the dependency which helps build quizzes, Q&amp;As, multiple page forms, and more!</p><p>So, how can you start using vue-form-wizard on your next project? Here’s how:</p><p><strong>How to Install Vue-form-wizard:</strong></p><ol><li><strong>Install vue-form-wizard:<br></strong>Vue-form-wizard can be installed by using the command:</li></ol><pre>npm install vue-form-wizard</pre><ol><li><strong>Import the package in your current project:<br></strong>Import the package in your current project to include and fetch its style we need to add the following:</li></ol><pre>//global registration<br>import VueFormWizard from ‘vue-form-wizard’</pre><pre>Vue.use(VueFormWizard)</pre><ol><li><strong>Include Styles<br></strong>Don’t forget to include the styles. You can customize them according to your requirements.</li></ol><pre>import ‘vue-form-wizard/dist/vue-form-wizard.min.css’</pre><ol><li><strong>Add Tags in Your Template<br></strong>Finally, to see the basic form wizard in action, put a &lt;form-wizard&gt; tag in your template at the required section in your app and include &lt;tab-content&gt; tag on the number of slides you need on your wizard.</li></ol><pre>&lt;form-wizard&gt;</pre><pre>&lt;tab-content title=”tab1&quot;&gt;</pre><pre>First tab</pre><pre>&lt;/tab-content&gt;</pre><pre>&lt;tab-content title=”tab2&quot;&gt;</pre><pre>Second tab</pre><pre>&lt;/tab-content&gt;</pre><pre>&lt;tab-content title=tab3&quot;&gt;</pre><pre>Last tab</pre><pre>&lt;/tab-content&gt;</pre><pre>&lt;/form-wizard&gt;</pre><p>The above code will display a basic form wizard with three steps “tab1”, “tab2” &amp; “tab3” with its default settings. This form wizard component comes with a set of different options. You can customize those according to your needs like</p><pre>&lt;form-wizard shape=”square”&gt;</pre><pre>&lt;form-wizard shape=”tab”&gt;</pre><p>If the number of slides are dynamic, you can loop through the tab-content tag.</p><pre>&lt;tab-content</pre><pre>v-for=”(slide, index) in slide_data”</pre><pre>:title=”slide.title”</pre><pre>:key=”slide.id”</pre><pre>:before-change=”validateBeforeSubmit”&gt;</pre><pre>&lt;/tab-content&gt;</pre><p>Note: “slide_data” is the object that you need to loop through for fetching the slides.</p><p><strong>Useful Form-level Props in vue-form-wizard</strong></p><p>Similar to props at the component level in vue.js, form-wizard offers some built-in props at the form level and the tab level.</p><p><strong>Title</strong>: accepts a string value</p><p><strong>StartIndex</strong>: This allows you to customize the form-wizard and change the start index. In other words, the form-wizard doesn’t always have a start index of 0. This can be helpful when integrating with multiple form-wizards without a break.</p><p><strong>Shape</strong>: This allows you to custom the shape of the form.</p><p><strong>Color: </strong>This<strong> </strong>allows to use a custom color for the tab and its buttons in the wizard.</p><p><strong>Title:</strong> requires a string to provide a title for an individual tab</p><p><strong>before-change:</strong> one of the most useful props for a tab is the before-change function. This function is defined at per tab-content level and can be used to validate a specific tab. It is triggered before moving to the next tab.<br>Example:</p><pre>&lt;tab-content :before-change=”validateTab” &gt;&lt;/tab-content&gt;</pre><pre><br>validateTab:function(){</pre><pre>alert(‘triggered before jumping to next tab’)</pre><pre>}</pre><p>This function needs to be returned true to proceed to the next tab. If it does not return anything, its defaults to false and the tab is not changed. In such a situation, to force change the tab, you can use changeTab (oldIndex, newIndex).</p><blockquote>Example: this.$refs.wizard.changeTab(0, 3)</blockquote><p>Useful functions provided by vue-form-wizard:</p><p><strong>on-change:</strong> This function is at a form-wizard level. It is triggered at on change of every tab and returns parameters: prev-tab, next-tab.</p><p>Example:</p><pre><br>if (prevtab &gt; nexttab) { alert(‘going backward’)}</pre><pre>If(nexttab&gt; prevtab){alert(‘going forward’)}</pre><p><strong>on-loading:</strong> This event triggers before and after before-change props is triggered. Although it does not return any value, any action can be added in this event.</p><p><strong>on-validate</strong>: This function is triggered after before-change, but also returns a boolean value of the validation and the tab index.</p><p><strong>on-error</strong>: This event works along with async validation and if Promise function is used. If the promise is rejected the on-error event will return the error message, else it will not be triggered.</p><p><strong>on-complete:</strong> This function is at a form-wizard level. It is triggered when on the last tab the next/finish button is hit to trigger the last action needed after the wizard is completed. Additional vue-form-wizard Functions</p><p><strong>Async validation</strong>: This feature can be paired with the tab level before-change. Async allows the validation to respond to a callback function like a response from an API call to check the validity of the tab moving forward. Here is an example of <a href="https://cristijora.github.io/vue-form-wizard/#/?id=async-validation">async validation</a></p><p><strong>Element UI integration:</strong> Using the UI integration lets you use the built-in styling and form structure. Reusing the components let you build a complete application faster.</p><p>Therefore, Vue.js form-wizard covers all the action or function which one might require while building an application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85ff421ff688" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/using-vue-js-form-wizard-85ff421ff688">Using Vue.js form-wizard</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The fourth virtue of the programmer]]></title>
            <link>https://medium.com/hello-js/the-fourth-virtue-of-the-programmer-e1043fbb2646?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/e1043fbb2646</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Arnaud “Arhuman” ASSAD]]></dc:creator>
            <pubDate>Thu, 02 Aug 2018 11:49:41 GMT</pubDate>
            <atom:updated>2018-08-02T11:49:41.506Z</atom:updated>
            <content:encoded><![CDATA[<p>Larry Wall once wrote “The three great virtue of the programmer are: laziness, impatience, and hubris”. I took great care to follow this path to become a programmer. Though I must admit I already had great disposition for laziness.</p><p>Now, as an accomplished programmer (*cough* hubris *cough*), I think it’s time to improve further. I’ve search for a loooooooong time. And after a week of thinking (*cough* impatience *cough*) I’ve decided to talk to you about the fourth virtue of the programmer.</p><p><strong>The fourth virtue that’ll make you a more productive programmer is consistency</strong>.</p><p>Let me show you in this article how to apply consistency for your profit easily (*cough* laziness *cough*).</p><p><strong>Find your rhythm and stick to it</strong></p><p>Your mileage may vary, but for most people, being consistent in the time you allocate to a project/task will boost your productivity.</p><p>Don’t take my word for it, but make an experience:</p><ul><li>Code one day a week on a project for one month.</li><li>Code 1h a day for one month on another project.</li></ul><p>On which one will you be the most productive ?</p><p>Even if some tasks are hard to do in one hour, I bet a consistent work will boost your enthusiasm, ease your work and in the end make you more efficient.</p><p>Of course you probably work on several project at a time, and external factors might break your chosen rhythm. But as long as you <em>try </em>to be regular in your work you should see improvements.</p><p><strong>Find your style and stick to it</strong></p><p>Consistency in the way you write your code is a well known quality metric: It improves readability, ease the maintenance/evolution and reduce the probability of bugs.</p><p>If choosing the coding style was easy when I was coding in Perl (Larry Wall then Damien Conway paved the way) it can be much difficult depending on your language of choice: The choice is not the same for a JavaScript/PHP programmer or a Python/Go programmer.</p><p>But whatever the abundance of choice or not, it doesn’t really matter what style you pick as long as you pick one coding style.</p><p>And once you’re picked one, ensure you enforce it in your usual editor.<br>(It’s just a matter of few lines in my vim config file to have the airbnb style enforced on all my javascript files or gofmt run on my Go file)</p><p><strong>Ensure you have consistent goal and consistent results</strong></p><p>Use tests!</p><p>Let’s say the truth: Testing is our dark little secret, we wish we’d do it more, but in dark repositories that we don’t make public there are stills many places where a test directory is missing.</p><p>However we all know that the tests is the minimal architectural work we have to do: How can we achieve our goals if we don’t define them ?</p><p>We all know that tests are the required safety net to refactor our code with confidence.</p><p>So stop beating about the bush, choose your framework and use it in all of your projects.</p><p><strong>Be consistent in your process</strong></p><p>We all have some habits/tricks that make us more efficient. As soon as you’ve found one, use it consistently.</p><p>For example, I try to drop a LAB_BOOK.txt file in my working directories, to store tips/hints related to the current project: It can be as simple as basic commands to start/stop services, or command line examples of some unusual tools or data/steps to test/improve my code. It might seem useless, but those files prevent me from wasting precious time when I get back to a project after a long halt. Being consistent in the use and the naming of this file is what prevent me from wasting time.</p><p>I also try to store whenever possible all the private data (login/pass/ports…) in a separate file named the same way across my repos to have it protected from unwanted disclosure (thanks to specifically modified .gitignore).</p><p>We all have coding habits: whatever the way you work with your SCM, name your file, organize your repositories, document your project, try to be consistent; it will save you time and fatigue.</p><p>I was not a big fan of generators until lately where I realized how yeoman could be used to enforce most of the above mentioned good practices.</p><p>I’m still working on it, but having default layouts for my project is definitely a good way to boost productivity by reducing the initial friction and improving overall quality.</p><p><strong>Be consistent in applying what you’ve decided</strong></p><p>Once you’ve found a good practice: automate it!</p><p>Your tool will never forget, will never be lazy, will never make an hazardous change and will never forgive :)</p><p>Your SCM hooks can be handy to autoupdate the Changefile or do some testing.</p><p>Common operations on files (conversion, generation) should be scripted.</p><p>In fact if you’ve done the same simple task more than 2 times, you probably should script it.</p><p><strong>Conclusion</strong></p><p>I hope this rant will give you ideas to improve your coding habits. As usual I’d be glad to have your feedback/comment/suggestion on the topic. Don’t hesitate to leave a comment or contact me by mail (arhuman (at) gmail dot com)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1043fbb2646" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/the-fourth-virtue-of-the-programmer-e1043fbb2646">The fourth virtue of the programmer</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Styled-Components: CSS-in-JS Library for the Modern Web]]></title>
            <link>https://medium.com/hello-js/styled-components-css-in-js-library-for-the-modern-web-847a68860593?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/847a68860593</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Michelle Young]]></dc:creator>
            <pubDate>Wed, 30 May 2018 08:40:20 GMT</pubDate>
            <atom:updated>2018-05-30T08:40:20.096Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>This </strong><a href="https://www.toptal.com/javascript/styled-components-library"><strong>post</strong></a><strong> was written by </strong><a href="https://www.toptal.com/resume/jeremy-davis"><strong>Jeremy Davis</strong></a><strong>, JavaScript Developer for </strong><a href="https://www.toptal.com/javascript"><strong>Toptal</strong></a><strong>.</strong></p><p>CSS was designed for documents, what the “old web” was expected to contain. The emergence of preprocessors like Sass or Less shows that the community needs more than what CSS offers. With web apps getting more and more complex over time, CSS’ limitations have become increasingly visible and difficult to mitigate.</p><p>Styled-components leverages the power of a complete programming language — JavaScript — and its scoping capabilities to help structure the code into components. This helps to avoid the common pitfalls of writing and maintaining CSS for large projects. A developer can describe a component’s style with no risk of side effects.</p><h3>What’s the Problem?</h3><p>One advantage of using CSS is that the style is completely decoupled from the code. This means that developers and designers can work in parallel without interfering with each other.</p><p>On the other hand, styled-components makes it easier to fall in the trap of strongly coupling style and logic. Max Stoiber explains how to avoid this. While the idea of separating logic and presentation is definitely not new, one might be tempted to take shortcuts when developing React components. For example, it’s easy to create a component for a validation button that handles the click action as well as the button’s style. It takes a bit more effort to split it in two components.</p><h3>The Container/Presentational Architecture</h3><p>This is a pretty simple principle. Components either define how things look, or they manage data and logic. A very important aspect of presentation components is that they should never have any dependencies. They receive props and render DOM (or children) accordingly. Containers, on the other hand, know about the data architecture (state, redux, flux, etc.) but should never be responsible for display. <a href="https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0">Dan Abramov’s</a> article is a very good and detailed explanation of this architecture.</p><h3>Remembering SMACSS</h3><p>Although the <a href="https://smacss.com/book/categorizing">Scalable and Modular Architecture for CSS</a> is a style guide for organizing CSS, the basic concept is one that is followed, for the most part automatically, by styled-components. The idea is to separate CSS into five categories:</p><ul><li>Base contains all the general rules.</li><li>Layout’s purpose it to define the structural properties as well as various sections of content (header, footer, sidebar, content, for instance).</li><li>Module contains subcategories for the various logical blocks of the UI.</li><li>State defines modifier classes to indicate elements’ states, e.g. field in error, disabled button.</li><li>Theme contains color, font, and other cosmetic aspects that may be modifiable or dependent on user preference.</li></ul><p>Keeping this separation while using styled-components is easy. Projects usually include some kind of CSS normalization or reset. This typically falls in the Base category. You may also define general font sizing, line sizing, etc. This can be done through normal CSS (or Sass/Less), or through the injectGlobal function provided by styled-components.</p><p>For Layout rules, if you use a UI framework, then it will probably define container classes, or a grid system. You can easily use those classes in conjunction with your own rules in the layout components you write.</p><p>Module is automatically followed by the architecture of styled-components, since the styles are attached to components directly, rather than described in external files. Basically, each styled component that you write will be its own module. You can write your styling code without worrying about side effects.</p><p>State will be rules you define within your components as variable rules. You simply define a function to interpolate values of your CSS attributes. If using a UI framework, you might have useful classes to add to your components as well. You will probably also have CSS pseudo-selector rules (hover, focus, etc.)</p><p>The Theme can simply be interpolated within your components. It is a good idea to define your theme as a set of variables to be used throughout your application. You can even derive colors programmatically (using a library, or manually), for instance to handle contrasts and highlights. Remember that you have the full power of a programming language at your disposal!</p><h3>Bring Them Together for a Solution</h3><p>It is important to keep them together, for an easier navigation experience; We don’t want to organize them by type (presentation vs. logic) but rather by functionality.</p><p>Thus, we will have a folder for all the generic components (buttons and such). The others should be organized depending on the project and its functionalities. For instance, if we have user management features, we should group all the components specific to that feature.</p><p>To apply styled-components’ container/presentation architecture to a SMACSS approach, we need an extra type of component: structural. We end up with three kinds of components; styled, structural, and container. Since styled-components decorates a tag (or component), we need this third type of component to structure the DOM. In some cases, it might be possible to allow a container component to handle the structure of sub-components, but when the DOM structure becomes complex and is required for visual purposes, it’s best to separate them. A good example is a table, where the DOM typically gets quite verbose.</p><h3>Example Project</h3><p>Let’s build a small app that displays recipes to illustrate these principles. We can start building a Recipes component. The parent component will be a controller. It will handle the state — in this case, the list of recipes. It will also call an API function to fetch the data.</p><pre>class Recipes extends Component{<br>  constructor (props) {<br>    super(props);<br>    this.state = {<br>      recipes: []<br>    };<br>  }</pre><pre>  componentDidMount () {<br>    this.loadData()<br>  }</pre><pre>  loadData () {<br>    getRecipes().then(recipes =&gt; {<br>      this.setState({recipes})<br>    })<br>  }</pre><pre>  render() {<br>    let {recipes} = this.state</pre><pre>    return (<br>      &lt;RecipesContainer recipes={recipes} /&gt;<br>    )<br>  }<br>}</pre><p>It will render the list of recipes, but it does not (and should not) need to know how. So we render another component that gets the list of recipes and outputs DOM:</p><pre>class RecipesContainer extends Component{<br>  render() {<br>    let {recipes} = this.props</pre><pre>    return (<br>      &lt;TilesContainer&gt;<br>        {recipes.map(recipe =&gt; (&lt;Recipe key={recipe.id} {...recipe}/&gt;))}<br>      &lt;/TilesContainer&gt;<br>    )<br>  }<br>}</pre><p>Here, actually, we want to make a tile grid. It may be a good idea to make the actual tile layout a generic component. So if we extract that, we get a new component that looks like this:</p><pre>class TilesContainer extends Component {<br>  render () {<br>    let {children} = this.props</pre><pre>    return (<br>      &lt;Tiles&gt;<br>        {<br>          React.Children.map(children, (child, i) =&gt; (<br>            &lt;Tile key={i}&gt;<br>              {child}<br>            &lt;/Tile&gt;<br>          ))<br>        }<br>      &lt;/Tiles&gt;<br>    )<br>  }<br>}</pre><p>TilesStyles.js:</p><pre>export const Tiles = styled.div`<br>  padding: 20px 10px;<br>  display: flex;<br>  flex-direction: row;<br>  flex-wrap: wrap;<br>`</pre><pre>export const Tile = styled.div`<br>  flex: 1 1 auto;<br>  ...<br>  display: flex;</pre><pre>  &amp; &gt; div {<br>    flex: 1 0 auto;<br>  }<br>`</pre><p>Notice that this component is purely presentational. It defines its style and wraps whatever children it receives inside another styled DOM element that defines what tiles look like. It’s a good example of what your generic presentational components will look like architecturally.</p><p>Then, we need to define what a recipe looks like. We need a container component to describe the relatively complex DOM as well as define the style when necessary. We end up with this:</p><pre>class RecipeContainer extends Component {<br>  onChangeServings (e) {<br>    let {changeServings} = this.props<br>    changeServings(e.target.value)<br>  }</pre><pre>  render () {<br>    let {title, ingredients, instructions, time, servings} = this.props</pre><pre>    return (<br>      &lt;Recipe&gt;<br>        &lt;Title&gt;{title}&lt;/Title&gt;<br>        &lt;div&gt;{time}&lt;/div&gt;<br>        &lt;div&gt;Serving<br>          &lt;input type=&quot;number&quot; min=&quot;1&quot; max=&quot;1000&quot; value={servings} onChange={this.onChangeServings.bind(this)}/&gt;<br>        &lt;/div&gt;<br>        &lt;Ingredients&gt;<br>          {ingredients.map((ingredient, i) =&gt; (<br>            &lt;Ingredient key={i} servings={servings}&gt;<br>              &lt;span className=&quot;name&quot;&gt;{ingredient.name}&lt;/span&gt;<br>              &lt;span className=&quot;quantity&quot;&gt;{ingredient.quantity * servings} {ingredient.unit}&lt;/span&gt;<br>            &lt;/Ingredient&gt;<br>          ))}<br>        &lt;/Ingredients&gt;<br>        &lt;div&gt;<br>          {instructions.map((instruction, i) =&gt; (&lt;p key={i}&gt;{instruction}&lt;/p&gt;))}<br>        &lt;/div&gt;<br>      &lt;/Recipe&gt;<br>    )<br>  }<br>}</pre><p>Notice here that the container does some DOM generation, but it’s the only logic it contains. Remember that you can define nested styles, so you don’t need to make a styled element for each tag that requires styling. It’s what we do here for the name and quantity of the ingredient item. Of course, we could split it further and create a new component for an ingredient. That is up to you — depending on the project complexity — to determine the granularity. In this case, it is just a styled component defined along with the rest in the RecipeStyles file:</p><pre>export const Recipe = styled.div`<br>  background-color: ${theme(&#39;colors.background-highlight&#39;)};<br>`;</pre><pre>export const Title = styled.div`<br>  font-weight: bold;<br>`</pre><pre>export const Ingredients = styled.ul`<br>  margin: 5px 0;<br>`</pre><pre>export const Ingredient = styled.li`<br>  &amp; .name {<br>    ...<br>  }</pre><pre>  &amp; .quantity {<br>    ...<br>  }<br>`</pre><p>For the purpose of this exercise, I have used the ThemeProvider. It injects the theme in the props of styled components. You can simply use it as color: ${props =&gt; props.theme.core_color}, I am just using a small wrapper to protect from missing attributes in the theme:</p><pre>const theme = (key) =&gt; (prop) =&gt; _.get(prop.theme, key) || console.warn(&#39;missing key&#39;, key)</pre><p>You can also define your own constants in a module and use those instead. For example: color: ${styleConstants.core_color}</p><h3>Pros</h3><p>A perk of using styled-components is that you can use it as little as you want. You can use your favorite UI framework and add styled-components on top of it. This also means that you can easily migrate an existing project component by component. You can choose to style most of the layout with standard CSS and only use styled-components for reusable components.</p><h3>Cons</h3><p>Designers/style integrators will need to learn very basic JavaScript to handle variables and use them in place of Sass/Less.</p><p>They will also have to learn to navigate the project structure, although I would argue that finding the styles for a component in that component’s folder is easier than having to find the right CSS/Sass/Less file that contains the rule you need to modify.</p><p>They will also need to change their tools a bit if they want syntax highlighting, linting, etc. A good place to start is with <a href="https://atom.io/packages/language-babel">this Atom plugin</a> and <a href="https://github.com/styled-components/babel-plugin-styled-components">this babel plugin</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=847a68860593" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/styled-components-css-in-js-library-for-the-modern-web-847a68860593">Styled-Components: CSS-in-JS Library for the Modern Web</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decorators FTW with Required Fields in Redux Form]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/hello-js/redux-form-is-an-awesome-way-to-handle-forms-in-a-redux-application-in-my-opinion-6b2713a815fa?source=rss----3dddcca454bf---4"><img src="https://cdn-images-1.medium.com/max/2600/1*EhLhzzY3xJisB7vQ0h0sBQ.jpeg" width="2950"></a></p><p class="medium-feed-snippet">Redux Form is an awesome way to handle forms in a Redux application (in my opinion). The community around it is great, and it solves a lot&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/hello-js/redux-form-is-an-awesome-way-to-handle-forms-in-a-redux-application-in-my-opinion-6b2713a815fa?source=rss----3dddcca454bf---4">Continue reading on hello JS »</a></p></div>]]></description>
            <link>https://medium.com/hello-js/redux-form-is-an-awesome-way-to-handle-forms-in-a-redux-application-in-my-opinion-6b2713a815fa?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/6b2713a815fa</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[developer-experience]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Marc Cyr]]></dc:creator>
            <pubDate>Fri, 18 May 2018 06:04:53 GMT</pubDate>
            <atom:updated>2018-06-07T17:18:08.749Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The easiest way to improve your Vue.js application. Part 1]]></title>
            <link>https://medium.com/hello-js/the-easiest-way-to-improve-your-vue-js-application-part-1-f38573c476ae?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/f38573c476ae</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vue]]></category>
            <dc:creator><![CDATA[ADCI Solutions]]></dc:creator>
            <pubDate>Wed, 09 May 2018 14:22:47 GMT</pubDate>
            <atom:updated>2018-05-09T14:22:47.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D7MQdCpXFeQzv9VpqKOdSg.png" /><figcaption><a href="https://goo.gl/SSUzhj">By ADCI Solutions</a></figcaption></figure><p><strong>Vue.js</strong> is a great framework for developing different kinds of web applications, however, it has a problem with <strong>SEO</strong>: the asynchronous content of an application can’t be optimally crawled by search engine bots, so it could be a huge problem for your business. In this article, we will tell you about one of the easiest ways to resolve this problem and, at the same time, to improve the UX of your application. Yes, we will talk about prerendering.</p><p>Prerendering is a process to preload all elements on the page and generate the static HTML of your Single Page Application.</p><h3>Advantages of prerendering</h3><p>The usage of <strong>prerendering</strong> has the following benefits:</p><ol><li>SEO. Yes, finally, we can solve the problem of SEO for sites with asynchronous data: all such data will be preloaded before the crawler will index your site.</li><li>Speeding up page content loading. The user can get an access to your application even before the entire JavaScript loads which significantly improves the UX of your application. No one likes to wait a long time.</li><li>Cheap graceful degradation. This point follows the previous one. Now even users of old browsers or users with a disabled JS or a slow device have the access to your application. Of course, they are not able to fully interact with it but they can access important information instead of seeing an empty page.</li><li>Rich Previews. All unique OpenGraph metadata are prefetched correctly now. Share your site on the Facebook and other socials, to expand target audience.</li></ol><p>The official Vue documentation proposes to use the prerender-spa-plugin for prerendering. In common, the plugin does the following steps:</p><ol><li>It creates an instance of Phantom JS and runs the application.</li><li>Takes a snapshot of the DOM.</li><li>Outputs the snapshot to an HTML file in our build folder.</li></ol><p>All right, let’s see how it works in practice.</p><h3>Practice: prerendering in a Vue.js application</h3><p>For demonstration, I will use the application which was created in<a href="https://goo.gl/btgdHa"> our previous article about a single page Vue application</a>. Get familiar with the project and start with building a simple SPA following the guide in the article, or, if you want to continue right now, just clone the repo and jump to the step 4 in that guide:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ef331e7be8e774459a9883c7f32064d/href">https://medium.com/media/4ef331e7be8e774459a9883c7f32064d/href</a></iframe><p>Now install the plugin:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed0d49d5a7aa5d2cb345bcc56da47b0c/href">https://medium.com/media/ed0d49d5a7aa5d2cb345bcc56da47b0c/href</a></iframe><p>After that, we need to configure the plugin for the correct work. Let’s go to webpack.conf.js and add the following settings:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/94512fc4df2b75c6d652d9abb3057c14/href">https://medium.com/media/94512fc4df2b75c6d652d9abb3057c14/href</a></iframe><p>Here we specify a directory from which we want to get a page for prerendering. In our case, this is the root directory. Also, we should add a list of routes which we want to prerender. For demonstration purposes, I will take just first four posts.</p><p>We should also take into account that we get data asynchronously, so if we carry on building the app following this approach, we’ll get a generated HTML with no content. To address this issue, the plugin offers three next options (check the documentation for more info):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf7d56d76751c4bfe06f8e24f4bbc60e/href">https://medium.com/media/bf7d56d76751c4bfe06f8e24f4bbc60e/href</a></iframe><p>That’s all, folks! Now if we build the application, we get a prerendered HTML. If you want to manage metadata, you can use one of the available plugins for Vue, for example, vue-meta. For instance, let’s add a unique title for each page. We need to install the plugin for this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/362c9d162112c51501a5b0befeb5bfe6/href">https://medium.com/media/362c9d162112c51501a5b0befeb5bfe6/href</a></iframe><p>Add it to main.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab550bd1e93a553915587a18c60ebdb3/href">https://medium.com/media/ab550bd1e93a553915587a18c60ebdb3/href</a></iframe><p>And insert the following into src/components/Post.vue</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ebe8b617c8eb9e79631db8091bdb01f5/href">https://medium.com/media/ebe8b617c8eb9e79631db8091bdb01f5/href</a></iframe><p>It’s enough to make the content of the application indexed and also available for users with a disabled JavaScript. Now search engines and social networks can read meta-information of our site. Also, we succeeded to reduce the load time to the FMP (first meaningful paint), the browser doesn’t wait for the full load of JavaScript but starts rendering our page as soon as HTML is loaded. As a result, a user can start receiving information from our site earlier.</p><h3>When you don’t need prerendering</h3><p>Using the simple plugin prerender-spa-plugin on a build step you can easily improve search engine optimization and create the better user experience of your Vue application. Unfortunately, there are few cases when using prerendering is inappropriate.</p><ol><li>User-specific content: some page’s content, e.g. user profile page content, should be shown only for a specific user. On the build step, we don’t know who exactly will open this page, so we can’t prerender it. Anyway, if we did it, we would open user’s private information to everybody.</li><li>Frequently changing content: if you work on something like a chat or some online trading application or real-time game where content must be always relevant, usage of prerendering might be ineffective as it displays an old content until a client-side JS takes over with the latest data. As a potential solution, you could set your build to re-prerender every time as data changes, or often enough to be sure that content is relevant. But it might be very resource-consuming for the server. For the data that is updated even more frequently than every minute, you should avoid prerendering.</li><li>A large number of routes: it is not a good idea to prerender thousands of routes as this will take a lot of time to build your application.</li></ol><p>In these cases, the best way is to use server-side rendering which you will be told about in the future article.</p><h3>Useful links</h3><p><a href="https://ssr.vuejs.org/en/#ssr-vs-prerendering">The official Vue documentation</a><br><a href="https://github.com/chrisvfritz/prerender-spa-plugin">The Prerender SPA Plugin documentation</a></p><p><em>Originally posted at </em><a href="https://goo.gl/HXpU6F"><em>the ADCI Solutions website</em></a><em>.</em></p><p><strong>The autor is Dmitry Chuchin, Front-end Developer at ADCI Solutions</strong></p><p>Dmitry demonstrates an astonishing ability to learn new technologies. Moreover, he strives to share his experience by teaching novice developers and delivering sessions at educational events. Also, he loves snowboarding and mountain biking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*5kC2KhUXG-R8C8-59J1RCA.png" /></figure><p><strong>Follow us on social networks:</strong> <a href="https://twitter.com/ADCISolutions">Twitter</a> | <a href="https://www.facebook.com/adcisolutions/">Facebook</a> | <a href="https://www.linkedin.com/company/adci-solutions/">LinkedIn</a></p><p><a href="https://medium.com/drupal-stories-an-insiders-view/top-5-modules-by-the-adci-solutions-team-3351f5be328b">Top 5 modules by the ADCI Solutions team</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f38573c476ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/the-easiest-way-to-improve-your-vue-js-application-part-1-f38573c476ae">The easiest way to improve your Vue.js application. Part 1</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NodeOS: The JavaScript Based Operating System]]></title>
            <link>https://medium.com/hello-js/nodeos-the-javascript-based-operating-system-a1080d5c2977?source=rss----3dddcca454bf---4</link>
            <guid isPermaLink="false">https://medium.com/p/a1080d5c2977</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Michelle Young]]></dc:creator>
            <pubDate>Tue, 13 Mar 2018 07:19:15 GMT</pubDate>
            <atom:updated>2018-03-13T07:19:14.632Z</atom:updated>
            <content:encoded><![CDATA[<p>I am sure most programmers have heard of <a href="https://www.toptal.com/nodejs/">Node.js</a>, but what about <a href="https://node-os.com/">NodeOS</a>? Yes, NodeOS, an operating system written in Node.js. Well, kind of. NodeOS uses the Linux kernel for most performance critical stuff like, for example, hardware interactions, but for everything else it uses Node.js. NodeOS development started two years ago and was created by people who shared a simple, but intriguing, idea: <em>“Is it possible to create an operating system using only Node.js?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*_Y54iGVjaBIzE2A_.jpg" /></figure><p>Is it possible to create an operating system using only Node.js?</p><h3>What is the big deal?</h3><p>First of all, think about the progress Node.js has made in the short time it’s been around. Now, think about the same thing happening with an operating system. Then, let’s add some cool stuff to it.</p><h3>Per-user independent and isolated root filesystem</h3><p>NodeOS introduced an interesting paradigm: If all users have an isolated filesystem, it gives them a simple filesystem hierarchy to work with. Since their “home folder” is, in fact, the root of their own filesystem hierarchy, they can install packages globally without requiring special permissions and not need to configure anything since they are installed in their home directory by default. Also, it provides a good deal of security; if a hacker finds a way to get inside a particular account in the operating system, the only partition that s/he can access is the partition of that user. The end result is hacker cannot compromise the whole system.</p><h3>Node.js and NPM</h3><p>If you think about it, an operating system that uses Node.js means that any package available in NPM is, at the same time, also a NodeOS package. At the time of writing, there are 210,735 packages; since the number of NPM packages grows every minute, it would not be strange if, in a few years, NodeOS has a million applications.</p><h3>It is based on the Linux kernel</h3><p>This might not seem like a big deal, but Linux is the most-used server operating system. Since NodeOS is based on the Linux kernel, you could run every application written for other Linux distributions with minimal changes.</p><h3>The downsides</h3><p>As much as I would like a finished NodeOS, it is not there, yet. It’s still missing many key functions for a server operating system. For example, the whole BASH toolset is missing, including ps, tail, nano and grep. Furthermore, you cannot run it as a desktop operating system since it has no GUI. Sure, you can implement some of the missing features fairly easily using a bit of JavaScript, but the fact all the mentioned features are not available by default, is not good.</p><h3>So, how can I try out NodeOS?</h3><h3>Using Docker</h3><p>The easiest and quickest way to try out NodeOS is by using the following:</p><ol><li>A computer with either Mac OSX or Linux. It might work with Windows, but I did not try it.</li><li>Docker.</li></ol><p>Once you installed Docker, running an instance of NodeOS is easy. All you need to do is execute the following command, and Docker does all the magic:</p><pre>sudo docker run -t -i nodeos/nodeos</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*_U86oyhrmfPIvnqt.jpg" /></figure><p>The easiest and quickest way to try out NodeOS is by using Docker.</p><p>When you run the aforementioned command, Docker automatically downloads the disk image for NodeOS from a repository and performs the installation of NodeOS inside a virtual machine. Once the installation is completed, it opens an SSH session to the NodeOS shell.</p><h3>Without docker</h3><p>There are some reasons why you would want to avoid using Docker, and one being the latest NodeOS version. At the time of writing, the last change to the Docker image of NodeOS was performed two months ago, while the development version was updated six days ago. So, if you want to use the latest version you should definitely get the source code. That’s not too difficult, but it takes a long time. You will need:</p><ol><li>A computer with Linux. You can compile it on OS X, but it will take longer since it has to make a cross compilation. The same goes for Windows.</li><li>The Linux build utilities (make, g++, gcc, autoconf).</li><li>Qemu.</li><li>Time. Seriously, a lot.</li></ol><p>Once you have everything, you can proceed with the source code compilation:</p><ol><li>Download the project source code: bash git clone git@github.com:NodeOS/NodeOS.git.</li><li>Compile it by running following commands: cd NodeOS and npm install.</li><li>I am going to quote, word by word, the official documentation: <em>“Pick some microwave popcorn and go to see a movie. No, really, do it.”</em>. Yes, it will take that much time, so do something interesting in the meantime.</li><li>Run bash npm start to run NodeOS inside Qemu.</li></ol><h3>Is it working?</h3><p>Once the installation is completed, we can check if it is working by executing inside the NodeOS shell the command ls. An output like this should show up:</p><pre>[ &#39;etc&#39;, &#39;lib&#39;, &#39;lib64&#39;, &#39;root&#39;, &#39;bin&#39;, &#39;sys&#39;, &#39;usr&#39;, &#39;share&#39;, &#39;proc&#39; ]</pre><p>If it does, it means some basic commands are working. But, what if we want to display the network card’s IP address? Under Linux, there’s a command called ifconfig that does just that; let’s try it:</p><pre>command not found: ifconfig</pre><p>It looks like the command ifconfig is missing. That is because NodeOS does not have a default ifconfigcommand. Now, what? Well, it is simple; NodeOS has an integrated package manager (like apt or yum), called npkg, which is based on Node’s NPM and is easy to use. Installing ifconfig is as simple as running the following command:</p><pre>npkg install bin-ifconfig</pre><p>If all went well, the command ifconfig should now be available in the shell. If we try to execute it again, an output like this shows up (I put a random MAC address and IP address for obvious reasons):</p><pre>eth0: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500<br>  ether 01:23:45:67:89:ab <br>  inet6 f0cd::ef01:0203:0405:181%en1 prefixlen 64 scopeid 0x5 <br>  inet 192.168.0.21 netmask 0xffffff00 broadcast 192.168.0.21<br>  nd6 options=1&lt;PERFORMNUD&gt;<br>  media: autoselect<br>  status: active</pre><p>If your output looks kind of like that, then it is working. You’ve successfully installed your first NodeOS application: ifconfig.</p><h3>It is working. However, what do we do now with the OS?</h3><p>What is the point of having an operating system written in Node.js if you can do the same things (or even fewer things) that you can do on Ubuntu or any other Linux distribution? Well, the whole point is everything is developed by using nothing more than Node.js. It also means we can <a href="https://www.toptal.com/nodejs/why-the-hell-would-i-use-node-js">develop</a> our applications using nothing more than Node.js. For example, NodeOS does not have a default implementation for the command man, which is used on Linux to display manual pages of other commands. Fear not, implementing it is easy. How, I hear you ask? Simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*e4hd8jO1x6mT3xcZ.jpg" /></figure><p>First, let’s install a text editor called Hipster so we can create and edit files by executing the following command: npm install -g hipster@0.15.0. This file editor is simple, and definitely not something I would use as an editor for anything else, but it is good enough in this case. Creating files with Hipster is really simple, just run hip filename, like hip package.json; to save press Ctrl + s and to exit press Ctrl + q. For this example I am going to use a code developed by one of the main NodeOS developers, I have not actually implemented it, myself. The original code for our example can be found in <a href="https://github.com/groundwater/node-bin-man">the node-bin-man Git repository</a>.</p><p>Let’s get back to creating our first NodeOS application. As with every Node.js application (or NPM package), we start by creating a package.json file, as in the following example:</p><pre>{<br>  &quot;name&quot;: &quot;bin-man&quot;,<br>  &quot;version&quot;: &quot;0.0.1&quot;,<br>  &quot;description&quot;: &quot;Format and display manual pages&quot;,<br>  &quot;bin&quot;: {<br>    &quot;man&quot;: &quot;man.js&quot;<br>  },<br>  &quot;repository&quot;: &quot;https://github.com/groundwater/node-bin-man&quot;,<br>  &quot;author&quot;: &quot;groundwater&quot;,<br>  &quot;license&quot;: &quot;MIT&quot;,<br>  &quot;dependencies&quot;: {<br>    &quot;blessed&quot;: &quot;~0.0.22&quot;<br>  }<br>}</pre><p>The parameters name, version, author, repository, license, and description are self-explanatory. The bin collection is a JSON key/value object containing the command name and an associated JavaScript file. In our example, the man command is associated with the file man.js. The collection, dependencies, contains a list of NPM packages that are needed to use this application. In our example, the author of the code included Blessed, a curses-like library with a high-level terminal interface API for Node.js.</p><p>Now let’s go to the main part, the actual code.</p><pre>#!/usr/bin/env node</pre><p>This part is called “shebang”. It is not actually required by NodeOS, but it tells an operating system how to execute the following code. In our case, it tells the interpreter that everything needs to be executed with the command /usr/bin/env node.</p><pre>var fs = require(&#39;fs&#39;);<br>var blessed = require(&#39;blessed&#39;);</pre><p>Just like in Node.js, the function require() loads the selected package into memory and saves it to the specified variable.</p><pre>var arg = process.argv[2] || &#39;bin-man&#39;;</pre><p>The standard behavior of a man command is to tell a manual about itself if no other command is specified. Our code example is doing the same: If no argument is specified for the second parameter (the first being man itself), it defaults to bin-man.</p><pre>var path = process.env.HOME + &quot;/lib/node_modules/&quot; + arg + &quot;/README.md&quot;;</pre><pre>try{<br>  var readme = fs.readFileSync(path, &#39;utf-8&#39;);<br>}catch(e){<br>  console.log(&#39;No README.md for Package &#39;,arg);<br>  process.exit(-1);<br>}</pre><p>At this point, the program checks if a readme file exists for the given application. In NodeOS, the installation path of every application is the home directory (or /) followed by the directory lib/node_modules. If the file README.md exists, it saves its content inside the variable readme. Otherwise, it shows an error and exits the process.</p><pre>// Create a screen object.<br>var screen = blessed.screen();</pre><pre>var box = blessed.box({<br>  content: readme,<br>  alwaysScroll:true,<br>  scrollable: true,<br>});</pre><pre>// Append our box to the screen.<br>screen.append(box);</pre><p>Blessed has a really simple API; showing the content of a file is as easy as telling it to create a box and loading the content.</p><pre>screen.key([&#39;escape&#39;, &#39;q&#39;, &#39;C-c&#39;], function(ch, key) {<br>  return process.exit(0);<br>});</pre><p>Now, let’s create a way to exit the man application. We combine the keys escape, q or the emacs-style combination C-c to exit the process.</p><pre>screen.key([&#39;space&#39;,&#39;f&#39;,&#39;j&#39;,&#39;n&#39;], function(ch, key) {<br>  box.scroll(box.height);<br>  screen.render();<br>});</pre><pre>screen.key([&#39;down&#39;], function(ch, key) {<br>  box.scroll(1);<br>  screen.render();<br>});</pre><pre>screen.key([&#39;up&#39;], function(ch, key) {<br>  box.scroll(-1);<br>  screen.render();<br>});</pre><pre>screen.key([&#39;b&#39;,&#39;k&#39;,&#39;p&#39;], function(ch, key) {<br>  box.scroll(-box.height);<br>  screen.render();<br>});</pre><p>We use the directional keys to scroll up or down one row and the keys space, f, j or n to scroll down a page (as many lines as there are on the screen). Use b, k or p to do the reverse.</p><pre>box.focus();<br>screen.render();</pre><p>Finally, we tell the application to focus on the box we created and render the whole thing. Let’s put those files in the directory /lib/node_modules/bin-man and let’s add a simple README.md, something like this:</p><pre># Man</pre><pre>Author: @groundwater</pre><pre>## Install</pre><pre>npkg install bin-man</pre><pre>## Usage</pre><pre>```<br>Usage: man PKGNAME</pre><pre>Display a packages README.md file<br>```</pre><p>We are almost done with our first custom application for NodeOS. Only one last small step remains; we need to create a config file since it is a requirement for NodeOS applications. It is as simple as creating a file in the path /etc/bin-man/config.json with the following content: {}, an empty JSON object. Now, we can try our new application. Running man inside the NodeOS shell should show the readme file we created earlier.</p><h3>Conclusion</h3><p>As you can see with our simple code example, implementing anything in NodeOS is an easy task, you only need to know Node.js.</p><p>NodeOS has plenty of potential, and I think it could become a great operating system once additional features are implemented. It still needs work, but as a result of the popularity of the whole Node.js-based ecosystem, I would not be surprised if it quickly becomes a popular operating system quickly. What do you think about it? Let me know in the comments.</p><p>This <a href="https://www.toptal.com/nodejs/nodeos-the-javascript-based-operating-system">post </a>was written by <a href="https://www.toptal.com/resume/danny-morabito">Danny Morabito</a>, PHP Developer for <a href="https://www.toptal.com/nodejs">Toptal</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1080d5c2977" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hello-js/nodeos-the-javascript-based-operating-system-a1080d5c2977">NodeOS: The JavaScript Based Operating System</a> was originally published in <a href="https://medium.com/hello-js">hello JS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>