<?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[Stories by Clever.ly on Medium]]></title>
        <description><![CDATA[Stories by Clever.ly on Medium]]></description>
        <link>https://medium.com/@buildcleverly?source=rss-a1970a169e26------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*aecy4S8-0RWqHwnZ.jpg</url>
            <title>Stories by Clever.ly on Medium</title>
            <link>https://medium.com/@buildcleverly?source=rss-a1970a169e26------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:09:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@buildcleverly/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The complete guide to Auditing Google AdWords]]></title>
            <link>https://medium.com/@buildcleverly/the-complete-guide-to-auditing-google-adwords-b6c452c98fa3?source=rss-a1970a169e26------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6c452c98fa3</guid>
            <category><![CDATA[search]]></category>
            <category><![CDATA[adwords-analysis]]></category>
            <category><![CDATA[adwords-audit]]></category>
            <category><![CDATA[adwords-campaign]]></category>
            <category><![CDATA[adwords]]></category>
            <dc:creator><![CDATA[Clever.ly]]></dc:creator>
            <pubDate>Tue, 13 Jun 2017 18:26:29 GMT</pubDate>
            <atom:updated>2017-06-13T18:26:32.571Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*80k4wipsSJ5dUzgQ.png" /></figure><p>This is part one of a 3 part series on auditing a search campaign in Google AdWords focusing on settings, keywords and landing pages. Since there is so much here and you dont want to do everything at once for fear of not knowing what worked and what didn’t, I’ll start with the foundation, then continue in subsequent posts with the ancillary things.</p><p>There are a few reasons you might be wanting to audit an AdWords campaign. Regular account optimization on your long running accounts, analyzing young accounts for initial optimization, you’ve seen a sudden increase or decrease in a certain metric such as CPC or CTR, or maybe you’ve been tasked with assessing someone else’s account.</p><p>Whether you’re auditing your own AdWords campaigns or examining someone else’s, it’s always nice to have a list to reference. This is the list I use. It’s always growing and changing based on current best practice and features of AdWords that come and go, so I’ll update this post accordingly.</p><p>My focus during any PPC evaluation is always:</p><ul><li>lowering cost per click (CPC)</li><li>raising click through rate (CTR)</li><li>targeting more potential customers</li><li>providing value and ease of use to a user who finds my ad</li></ul><p>Keeping these things in mind always keeps the train on the tracks and everything from account organization to optimization generally falls in line behind that.</p><h4><strong>Settings</strong></h4><p>I always start with settings since this is the foundation of a campaign.</p><p>In campaign settings starting with Campaign Type check the following:</p><p><strong>Network</strong> — Is this campaign showing on the <strong>search network only</strong>, or on display networks as well. What you’ll want depends on your objectives, but generally, if I’m running a search campaign, I dont want those ads on the display network as well. A display campaign would run entirely different in most cases and you won’t have that control.</p><p><strong>Standard or All Features</strong> — The standard option keeps things simple, but you don’t get nearly the optimization functionality that you get with All Features. By Turning on All Features you activate:</p><ul><li>Advanced social and experimental settings</li><li>Ad scheduling and ad delivery method options</li><li>Advanced location options</li><li>Mobile app extensions</li><li>Advanced keyword matching</li><li>IP exclusions</li><li>Dynamic tracking URLs</li><li>Remarketing lists for Search ads</li></ul><p>There are other features in this setting, but the main ones you’ll probably be adjusting the most are those above.</p><p><strong>Networks</strong> — By default the search partners option is turned on here. I have never had this work well. Always turn this off.</p><p><strong>Devices</strong> — Once you have some data in your campaign, or if you already know that you’re targeting certain devices this is where you’ll adjust the bid for mobile, desktop computers, and tablets. If you want to turn one of them up all the way adjust the bid to +100%. If you want to turn one completely off, change the bid to -100%.</p><p><strong>Locations</strong> — In this section you can target many different location types and demographics such as income tiers. Looking at your historical data can tell you which locations to target and which to exclude based on metrics such as CTR, CPC, and conversion rate.</p><p><strong>Languages</strong> — thi only affects the Google display network, so when Optimizing a search campaign this is a non issue, but for optimizing a display campaign, AdWords “looks at a user’s Google language setting or the language of the user’s search query, currently viewed page, or recently viewed pages on the Google Display Network (GDN).”</p><p><strong>Bid Strategy </strong>— This is a whole other ball of wax and has a huge impact on your campaign. If you dont know which strategy to use for your campaign, start by reading Google’s documentation <a href="https://support.google.com/adwords/answer/2472725?hl=en">here</a>.</p><p><strong>Budget</strong> — This is a simple one, yet budget isnt directly correlated to clicks. As you’ve probably noticed budget is most efficient at lower numbers and gets less efficient as budget goes up. Google is a business after all.</p><p><strong>Ad Extensions</strong> — Make sure the global ad extensions that you want to span all of the ad groups in the campaign are here.</p><h4><strong>Keywords</strong></h4><p><strong>Keyword quality score</strong> — This is a big one. Your keyword’s quality score is highly dependant on how relevant your ad copy is, as well as the landing page that ad points to. The keyword(s) should be found in both of these things. The more relevant your ad and landing pages are, the better your quality score. The better your score, the more often your ad will be served and the cheaper it will be to serve it. make sure you have<strong> landing pages that are relevant to your most searched terms</strong>, and optimize current page copy for most searched terms. This changes periodically so this is worth revisiting regularly.</p><p><strong>Example</strong>: If your most searched keyword is “baseball hitting drills” and the ads point to the home page, but the home page doesn’t say “baseball hitting drills” on it, the relevancy score of the keyword will be lower than it could be, which makes the cost higher and makes it not served as often as it could be.</p><p>You can find what people are typing into Google in the keyword tab under Search terms.</p><figure><img alt="Adwords Keyword search terms" src="https://cdn-images-1.medium.com/max/1024/0*z24B6yVB5Mw3B7yU.jpg" /></figure><p><strong>Single keyword add groups </strong>— Make sure you add highly searched terms as exact match terms in their own single keyword add groups (SKAGs). If you have only a few ad groups that have a ton of keywords in them, your ad copy and landing pages probably won’t be very targeted to your keyword. It’s worth the time it takes to separate out your most popular words and put them into their own groups with relevant ad copy.</p><p><strong>Multiple keyword match type ad groups</strong> — Within these SKAGs ad a broad match, exact match, and phrase match type of that keyword. Then keep an eye on those types and see which one performs the way you want. different keywords and different goals make different match types a priority, or sometimes, leaving all 3 is best.</p><p><strong>Add additional keywords</strong> and keyword phrases based on search terms currently being used but that are not being specifically targeted in your keyword list. Often, the searcher may not be searching for what you think they will be because you know the industry lingo and they dont.</p><p><strong>Remove duplicate keywords</strong> — The more keywords you have in your search campaign, the easier it is to have some duplicate keywords that are competing against each other in different ad groups that you don’t realize. If this is the case they are competing against each other and driving up your costs by bidding against themselves. You can easliy check this by opening the keywords for the campaign as a whole, and sorting by keywords alphabetically.</p><p>This concludes the first part of this series on an AdWords search audit. In the next post we’ll be tackling</p><p>Targeting</p><p>Remarketing</p><p>Extensions</p><p>Reviews</p><p><em>Originally published at </em><a href="https://clever.ly/blog/2017/06/13/the-complete-guide-to-auditing-google-adwords/"><em>Clever.ly Blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6c452c98fa3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple, Tear Free Webpack Config with ES6 and SCSS]]></title>
            <link>https://medium.com/@buildcleverly/simple-tear-free-webpack-config-with-es6-and-scss-4b7014b60928?source=rss-a1970a169e26------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b7014b60928</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[scss]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Clever.ly]]></dc:creator>
            <pubDate>Wed, 31 May 2017 23:12:27 GMT</pubDate>
            <atom:updated>2017-05-31T23:12:30.415Z</atom:updated>
            <content:encoded><![CDATA[<p>If there are two things that webpack is good for, it’s transpiling and packing code into nice, neat bundles for use on the web, node, cordova, electron, etc and making developers re-evaluate their life choices.</p><p>In this tutorial, we will attempt to focus on the former and mitigate the latter.</p><h4><strong>What we’ll be building</strong></h4><p>A webpack configuration that accomplishes the following:</p><ul><li>Transpiles ES6 into compatible javascript for the web</li><li>Separates dependencies from application code into a different file for caching purposes</li><li>Generates a css file using SCSS</li><li>Takes a template html file and injects it with generated bundle files</li><li>Generates visual stats about the build for further optimization</li><li>Minifies all code and adds content based hashes to filenames in production</li></ul><h4><strong>Lets get started!</strong></h4><p>This tutorial assumes that you have node installed. If you don’t, I highly recommend <a href="https://github.com/creationix/nvm">NVM</a>. It makes managing node versions and switching back and forth between versions super easy.</p><p>All of the code for this tutorial is available at <a href="https://github.com/cleverly/simple-webpack-demo">this GitHub repo</a>. You can clone the repo or start from scratch and follow along. Here we go!</p><pre>// First, create a directory for this tutorial<br>mkdir simple-webpack-demo &amp;&amp; cd simple-webpack-demo</pre><p>We like to use yarn but you can use npm if you like. We’ll make sure to provide both yarn and npm snippets using a format like:</p><pre>yarn command || npm command</pre><p>Just choose your favorite side!</p><pre>// Initialize your project<br>yarn init || npm init</pre><p>Now that you have a package.json let’s add some scripts.</p><pre>&quot;scripts&quot;: {<br>  &quot;dev&quot;: &quot;rimraf dist &amp;&amp; webpack --watch&quot;,<br>  &quot;prod&quot;: &quot;rimraf dist &amp;&amp; cross-env NODE_ENV=production webpack&quot;<br>},</pre><p>Go ahead and make any other changes you like to your package.json like updating the name, version, license, etc.</p><p>Add a .gitignore and include the following:</p><pre>node_modules<br>.DS_Store<br>dist</pre><p>Now, let’s add some dependencies!</p><pre>yarn add --dev buble-loader cross-env css-loader extract-text-webpack-plugin html-webpack-plugin jquery moment node-sass raf rimraf sass-loader webpack webpack-bundle-analyzer<br>||<br>npm install --save-dev buble-loader cross-env css-loader extract-text-webpack-plugin html-webpack-plugin jquery moment node-sass raf rimraf sass-loader webpack webpack-bundle-analyzer</pre><p>Finally, let’s add our webpack config and some files to pack with webpack. Our directory structure should look something like this:</p><pre>|src/<br>|  |js/<br>|  |  |demo.js<br>|  |  |index.js<br>|  |scss/<br>|  |  |_global.scss<br>|  |  |_reset.scss<br>|  |  |_vars.scss<br>|  |  |index.scss<br>|  |index.template.html<br>|.gitignore<br>|package.json<br>|webpack.config.js</pre><p>The files in src/ are mostly inconsequential demo stuff. The important things to note are that in the .js files we will be able to use ES6 features like classes and module imports/exports. We’re requiring our main scss file in the main javascript file (Kind of weird, but don’t worry. Webpack will sort all of that out).</p><p>Let’s get all of the code copied into their files and then we’ll regroup and break down the webpack config.</p><p>Begin copy paste frenzy!</p><pre>// src/js/demo.js<br><br>import moment from &#39;moment&#39;<br>import raf from &#39;raf&#39;<br>import $ from &#39;jquery&#39;<br><br>raf.polyfill()<br><br>export default class Demo {<br>    constructor() {<br>        this.$date = $(&#39;#date&#39;)<br>        this.$time = $(&#39;#time&#39;)<br>        this.$timeToggle = $(&#39;#time-toggle&#39;)<br>        this.timeRunning = false<br>        this.timeHandle = null<br><br>        this.$timeToggle.on(&#39;click&#39;, this.toggleTime.bind(this))<br>    }<br>    moment(format) {<br>        return moment(Date.now()).format(format)<br>    }<br>    setDate() {<br>        this.$date.text(this.moment(&#39;MMM Do, YYYY&#39;))<br>    }<br>    setTime() {<br>        this.$time.text(this.moment(&#39;h:mm:ss a&#39;))<br>        this.timeHandle = raf(this.setTime.bind(this))<br>    }<br>    startTime() {<br>        this.timeHandle = raf(this.setTime.bind(this))<br>        this.$timeToggle.text(&#39;Stop Time&#39;)<br>        this.timeRunning = true<br>    }<br>    stopTime() {<br>        raf.cancel(this.timeHandle)<br>        this.$timeToggle.text(&#39;Start Time&#39;)<br>        this.timeRunning = false<br>    }<br>    toggleTime(e) {<br>        if (e) {<br>            e.preventDefault()<br>        }<br>        this.timeRunning ? this.stopTime() : this.startTime()<br>    }<br>}</pre><pre>// src/js/index.js<br><br>import $ from &#39;jquery&#39;<br>import Demo from &#39;./demo.js&#39;<br><br>require(&#39;../scss/index.scss&#39;)<br><br>$(document).ready(()=&gt; {<br>    const demo = new Demo()<br>    demo.setDate()<br>    demo.startTime()<br>})</pre><pre>// src/scss/_global.scss<br><br>body {<br>    font-family: $body-font;<br>    background-color: $body-background;<br>    color: $body-color;<br>    font-size: 100%;<br>}<br><br>a {<br>    color: $primary;<br>    text-decoration: none;<br>    &amp;:hover {<br>        color: $secondary;<br>    }<br>}<br><br>strong {<br>    font-weight: 500;<br>}<br><br>header {<br>    background-color: $header-background;<br>    color: $header-color;<br>    padding: $standard-padding;<br>    font-size: 2rem;<br>    font-weight: bold;<br>}<br><br>main {<br>    padding: $standard-padding;<br>    font-size: 1.2rem;<br>}</pre><pre>// src/scss/_reset.scss<br><br>/*<br>html5doctor.com Reset Stylesheet<br>v1.6.1<br>Last Updated: 2010-09-17<br>Author: Richard Clark - <a href="http://richclarkdesign.com/">http://richclarkdesign.com</a><br>Twitter: @rich_clark<br>*/<br><br>html, body, div, span, object, iframe,<br>h1, h2, h3, h4, h5, h6, p, blockquote, pre,<br>abbr, address, cite, code,<br>del, dfn, em, img, ins, kbd, q, samp,<br>small, strong, sub, sup, var,<br>b, i,<br>dl, dt, dd, ol, ul, li,<br>fieldset, form, label, legend,<br>table, caption, tbody, tfoot, thead, tr, th, td,<br>article, aside, canvas, details, figcaption, figure,<br>footer, header, hgroup, menu, nav, section, summary,<br>time, mark, audio, video {<br>    margin:0;<br>    padding:0;<br>    border:0;<br>    outline:0;<br>    font-size:100%;<br>    vertical-align:baseline;<br>    background:transparent;<br>}<br><br>body {<br>    line-height:1;<br>}<br><br>article,aside,details,figcaption,figure,<br>footer,header,hgroup,menu,nav,section {<br>    display:block;<br>}<br><br>nav ul {<br>    list-style:none;<br>}<br><br>blockquote, q {<br>    quotes:none;<br>}<br><br>blockquote:before, blockquote:after,<br>q:before, q:after {<br>    content:&#39;&#39;;<br>    content:none;<br>}<br><br>a {<br>    margin:0;<br>    padding:0;<br>    font-size:100%;<br>    vertical-align:baseline;<br>    background:transparent;<br>}<br><br>/* change colours to suit your needs */<br>ins {<br>    background-color:#ff9;<br>    color:#000;<br>    text-decoration:none;<br>}<br><br>/* change colours to suit your needs */<br>mark {<br>    background-color:#ff9;<br>    color:#000;<br>    font-style:italic;<br>    font-weight:bold;<br>}<br><br>del {<br>    text-decoration: line-through;<br>}<br><br>abbr[title], dfn[title] {<br>    border-bottom:1px dotted;<br>    cursor:help;<br>}<br><br>table {<br>    border-collapse:collapse;<br>    border-spacing:0;<br>}<br><br>/* change border colour to suit your needs */<br>hr {<br>    display:block;<br>    height:1px;<br>    border:0;<br>    border-top:1px solid #cccccc;<br>    margin:1em 0;<br>    padding:0;<br>}<br><br>input, select {<br>    vertical-align:middle;<br>}</pre><pre>// src/scss/_vars.scss<br><br>$white: #eee;<br>$black: #111;<br><br>$primary: green;<br>$secondary: purple;<br><br>$header-background: $black;<br>$header-color: $white;<br>$body-font: &#39;Roboto&#39;, sans-serif;<br>$body-background: $white;<br>$body-color: $black;<br><br>$standard-padding: 20px;</pre><pre>// src/scss/index.scss<br><br>@import &#39;reset&#39;;<br>@import &#39;vars&#39;;<br>@import &#39;global&#39;;</pre><pre>// src/index.template.html<br><br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>    &lt;head&gt;<br>        &lt;title&gt;ES6 Webpack Demo&lt;/title&gt;<br>        &lt;meta charset=&quot;utf-8&quot;&gt;<br>        &lt;link href=&quot;https://fonts.googleapis.com/css?family=Roboto:400,500,700&quot; rel=&quot;stylesheet&quot;&gt;<br>        &lt;% for (var chunk of webpack.chunks) {<br>            for (var file of chunk.files) {<br>                if (file.match(/\.(js|css)$/)) { %&gt;<br>                    &lt;link rel=&quot;&lt;%= chunk.initial?&#39;preload&#39;:&#39;prefetch&#39; %&gt;&quot; href=&quot;&lt;%= htmlWebpackPlugin.files.publicPath + file %&gt;&quot; as=&quot;&lt;%= file.match(/\.css$/)?&#39;style&#39;:&#39;script&#39; %&gt;&quot;&gt;<br>                &lt;% }<br>            }<br>        } %&gt;<br>    &lt;/head&gt;<br>    &lt;body&gt;<br>        &lt;header&gt;<br>            &lt;h1&gt;ES6 Webpack Demo&lt;/h1&gt;<br>        &lt;/header&gt;<br>        &lt;main&gt;<br>            &lt;div&gt;&lt;strong&gt;Today&#39;s date is&lt;/strong&gt;: &lt;span id=&quot;date&quot;&gt;&lt;/span&gt;&lt;/div&gt;<br>            &lt;br&gt;<br>            &lt;div&gt;&lt;strong&gt;The current time is&lt;/strong&gt;: &lt;span id=&quot;time&quot;&gt;&lt;/span&gt;&lt;/div&gt;<br>            &lt;br&gt;<br>            &lt;a href=&quot;#!&quot; id=&quot;time-toggle&quot;&gt;Stop Time&lt;/a&gt;<br>        &lt;/main&gt;<br>    &lt;/body&gt;<br>&lt;/html&gt;</pre><pre>// webpack.config.js<br><br>const path = require(&#39;path&#39;)<br>const webpack = require(&#39;webpack&#39;)<br>const ExtractTextPlugin = require(&#39;extract-text-webpack-plugin&#39;)<br>const HTMLPlugin = require(&#39;html-webpack-plugin&#39;)<br>const { BundleAnalyzerPlugin } = require(&#39;webpack-bundle-analyzer&#39;)<br>const isProd = process.env.NODE_ENV === &#39;production&#39;<br>const config = {<br>    devtool: &#39;#eval-source-map&#39;,<br>    entry: &#39;./src/js/index.js&#39;,<br>    output: {<br>        filename: isProd ? &#39;[name].[chunkhash].js&#39; : &#39;[name].js&#39;,<br>        path: path.resolve(__dirname, &#39;dist&#39;)<br>    },<br>    module: {<br>        rules: [{<br>            test: /\.js$/,<br>            loader: &#39;buble-loader&#39;,<br>            exclude: /node_modules/,<br>            options: {<br>                objectAssign: &#39;Object.assign&#39;<br>            }<br>        }, {<br>            test: /\.scss$/,<br>            loader: ExtractTextPlugin.extract([&#39;css-loader&#39;, &#39;sass-loader&#39;])<br>        }]<br>    },<br>    plugins: [<br>        new ExtractTextPlugin(isProd ? &#39;index.[chunkhash].css&#39; : &#39;index.css&#39;),<br>        new webpack.optimize.CommonsChunkPlugin({<br>            name: &#39;vendor&#39;,<br>            minChunks: function(module) {<br>                return module.context &amp;&amp; module.context.indexOf(&#39;node_modules&#39;) !== -1<br>            }<br>        }),<br>        new webpack.optimize.CommonsChunkPlugin({<br>            name: &#39;manifest&#39;<br>        }),<br>        new HTMLPlugin({<br>            template: &#39;src/index.template.html&#39;,<br>            minify: {<br>                collapseWhitespace: isProd<br>            }<br>        }),<br>        new BundleAnalyzerPlugin({<br>            analyzerMode: &#39;static&#39;,<br>            reportFilename: &#39;stats.html&#39;,<br>            defaultSizes: &#39;parsed&#39;,<br>            openAnalyzer: false<br>        })<br>    ]<br>}<br><br>if (isProd) {<br>    config.devtool = &#39;#source-map&#39;<br>    config.plugins.push(<br>        new webpack.LoaderOptionsPlugin({<br>            minimize: true<br>        }),<br>        new webpack.optimize.UglifyJsPlugin({<br>            sourceMap: true<br>        })<br>    )<br>}<br><br>module.exports = config</pre><p>Now that all of the code has been copied, you should be able to run</p><pre>yarn run dev || npm run dev<br>or<br>yarn run prod || npm run prod</pre><p>to generate a bundle in dist/</p><p>But what exactly is going on? Let’s break down the webpack config to figure that out.</p><h4><strong>Webpack Config</strong></h4><pre>const path = require(&#39;path&#39;)<br>const webpack = require(&#39;webpack&#39;)<br>const ExtractTextPlugin = require(&#39;extract-text-webpack-plugin&#39;)<br>const HTMLPlugin = require(&#39;html-webpack-plugin&#39;)<br>const { BundleAnalyzerPlugin } = require(&#39;webpack-bundle-analyzer&#39;)<br>const isProd = process.env.NODE_ENV === &#39;production&#39;<br>...</pre><p>First we require some dependencies for use in our config and we determine whether or not this is a production build.</p><p><strong>ExtractTextPlugin</strong> is responsible for taking all of our generated css and puts it into a css file.</p><p><strong>HTMLPlugin</strong> takes our index.template.html file, injects it with the files that webpack outputs using script or link tags and creates our index.html file.</p><p><strong>BundleAnalyzerPlugin</strong> generates information about our webpack bundle including file sizes, what code is in which file and puts it into a fancy FoamTree tree map.</p><pre>...<br>const config = {<br>    devtool: &#39;#eval-source-map&#39;,<br>    entry: &#39;./src/js/index.js&#39;,<br>    output: {<br>        filename: isProd ? &#39;[name].[chunkhash].js&#39; : &#39;[name].js&#39;,<br>        path: path.resolve(__dirname, &#39;dist&#39;)<br>    },<br>    ...<br>}<br>...</pre><p><strong>config</strong> is our actual webpack config that will ultimately be used to generate our bundle.</p><p><strong>devtool</strong> tells webpack what kind of sourcemaps to use.</p><p><strong>entry</strong> this is the entry point for our bundle.</p><p><strong>output</strong> as the name implies, this is where we tell webpack where to put our bundle and what to name js files. <strong>filename</strong> uses a ternary expression with the isProd variable we defined earlier to determine whether or not to include a hash in the filename. No need to worry about hashed in development. <strong>path</strong> tells webpack where to put files. In this case we want our entire bundle to be output under dist/</p><pre>...<br>const config = {<br>    ...<br>    module: {<br>        rules: [{<br>            test: /\.js$/,<br>            loader: &#39;buble-loader&#39;,<br>            exclude: /node_modules/,<br>            options: {<br>                objectAssign: &#39;Object.assign&#39;<br>            }<br>        }, {<br>            test: /\.scss$/,<br>            loader: ExtractTextPlugin.extract([&#39;css-loader&#39;, &#39;sass-loader&#39;])<br>        }]<br>    },<br>    ...<br>}<br>...</pre><p><strong>module.rules</strong> tells webpack how to handle different files. The main gist is that in each object in the <strong>rules</strong> array you specify a <strong>test</strong> which is just some regex that we use to test for file extensions.</p><p>For the first rule, we specify a test for .js files. We then say to use buble-loader which is what transpiles our ES6. We also exclude node_modules from transpilation and specify some buble-loader specific options. This particular option tells buble-loader that we want to use object spreading syntax.</p><p>The second rule tests for .scss files. An important note here is that webpack loaders work right to left. This means that when webpack encounters a .scss file the contents get passed to sass-loader the output of which gets passed to css-loader which then gets passed to <strong>ExtractTextPlugin</strong>.</p><pre>...<br>const config = {<br>    ...<br>    plugins: [<br>        new ExtractTextPlugin(isProd ? &#39;index.[chunkhash].css&#39; : &#39;index.css&#39;),<br>        new webpack.optimize.CommonsChunkPlugin({<br>            name: &#39;vendor&#39;,<br>            minChunks: function(module) {<br>                return module.context &amp;&amp; module.context.indexOf(&#39;node_modules&#39;) !== -1<br>            }<br>        }),<br>        new webpack.optimize.CommonsChunkPlugin({<br>            name: &#39;manifest&#39;<br>        }),<br>        new HTMLPlugin({<br>            template: &#39;src/index.template.html&#39;,<br>            minify: {<br>                collapseWhitespace: isProd<br>            }<br>        }),<br>        new BundleAnalyzerPlugin({<br>            analyzerMode: &#39;static&#39;,<br>            reportFilename: &#39;stats.html&#39;,<br>            defaultSizes: &#39;parsed&#39;,<br>            openAnalyzer: false<br>        })<br>    ]<br>}<br>...</pre><p>Here we have <strong>plugins</strong>. You can use webpack plugins to fine tune how the bundle is generated and some webpack loaders are used with a plugin, like <strong>ExtractTextPlugin</strong>.</p><p>First we tell <strong>ExtractTextPlugin</strong> what to call our css file using a similar ternary to <strong>output.filename</strong>.</p><p>Next we use <strong>webpack.optimize.CommonChunkPlugin</strong> to create a new file called vendor. Using the <strong>minChunks</strong> method which should return true or false, we tell webpack whether or not to include the code in the vendor file. Here we are saying to include the files in vendor if they come from node_modules</p><p>Again we use <strong>webpack.optimize.CommonChunkPlugin</strong> to create another file called manifest. The purpose of this file is to keep track of the main file and the vendor file. This is necessary to ensure that changing app code doesn’t change the vendor hash which will allow end users to keep using the cached version of a vendor file, so long as the dependencies don’t change.</p><p>Next <strong>HTMLPlugin</strong> is used to take our index.template.html file, inject it with our bundle files, and in production, minify.</p><p>Finally we have <strong>BundleAnalyzerPlugin</strong> which generates a stats.html file with our bundle so we can get valuable information about our bundle.</p><pre>...<br>if (isProd) {<br>    config.devtool = &#39;#source-map&#39;<br>    config.plugins.push(<br>        new webpack.LoaderOptionsPlugin({<br>            minimize: true<br>        }),<br>        new webpack.optimize.UglifyJsPlugin({<br>            sourceMap: true<br>        })<br>    )<br>}<br><br>module.exports = config</pre><p>Here we change a few things in production right before exporting our config for use with webpack.</p><p>If we’re in production mode, we first change <strong>config.devtool</strong> to a production sourcemap (We could have also used a ternary in the config like we did with <strong>config.output.filename</strong>). Then we push two more plugins into <strong>config.plugins</strong>. The first plugin tells webpack loaders to minimize their output and the second tells webpack to uglify our javascript.</p><h4><strong>Now what?</strong></h4><p>Now that you have a working webpack config, the sky’s the limit. Read up on the <a href="https://webpack.js.org/">webpack documentation</a></p><p>Don’t like SCSS swap it with the preprocessor you do like.</p><p>Add a front end framwork like Vue or React.</p><p>Create a <a href="https://clever.ly/blog/2017/05/01/progressive-web-apps-the-convergence-of-web-and-mobile-apps/">PWA</a>.</p><p>Implement code splitting.</p><p>Most importantly, have fun and check out our <a href="https://clever.ly/blog">Blog</a> for more awesome posts!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b7014b60928" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MAY 9, 2017 BY MAX PENNINGTON]]></title>
            <link>https://medium.com/@buildcleverly/may-9-2017-by-max-pennington-9c30a4db8181?source=rss-a1970a169e26------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c30a4db8181</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[native-components]]></category>
            <dc:creator><![CDATA[Clever.ly]]></dc:creator>
            <pubDate>Tue, 09 May 2017 23:09:42 GMT</pubDate>
            <atom:updated>2017-05-09T23:09:42.649Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://clever.ly/blog/2017/05/09/going-native-creating-native-modules-in-react-native/"><strong>MAY 9, 2017</strong></a><strong> BY </strong><a href="https://clever.ly/blog/author/max/"><strong>MAX PENNINGTON</strong></a></p><h3>Going Native: Creating Native Modules in React Native</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGksfbmoDNHvl1xu9ZfnbQ.png" /></figure><p>With React’s popularity and widespread usage on the web, it was bound to bleed over into the mobile space. And bleed over it did with React Native. React Native allows us to write mobile applications using JavaScript. This way, as web developers, we get to implement the language we are familiar with to write apps for Android and IOS with native performance. A large part of what React Native does is abstract platform APIs by way of what are called native modules. Besides the modules that React Native needs to actually run, there are many others that let us for example, change the status bar color, interact with the keyboard, use native date pickers, etc.</p><p>As mentioned before, React Native provides an impressive amount of native modules that give you direct access to core platform APIs on both Android and IOS. However, there are many APIs that React Native does not give you access to out of the box. It would be an untenable undertaking for the React Native team to provide an abstraction for <em>every</em> single available API on Android and IOS. As such they have made React Native extensible in this regard. This allows us to create our own native modules. With this, if there’s a native functionality we need access to, we can write the abstraction ourselves or look to the community for someone who has. While the latter will usually get you what you need, there are times where you’ll need to write your own. And that is exactly what we’re about to do! The following tutorial will consist of us writing a React Native native module from scratch.</p><p>We’re going to be making a native module that gives us access to the Android navigation bar. Our objective is to allow for changing the color of the bar. The module we make will behave very similarly to the StatusBar module that is included with React Native. Our expected outcome is to make the following work:</p><p>NavigationBar.setColor(‘#000000’)</p><p><a href="https://gist.github.com/Maxobat/1dc744dc0f35ac1875810f176f95a38d/raw/8528d29816cad6b47166ee86db91b996b20836d7/outcome-example.js">view raw</a><a href="https://gist.github.com/Maxobat/1dc744dc0f35ac1875810f176f95a38d#file-outcome-example-js">outcome-example.js</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>To accomplish this, we’re going to need to write some Java. Let’s get started!</p><p>Note. This tutorial will require a working React Native app. If you need help getting one going, take a look at the <a href="https://facebook.github.io/react-native/docs/getting-started.html">getting started guide</a>. Make sure you have the app ready to build for Android as the module we are making will interact with an Android platform API.</p><p>Before we begin, we’ll create a React Native component where we will eventually use our native module. We’ll use the following as a start.</p><p>import React, { Component } from ‘react’import { View, Text } from ‘react-native’ export default class ExampleComponent extends Component { render() { return ( &lt;View&gt; &lt;Text&gt; We will set the navigation bar color! &lt;/Text&gt; &lt;/View&gt; ) }}</p><p><a href="https://gist.github.com/Maxobat/c8446631a12eada59b51464f6f0ec52a/raw/19364f5c0aa35660162e73e50510460d73c4e454/base-react-native-component.jsx">view raw</a><a href="https://gist.github.com/Maxobat/c8446631a12eada59b51464f6f0ec52a#file-base-react-native-component-jsx">base-react-native-component.jsx</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>This will render:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*4zjrjOP47j_33GXa.png" /></figure><p>To start, we’re going to need to create a Java package for our module. In android/app/src/main/java/com/[app name], create a folder called navigationbar. In that folder, create a file called NavigationBarPackage.java.</p><p>That file should consist of the following:</p><p>package com.[app name].navigationbar; import com.facebook.react.ReactPackage;import com.facebook.react.bridge.JavaScriptModule;import com.facebook.react.bridge.NativeModule;import com.facebook.react.bridge.ReactApplicationContext;import com.facebook.react.uimanager.ViewManager; import java.util.ArrayList;import java.util.Collections;import java.util.List; public class NavigationBarPackage implements ReactPackage { @Override public List&lt;NativeModule&gt; createNativeModules(ReactApplicationContext reactContext) { List&lt;NativeModule&gt; modules = new ArrayList&lt;&gt;(); return modules; } @Override public List&lt;Class&lt;? extends JavaScriptModule&gt;&gt; createJSModules() { return Collections.emptyList(); } @Override public List&lt;ViewManager&gt; createViewManagers(ReactApplicationContext reactContext) { return Collections.emptyList(); }}</p><p><a href="https://gist.github.com/Maxobat/028a7d52f6fb7e2a42118a27c82d12c0/raw/cf2ae67dd08eb2a2ff89b5d916bc7c7fca224e51/base-react-native-java-package.java">view raw</a><a href="https://gist.github.com/Maxobat/028a7d52f6fb7e2a42118a27c82d12c0#file-base-react-native-java-package-java">base-react-native-java-package.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>This file, as you will see later when we build on to it, provides a point of registration for the module.</p><p>Next, we will create the module itself. In the navigationbar directory, create another file. Name this oneNavigationBarModule.java. To start, this file will contain the following:</p><p>package com.[app name].navigationbar; import com.facebook.react.bridge.ReactContextBaseJavaModule;import com.facebook.react.bridge.Callback;import com.facebook.react.bridge.ReadableMap;import com.facebook.react.bridge.NativeModule;import com.facebook.react.bridge.ReactApplicationContext;import com.facebook.react.bridge.ReactContext;import com.facebook.react.bridge.ReactMethod; import java.util.Map; public class NavigationBarModule extends ReactContextBaseJavaModule { public NavigationBarModule(ReactApplicationContext reactContext) { super(reactContext); } @Override public String getName() { return “NavigationBar”; }}</p><p><a href="https://gist.github.com/Maxobat/80a2c612bd97506898620cdd4aaae3e1/raw/3c12668e26d2c1825ea7b3637aebb7f29c554ad0/base-react-native-module.java">view raw</a><a href="https://gist.github.com/Maxobat/80a2c612bd97506898620cdd4aaae3e1#file-base-react-native-module-java">base-react-native-module.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>The item to note in this file is the getName method. This is where we will supply the name of the module for its JavaScript counterpart. The name we provide here is exactly the name that will be used in our JS.</p><p>Next, in our module class we will expose a method to our JavaScript module. Our first one will be the setColor method. It’s important to note that to properly expose the method to our JavaScript, we must annotate it using @ReactMethod.</p><p>@ReactMethodpublic void setColor(final String color) { // Method content}</p><p><a href="https://gist.github.com/Maxobat/f6ea467b282b8fb2d00152907a05287c/raw/3f69b2a52de6ac5d7b69d77e81cb367b1266daf6/set-color-method-empty.java">view raw</a><a href="https://gist.github.com/Maxobat/f6ea467b282b8fb2d00152907a05287c#file-set-color-method-empty-java">set-color-method-empty.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>Our set color method will have a return type of void (all exposed methods must return void). It will take a single string argument. Before we continue on with this method we first need to import some dependencies needed for this method to do its job. Place the following snippet above the module’s class definition.</p><p>import android.app.Activity;import android.view.Window;import android.graphics.Color;</p><p><a href="https://gist.github.com/Maxobat/e4bbbc08011ab5b991c6bf515f57a2a3/raw/5d094749c18f8dcb295405e6df5ce5c3285b5446/color-imports.java">view raw</a><a href="https://gist.github.com/Maxobat/e4bbbc08011ab5b991c6bf515f57a2a3#file-color-imports-java">color-imports.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>Now, back to the method. The first thing we need to do is get the running Android activity.</p><p>final Activity activity = getCurrentActivity();</p><p><a href="https://gist.github.com/Maxobat/6ac968dbb933dc67338299d7a890359e/raw/b9f001161b51ef0bcebb20485a42aa59758a7e2e/get-current-activity.java">view raw</a><a href="https://gist.github.com/Maxobat/6ac968dbb933dc67338299d7a890359e#file-get-current-activity-java">get-current-activity.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>Next, we need to take the color string we were given, then convert it color integer that we’ll use as our value when setting the navigation bar color.</p><p>final int colorInt = Color.parseColor(color);</p><p><a href="https://gist.github.com/Maxobat/060f3bfa1e46102986d1e7573c1ef426/raw/b96d5ded4ad1661eda857205f064ec0a0c4c27dd/parse-color.java">view raw</a><a href="https://gist.github.com/Maxobat/060f3bfa1e46102986d1e7573c1ef426#file-parse-color-java">parse-color.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>Finally, we will actually set the color of the navigation bar with the activity we just retrieved.</p><p>activity.getWindow().setNavigationBarColor(colorInt);</p><p><a href="https://gist.github.com/Maxobat/f715fe7504088eb052d957472c6d4337/raw/1a749d81b0f05176f66448113976f49d8ada5777/set-nav-color.java">view raw</a><a href="https://gist.github.com/Maxobat/f715fe7504088eb052d957472c6d4337#file-set-nav-color-java">set-nav-color.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>The completed method should look like:</p><p>@ReactMethodpublic void setColor(final String color) { final Activity activity = getCurrentActivity(); final int colorInt = Color.parseColor(color); activity.getWindow().setNavigationBarColor(colorInt);}</p><p><a href="https://gist.github.com/Maxobat/83f94e9a12ce808717dd6e440406dda6/raw/5dba082c0c08081b16d4cbb8916ad66f494a0d7c/set-color-method.java">view raw</a><a href="https://gist.github.com/Maxobat/83f94e9a12ce808717dd6e440406dda6#file-set-color-method-java">set-color-method.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>Now that we have completed our setColor method we have, in effect, written the core functionality of our native module. Now, we need to register it.</p><p>Back in the NavigationBarPackage.java file, we will register the module. In the createNativeModules method, add the following:</p><p>modules.add(new NavigationBarModule(reactContext));</p><p><a href="https://gist.github.com/Maxobat/5e40b945bb0b7e50dc33e7a753f0646c/raw/50c3cd4c6aa7458ffa6d7d1af304bc90364ea4e4/add-module.java">view raw</a><a href="https://gist.github.com/Maxobat/5e40b945bb0b7e50dc33e7a753f0646c#file-add-module-java">add-module.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>This will let our package know about our module. Now that our package is in the know, we need to register our package in our app. One directory up, open the MainApplication.java file. At the top of the file import the navigationbar package using</p><p>import com.[app name].navigationbar.*;</p><p><a href="https://gist.github.com/Maxobat/775cfc3445753f6ed7aa3579e9f6fd50/raw/9c4fb51ab091dca4af5b8a418c05e6b16caa97bd/import-module.java">view raw</a><a href="https://gist.github.com/Maxobat/775cfc3445753f6ed7aa3579e9f6fd50#file-import-module-java">import-module.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>In the getPackages method, add the following instantiation to the returned list.</p><p>new NavigationBarPackage();</p><p><a href="https://gist.github.com/Maxobat/95f56b4bc363be202cf3f8795e001d2d/raw/315c7bc561cd5952938b982ce7c9f089cc5a5263/package-instantiation.java">view raw</a><a href="https://gist.github.com/Maxobat/95f56b4bc363be202cf3f8795e001d2d#file-package-instantiation-java">package-instantiation.java</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>The package and module are now fully registered on the Java side. All that is left to do is implement the module on the JavaScript side. Our module now resides in React Native’s NativeModule. We will now create a file for our module that will make it easier to import and utilize in the rest of our app. Create a new JS file that contains the following:</p><p>import { NativeModules } from ‘react-native’ export default NativeModules.NavigationBar</p><p><a href="https://gist.github.com/Maxobat/0fd04edb2b7bc12bf5704a9eb0174e44/raw/4396946a04e6b1dced40b40d7759731b5f638803/js-react-native-native-module-export.js">view raw</a><a href="https://gist.github.com/Maxobat/0fd04edb2b7bc12bf5704a9eb0174e44#file-js-react-native-native-module-export-js">js-react-native-native-module-export.js</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>All done! We can now import our module and use it.</p><p>import React, { Component } from ‘react’import { View, Text } from ‘react-native’import NavigationBar from ‘./path/to/NavigationBar’ export default class ExampleComponent extends Component { componentWillMount() { NavigationBar.setColor(‘#ffab8e’) } render() { return ( &lt;View&gt; &lt;Text&gt; We can set the navigation bar color! &lt;/Text&gt; &lt;/View&gt; ) }}</p><p><a href="https://gist.github.com/Maxobat/76634eacd08930fc56c6685226b356b7/raw/7741ad84272db2fdad2bdcdb2999d4aff472529e/completed-react-native-component.jsx">view raw</a><a href="https://gist.github.com/Maxobat/76634eacd08930fc56c6685226b356b7#file-completed-react-native-component-jsx">completed-react-native-component.jsx</a> hosted with ❤ by <a href="https://github.com/">GitHub</a></p><p>Our final result rendered out will look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*4MpjvpWLvN7bdXII.png" /></figure><p>Pretty cool, right?</p><p>With that, we have successfully created a React Native native module. While this is a simple example, we now have a peek at the power of native modules. This just scratches the surface of their capabilities. Take a look the the <a href="https://facebook.github.io/react-native/docs/native-modules-android.html">React Native docs</a> for more information.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c30a4db8181" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Progressive Web Apps — The Convergence of Web and Mobile Apps]]></title>
            <link>https://medium.com/@buildcleverly/progressive-web-apps-the-convergence-of-web-and-mobile-apps-5c6a0bdc688d?source=rss-a1970a169e26------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c6a0bdc688d</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Clever.ly]]></dc:creator>
            <pubDate>Mon, 01 May 2017 23:35:16 GMT</pubDate>
            <atom:updated>2017-05-01T23:35:19.940Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you tired of having to open your app store and install an app in order to do a thing, only to never open that app again? In a lot of cases the only reason you would even want to install an app for something is because it’s faster to open an app than it is to open your browser and go to the website, or maybe you want some functionality that you don’t typically get on a webpage, like sweet sweet push notifications. Wouldn’t it be great if you could just go to a website and have an app on your home screen in a matter of moments?</p><p><strong>The Future is Now</strong></p><p>The functionality that I described above isn’t some sci-fi future thing. No, I’m talking about <a href="https://developers.google.com/web/progressive-web-apps/">progressive web apps</a> or PWAs. In very much the same way as <a href="https://clever.ly/blog/2017/04/19/implementing-accelerated-mobile-pages/">AMPs (Accelerated Mobile Pages)</a> are trying to improve the end user experience so are PWAs, but with a different approach. AMP makes a lot of sense when you have some static content that you want to get to the end user FAST. PWAs on the other hand are great at increasing user engagement.</p><p><strong>What are PWAs</strong></p><p>PWAs are essentially just a <a href="https://developers.google.com/web/progressive-web-apps/checklist">checklist</a>. One of the things I love about PWAs is that most of the work necessary for implementation boils down to just following best practices. For example, one of the requirements for a PWA is that it must be served over HTTPS, another is that the page has to work well on mobile. So, do a good job as a web developer and you’re already well on your way to having a PWA. In addition to best practices, there are some specific things that are required to have a PWA. One is to have a manifest.json which has information about how to display your PWA such as name, icon, theme color etc. Another is to have a service worker with offline caching. It’s gotta load when you open it, regardless of your internet connection status.</p><p><strong>Why PWAs</strong></p><p>Remember what I wrote earlier about having an app on your home screen in a matter of moments? In addition to all of the benefits you get from the individual PWA checklist items — security from HTTPS, better user experience from offline caching and responsive design, etc, A properly implemented PWA on Android will prompt users to add the PWA to their home screen. Users have always been able to add a webpage to their home screen but it was manual, they had to do it, now they get asked. You can even take this a step further and use your service worker for sending push notifications in addition to the offline caching.</p><p>Currently the add to home screen prompt is only implemented for Android, though there has been some speculation about Apple implementing this feature on iOS, iOS will still benefit from the improved user experience gained from implementing PWA.</p><p><strong>Testing</strong></p><p>If you are a developer that is concerned with the quality of their craft, you may be close to having a PWA without even realizing. A great utility for testing where you stand with your PWA is <a href="https://developers.google.com/web/tools/lighthouse/">Lighthouse</a>. Lighthouse will run through your page and test it against all of the criteria for PWAs and give you a score out of 100 with some information on how to improve that score. As an example (and a bit of bragging rights), here is the score for <a href="https://clever.ly/">Clever.ly</a>’s <a href="https://googlechrome.github.io/lighthouse/viewer/?gist=cd77190f809eb2a67f85d4f15a8d263f">homepage</a>.</p><p><strong>Final thoughts</strong></p><p>The line between mobile app and mobile web is becoming smaller with time. Ultimately, I think we’re going to see a decline for native apps in the the coming future, in favor of the much lighter web apps. AMPs and PWAs give us a good insight into what a future dominated with web technologies will look like, and it looks good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c6a0bdc688d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why React with JSX and Not Vue with Vue Templates]]></title>
            <link>https://medium.com/@buildcleverly/why-react-with-jsx-and-not-vue-with-vue-templates-6e8722583338?source=rss-a1970a169e26------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e8722583338</guid>
            <dc:creator><![CDATA[Clever.ly]]></dc:creator>
            <pubDate>Fri, 21 Apr 2017 22:45:57 GMT</pubDate>
            <atom:updated>2017-04-21T22:46:02.983Z</atom:updated>
            <content:encoded><![CDATA[<p>With the popularity of front end view layers on the rise, it’s only natural to compare the heavy hitters in that space. Two of the most popular ones are React and Vue. While JSX and Vue templates set out to accomplish essentially the same objective (rendering markup from JS), the two differ pretty drastically in how they are written. Enough in fact, to be a large factor in deciding to use React or Vue for your front end view layer. I tend more towards the way React does, and here’s why.</p><p>JSX</p><p>With React, you write your components in JSX. With JSX, you get a style that is very different than many templating engines because it’s not really a templating engine. JSX is just some sugar for calling functions that create elements. That’s it. It serves as more of a superset of JavaScript. JSX does not strictly live and operate inside of its own environment like many templating engines. Instead, it lives with the rest of your code. This is what makes JSX ridiculously flexible.</p><p>Take a look at the following React component. While it is extremely simple, it highlights just how flexible JSX can be. For example, notice how well the JSX integrates into the plain JS. You have markup being returned from regular functions, passed around in variables, looped through in a map, etc.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2a3513e4aec4af6d032fba18c9fed980/href">https://medium.com/media/2a3513e4aec4af6d032fba18c9fed980/href</a></iframe><p>While the above example is somewhat trivial because of the fact that there was not much of a need to split out a simple component so much, this ability to put the rendering process together however you like really shines when components get more and more complicated/logic intensive. It takes componentization to the next level by allowing you to split out your components into small, maintainable, digestible pieces.</p><h4>Vue Templates</h4><p>With Vue, your get Vue templates. With these, things are quite a bit different than JSX. Vue templates are far more markup centric opposed to JSX. Like how JSX feels like a superset of JavaScript, Vue templates feel like a superset of HTML. As such, the way control structures are handled sparks a stark contrast to the way they are handled in JSX. For example, Vue has many directives such as ‘v-if’, ‘v-else-if,’ and ‘v-for’ that you can use directly on the elements of your template to handle control flow in your components. Also, unlike JSX where you mix and match JS and the template, things are much more segregated in Vue templates. Your methods, state variables, and props live outside of the template content and are accessible through a scope abstraction. This enforces somewhat of a separation of concerns. Take the following component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ee6a5bfb32b6f3db937b1accb7f7987/href">https://medium.com/media/5ee6a5bfb32b6f3db937b1accb7f7987/href</a></iframe><p>This is the Vue equivalent of the React component above. Note how everything related to rendering strictly happens in one place, the template string. With the React example, you had a function that rendered a heading, one that rendered some list items, and the main render function brought them in as needed. Here, with the Vue component, nothing is split out. While it is nice to have a designated area (template string) to do all of the rendering, we lose quite a bit of flexibility by not being able to internally split out the component. However, it could be said that if a particular piece of a component gets too complex, just split out that part into its own component, then use it in the original component. While that is certainly a good argument, I think there are cases where it does not make sense. It is common for me to have a piece of a component that is very complex, but is intimately tied to its parent component; meaning that it will not be used outside of that parent component. For me, the main appeal of components is reusability. If you’re not going to reuse that piece outside of its parent component, I don’t see too much of a need to make it a separate component. That’s just me though.</p><p>To conclude, I’d like to say that I think both JSX and Vue templates do their respective jobs very well. However, by now, it’s no secret that I prefer writing JSX. To reiterate, I tend to lean on the side of JSX for the fact that it is just so flexible. When I’m writing logic intensive front end applications, I want the markup to be a tool for the JS, not the other way around. I feel that while Vue templates work very well, I think making the logic and control structures secondary to the markup is the wrong approach.</p><p><em>Originally published at </em><a href="https://clever.ly/blog/2017/04/21/why-react-with-jsx-and-not-vue-with-vue-templates-2/"><em>Clever.ly Blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e8722583338" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Facebook Advertising Split Test Case Study]]></title>
            <link>https://medium.com/@buildcleverly/facebook-advertising-split-test-case-study-a91d0c926431?source=rss-a1970a169e26------2</link>
            <guid isPermaLink="false">https://medium.com/p/a91d0c926431</guid>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[advertising]]></category>
            <category><![CDATA[split-test]]></category>
            <dc:creator><![CDATA[Clever.ly]]></dc:creator>
            <pubDate>Wed, 19 Apr 2017 21:54:34 GMT</pubDate>
            <atom:updated>2017-04-24T23:52:59.600Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Facebook Ads Manager</strong> has some great functionality for advertisers, including the ability to run split tests. According to Facebook’s documentation “Split Testing helps advertisers understand how different aspects of their ads affect campaign performance. Similar to A/B testing, Split Testing lets you test different versions of your ads so you can see what works best and improve future campaigns.”</p><p>This has proved invaluable for the Facebook ads I run for our clients. In the case below, the conversion goal was for consumers in a specific metro area to go to the web site’s dealer locator page and find a local dealer. The client is a building product manufacturer with a B2B business model, so this is the closest we can get to a sale from the site.</p><p>Two split tests were run.</p><p>The first test called “Audience split test” compared cost per click (CPC) and click through rate (CTR) of serving ads to consumers vs. builders. After spending $800 over 2 weeks, the consumer audience click through rate had only a .06% advantage over the builder audience, but their cost per click was $.10 cheaper at $1.06 giving consumers the edge.</p><p>The second split test is called “Delivery Type” and was a 3 way test comparing the delivery type’s effect on conversion rates (find-a-dealer page visits on the client’s web site) delivering to consumers (the winner of the previous test) as well as testing 6 different ad images for each delivery type.</p><p>The types included:</p><ol><li>delivering to users Facebook deemed more likely to go to the find-a-dealer page on the web site (conversions)</li><li>delivering to users Facebook deemed more likely to click on the Facebook ad</li><li>delivering the Facebook ad as many times possible to as many users as possible within the target area</li></ol><p>The first delivery type (conversions) was quickly the clear winner after only 24 hours, as was one of the six images tested. The two losing delivery types were shut down and the conversions type was allowed to continue to run. The losing 5 images were also stopped from running. After $785 was spent on the winning combo over 13 days the conversion delivery type yielded 625 ad clicks and a CTR of 2.5% at $1.15 per click.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/58f7e5671b631bd34523819a" /></figure><p><strong>Summary</strong> — The winning combo was to deliver a specific lifestyle image to consumers who were likely to go to the find-a-dealer page. It yielded 161 conversions at an average of $4.88 per conversion. During this time, this ad combo also yielded 1613 people visiting a product page.</p><p>Now that we know what works, and what doesn’t, I am currently running a remarketing campaign to serve this ad creative specifically to that group who looked at product, but didn’t look for a dealer in order to try to capture that audience who showed interest, but that didn’t take the next step.</p><p><em>Originally published at </em><a href="https://clever.ly/blog/2017/04/19/facebook-advertising-split-test-case-study/"><em>Clever.ly Blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a91d0c926431" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>