<?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 Wise G on Medium]]></title>
        <description><![CDATA[Stories by Wise G on Medium]]></description>
        <link>https://medium.com/@wisegain?source=rss-d2aa81d31fcb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*UQuZ3NvSRDGhpOwC.</url>
            <title>Stories by Wise G on Medium</title>
            <link>https://medium.com/@wisegain?source=rss-d2aa81d31fcb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 11:59:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wisegain/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[Traefik]]></title>
            <link>https://medium.com/@wisegain/traefik-aad30e77548b?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/aad30e77548b</guid>
            <category><![CDATA[traefik]]></category>
            <category><![CDATA[container-orchestration]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Sat, 05 Aug 2017 06:17:21 GMT</pubDate>
            <atom:updated>2017-08-08T09:22:34.950Z</atom:updated>
            <content:encoded><![CDATA[<p>In my <a href="https://medium.com/@wisegain/consul-registrator-fabio-integration-c068280710b9">previous post</a>, I talked about using Fabio to handle routing for our container services.</p><p>Here, I will talk about yet another router called <a href="https://github.com/containous/traefik">Traefik</a>. What’s great about it is that it don’t even require Consul to discover our deployments.</p><p>The following guide is for a one cluster/one node setup. I will try to write a separate article on how we can use Traefik on a multi node setup.</p><p><strong>Requirements</strong>: Docker</p><p>Le’t get started.</p><p>First, let’s create a docker-compose.yml with the following contents:</p><pre>traefik:<br>  image: traefik<br>  command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG<br>  ports:<br>    - &quot;80:80&quot;<br>    - &quot;8080:8080&quot;<br>    - &quot;443:443&quot;<br>  volumes:<br>    - /var/run/docker.sock:/var/run/docker.sock<br>    - /dev/null:/traefik.toml</pre><pre>machine:<br>  image: jwilder/whoami<br>  labels:<br>    - &quot;traefik.backend=web&quot;<br>    - &quot;traefik.frontend.rule=Host:apps.192.168.1.11.nip.io&quot;</pre><p>Please change the Host above, mine is apps.192.168.1.11.nip.io. Yours will be different. If you are curious why do I have a weird host name like that, you can read more about it on: <a href="http://nip.io/">nip.io</a></p><p><strong>Sidenote</strong>. Basically, <strong><em>apps.192.168.1.11.nip.io</em></strong> simply points to 192.168.1.11 which is my test machine. We need to use <strong><em>nip.io</em></strong> so we could test different route names. For example, I could use <strong><em>new-route.192.168.1.11.nip.io</em></strong>, though it still resolves to the same ip 192.168.1.11, Traefik would route us to a different container service.</p><p>Now let’s start the services.</p><pre>sudo docker-compose up -d</pre><p>This will start the Traefik server itself, plus a sample web server running on some random port which Traefik will route to. This web server simply prints out its container id, so we can test later if load balancing is also working.</p><p>Visit Traefik’s control panel at:</p><pre>&lt;your ip&gt;:8080</pre><p>You can test if your router is working by visiting the route we specified in <strong><em>traefik.frontend.rule</em></strong> in our <strong><em>docker-compose.yml</em></strong>. Mine is:</p><pre>apps.192.168.1.11.nip.io</pre><p>Traefik was able to know how to route this host by using the labels we specified in <strong><em>docker-compose.yml</em></strong>. Remember we specified the following:</p><pre>labels:<br>    - &quot;traefik.backend=web&quot;<br>    - &quot;traefik.frontend.rule=Host:apps.192.168.1.11.nip.io&quot;</pre><p>Now that our route is working, we could try to scale up our service.</p><pre>docker-compose scale machine=2</pre><p>Try refreshing the browser, you should see a different container id printed.</p><p>We could also deploy using docker commandline.</p><pre>docker run -d --label traefik.backend=web2 --label traefik.frontend.rule=Host:cool.apps.192.168.1.11.nip.io jwilder/whoami</pre><p>This is the usual <strong><em>docker run</em></strong> command except that we specified labels that Traefik can use.</p><p>Now we test it again, with our new route:</p><pre>cool.apps.192.168.1.11.nip.io</pre><p>That’s it. This is the most basic way to get started with Traefik.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aad30e77548b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node vs Go]]></title>
            <link>https://medium.com/@wisegain/node-vs-go-c5f54bea2c5?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5f54bea2c5</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Sat, 05 Aug 2017 03:02:01 GMT</pubDate>
            <atom:updated>2017-08-07T02:02:43.202Z</atom:updated>
            <content:encoded><![CDATA[<p>A lot of people are always asking, which one is better: Go or Node?</p><p>Let me convince you that the comparison is quite pointless nowadays. I would even recommend that you learn both.</p><p>Let me give you some of my arguments.</p><p><strong>First</strong>. We are now in the era of micro services. What this means is that you don’t have to be locked up in one programming language. You could deploy a subset of your services in one language, say Go, then deploy another on a different one using Node js. There is no reason to limit yourself to just one language to build your stack.</p><p><strong>Second</strong>. Go is a compiled language. What this means is that you can still use Node or Python as your main code base, and simply spawn a Go child process when the need arise. Go was designed to be multi threaded, and the fact that it’s a compiled language, it’s really really fast on CPU intensive operations.</p><p><strong>Third</strong>. Both languages are easy to learn. You could write a web server in a few lines of code using Node js, but so can you using Go. If you already know Javascript/Html front end, it’s only natural for you to choose Node, because the language is already familiar. But again, learning Golang is easy too. So if you manage to learn both languages, you just turned yourself into a more flexible programmer and future proof.</p><p><strong>Fourth</strong>. Golang is more like a big upgrade to the family of C languages. So comparing Node to Go, is like comparing Node to C. <strong>What!?</strong> Why in the hell are you comparing Node to C?</p><p><strong>Lastly</strong>. Ryan Dahl, the creator of Node js, even a created a Node/Go binding called <a href="https://github.com/ry/v8worker">v8worker</a>. This implies that he envisions that these 2 languages can work together. A clear statement that these 2 languages are not in competition, but complementary.</p><p><strong>Closing Notes</strong>. I think it’s time to stop labeling your self as “I’m a Node developer or I’m a Go programmer.” Which somehow implies “I will never use that other language.” I think we should start opening ourselves to what’s available out there. Some languages are really really good on certain/specific use cases and there is not one language that performs well on everything. We should stop being a fanatic of one language. Of course we all have our favorites, but to limit oneself, it’s definitely not good in the long run, as I have pointed out earlier, <strong><em>we are in the era of micro services</em></strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5f54bea2c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consul, Registrator & Fabio Integration]]></title>
            <link>https://medium.com/@wisegain/consul-registrator-fabio-integration-c068280710b9?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c068280710b9</guid>
            <category><![CDATA[consul]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Fri, 04 Aug 2017 18:53:56 GMT</pubDate>
            <atom:updated>2017-08-04T19:49:02.560Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a quick guide on how to integrate Consul, Registrator and Fabio.</p><p><strong>Goal</strong>: To automate domain/host mapping to internal container services whenever we make a new deployment.</p><p><strong>Requirement</strong>: Basic understanding of what these technologies do.</p><p>Here’s some quick info in case you have no idea what these are:</p><p><a href="https://github.com/hashicorp/consul"><strong><em>Consul</em></strong></a>. This is like a DNS server but specially made for container services.</p><p><a href="https://github.com/gliderlabs/registrator"><strong><em>Registrator</em></strong></a>. Automates service registration to Consul. Consul has no builtin ability to detect whenever a new service has been deployed, it’s why a registrator is still needed.</p><p><a href="https://github.com/fabiolb/fabio"><strong><em>Fabio</em></strong></a>. Act as the router which uses Consul information to properly direct routes. Normally we use Nginx or HAProxy to direct routes to container services, but since they have no builtin integration with Consul, we have to use something like Fabio to do this.</p><p>Let’s begin.</p><p>First, let’s edit the following file.</p><pre>/etc/default/docker</pre><p>Place the following content.</p><pre>DOCKER_OPTS=&quot;--dns 172.17.0.1 --dns 8.8.8.8 --dns-search service.consul&quot;</pre><p>Start the Consul server.</p><pre>docker run -d -p 8500:8500 -p 172.17.0.1:53:8600/udp -p 8400:8400 gliderlabs/consul-server -node myconsul -bootstrap</pre><p>Start the Registrator.</p><pre>docker run -d -v /var/run/docker.sock:/tmp/docker.sock --net=host gliderlabs/registrator -internal consul://localhost:8500</pre><p>Deploy a simple Nginx server.</p><pre>docker run -d -p :80 -e &quot;SERVICE_80_NAME=web&quot; -e SERVICE_TAGS=urlprefix-/ -e &quot;SERVICE_80_ID=http1&quot; -e &quot;SERVICE_80_CHECK_HTTP=true&quot; -e &quot;SERVICE_80_CHECK_HTTP=/&quot; --name=nginx1 nginx</pre><p>Let’s breakdown what these parameters are for.</p><p><strong>SERVICE_80_NAME </strong>— we named the service as “web” and if we deploy another Nginx server using the same name, Consul will automatically load balance the two instances.</p><p><strong>SERVICE_80_ID</strong> — this id should be unique for every deployment.</p><p><strong>SERVICE_TAGS </strong>— the value here is very important for Fabio. Fabio monitors the tags used in the Consul services, and when it detects the <em>urlprefix</em> keyword, it will automatically add a route for that service. The value urlprefix-/ tells Fabio that our trigger route is for/.</p><p><strong>SERVICE_80_CHECK_HTTP &amp; SERVICE_80_CHECK_HTTP</strong> — these are also important for Fabio since it only add routes for services that pass the health check. Not adding these parameters will fail the integration.</p><p>Let’s start Fabio, but first we need to modify some properties.</p><p>Create a file with the following name.</p><pre>fabio.properties</pre><p>Place this setting.</p><pre>registry.consul.addr = &lt;consul ip&gt;:8500</pre><p>Start Fabio.</p><pre>docker run -d -p 80:9999 -p 9998:9998 -v $PWD/fabio.properties:/etc/fabio/fabio.properties fabiolb/fabio</pre><p>Try to deploy another Nginx server.</p><pre>docker run -d -p :80 -e &quot;SERVICE_80_NAME=web&quot; -e SERVICE_TAGS=urlprefix-/ -e &quot;SERVICE_80_ID=http2&quot; -e &quot;SERVICE_80_CHECK_HTTP=true&quot; -e &quot;SERVICE_80_CHECK_HTTP=/&quot; --name=nginx2 nginx</pre><p>Check Fabio on the browser.</p><pre><a href="http://192.168.1.11:9998/routes">http://&lt;fabio ip&gt;:9998</a></pre><p>You should be able to see the route has beed added automatically.</p><p>You can now test if your Fabio router is working by visiting your server.</p><pre>http://&lt;fabio ip&gt;</pre><p>If you use the <em>urlprefix-/foo</em>, then you can test it by going to <a href="http://example.com/foo">http://example.com/foo</a></p><p><strong>Alternatives to Fabio:</strong></p><p><a href="https://github.com/containous/traefik">traefik</a></p><p><a href="https://github.com/yyyar/gobetween">gobetween</a></p><p><strong>To be continued…</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c068280710b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Minikube Cheat Sheet]]></title>
            <link>https://medium.com/@wisegain/minikube-cheat-sheet-a273385e66c9?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/a273385e66c9</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[minikube]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Thu, 13 Jul 2017 05:37:32 GMT</pubDate>
            <atom:updated>2017-07-15T10:59:32.163Z</atom:updated>
            <content:encoded><![CDATA[<p>How to set up Kubernetes on your local machine fast using Minikube.</p><p>Please note that this is not a guide. This is a cheat sheet. It would contain a list of commands, not a list of explanations. If you wanted more details, please check the <a href="https://rominirani.com/tutorial-getting-started-with-kubernetes-on-your-windows-laptop-with-minikube-3269b54a226">article</a> by Romin Irani which I based this from.</p><p>Install Requirements:</p><p><a href="https://www.docker.com/products/docker-toolbox">Docker Toolbo</a>x</p><p><a href="https://github.com/kubernetes/minikube">Minikube</a></p><p><a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">Kubectl</a></p><p><strong>Note</strong>: Please make sure your Hyper-V is disabled. Docker Toolbox uses Virtual Box and VB doesn’t play nicely if your Hyper-V is enabled.</p><p>Install Docker Toolbox.</p><p>Minikube and Kubectl are console applications, so you don’t really need to install these. Just download and place them in some folder. Better still, add it to your path so you can run them anywhere.</p><p>We need this to get a list of Kubernetes versions Minikube currently supports.</p><pre>minikube get-k8s-versions</pre><p>Let’s start Minikube. But change the <em>kubernetes-version</em> to the latest. As of this writing, it’s v1.7.0 (your kubectl version must also be the same as this).</p><pre>minikube.exe start <strong>--kubernetes-version=&quot;v1.7.0&quot;</strong> --vm-driver=&quot;virtualbox&quot; --show-libmachine-logs --alsologtostderr</pre><p>Let’s see our kubectl version</p><pre>kubectl version</pre><p>Assuming your Minikube starts up well. We can now issue kubectl commands to it.</p><pre>kubectl cluster-info</pre><p>To further debug and diagnose cluster problems</p><pre>kubectl cluster-info dump</pre><p>If you simply want to get the IP address of your cluster.</p><pre>minikube ip</pre><p>And finally, the dashboard. My favorite part, simply because once you get to see it, it means your minikube setup is working as expected.</p><pre>minikube dashboard </pre><pre><em>or if just want the url:</em></pre><pre>minikube dashboard --url=true</pre><p>or</p><p>Launch your Kubernetes dashboard with the default port 8001.<br>Set the proxy with the default port number.</p><pre>kubectl proxy</pre><p>then you can access the dashboard by appending it with /ui</p><pre><a href="http://localhost:8001/ui">http://localhost:8001/ui</a></pre><p>Who would imagine a simple console application can give you a web based dashboard like that? Actually, if you watch minikube when it was starting up, you notice it downloading a bunch files? The dashboard is part of it, among other things.</p><p>Your Minikube setup is done. From this point on, most of the commands you will use will be kubectl.</p><p>Let’s start by getting a list of nodes.</p><pre>kubectl get nodes</pre><p>Now let’s run some app</p><pre>kubectl run hello-nginx --image=nginx --port=80</pre><p>What’s <em>image=nginx</em>? That’s actually a docker image. Docker will get it automatically for you.</p><p>expose</p><pre>kubectl expose deployment hello-nginx --type=NodePort</pre><p>get the url</p><pre>minikube service --url=true hello-nginx</pre><p>This is just a convenience provided by minikube, but in production, you should rely on kubectl to get url.</p><p>Let’s get the nodes, so we can get the public IP address.</p><pre>kubectl get nodes</pre><p>Now we have the IP, all we need is the port number.</p><pre>kubectl get svc</pre><p>you will see something like</p><pre>NAME          CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE<br>hello-nginx   10.10.10.207   &lt;nodes&gt;       80:31019/TCP   24m</pre><p>In this case, the public port is 31019. You can now form the url by</p><pre>&lt;node ip&gt;:31019</pre><p>scale it</p><pre>kubectl scale --replicas=3 deployment/hello-nginx</pre><p>get deployment status</p><pre>kubectl get deployment</pre><p><strong>Miscellaneous/Issues/Etc…:</strong></p><p>There are times that minikube IP changes.</p><p>When I run: <em>minikube status, </em>it says misconfigured</p><pre>minikube: Running<br>localkube: Running<br>kubectl: Misconfigured: pointing to stale minikube-vm.</pre><p>You can use:</p><pre>minikube update-context</pre><p><strong>Settings</strong></p><p>This is where the config used by kubectl is located. This is how it knows which cluster to talk to. In production environments, there would be a lot of clusters. In our case, we just have one cluster created by minikube.</p><pre>%HOMEPATH%\.kube</pre><p>This is the folder minikube uses. It contains everything, settings, the virtual box machine image, ssl certs, etc…</p><pre>%HOMEPATH%\.minikube</pre><p>Pay attention to this file <strong>disk.vmdk</strong>. This file would grow in size because all the apps you deploy goes into this machine image.</p><pre>%HOMEPATH%\.minikube\disk.vmdk</pre><p>To be continued…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a273385e66c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker CheatSheet]]></title>
            <link>https://medium.com/@wisegain/docker-cheatsheet-79768bd921cd?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/79768bd921cd</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Tue, 11 Jul 2017 02:31:56 GMT</pubDate>
            <atom:updated>2017-07-11T02:31:56.222Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have a simple node script with no dependency, you can run it on Docker without needing a Dockerfile.</p><pre>docker run -it --rm --name my-running-script  --net=host  -v &quot;$PWD&quot;:/usr/src/app -w /usr/src/app node node index.js</pre><p>Let’s break the parameters down.</p><p>-it means interactive. The script can accept user input while it runs.</p><p>--rm means remove the container on exit.</p><p>--name container name.</p><p>--net=host auto-bind ports. You no longer need to specify -p port.</p><p>-v this is the volume mapping (local:remote)</p><p>-w working directory.</p><p>node docker image to base from</p><p>node index.js run the node script.</p><p>You might say who the hell will write a node script with no dependency?</p><p>It’s true, but I am assuming you already have a base image with node modules already installed. If you just want to test out a new script, by using this, you could skip the Dockerfile creation.</p><p><strong>Docker build</strong></p><p>docker build -f &lt;dockerfile&gt; -t myapp .</p><p><strong>Simple utility to get tree view of images</strong></p><pre>docker run --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz images -t</pre><p>To be continued… more recipes to come…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79768bd921cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing TypeScript 2.4]]></title>
            <link>https://medium.com/@wisegain/announcing-typescript-2-4-f18e81b0c4fe?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f18e81b0c4fe</guid>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Sat, 08 Jul 2017 04:59:36 GMT</pubDate>
            <atom:updated>2017-07-08T04:59:36.318Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Today we’re excited to announce the release of TypeScript 2.4!</blockquote><blockquote>If you haven’t yet heard of TypeScript, it’s a superset of JavaScript that brings static types and powerful tooling to JavaScript. These static types are entirely optional and get erased away — you can gradually introduce them to your existing JavaScript code, and get around to adding them when you really need. At the same time, you can use them aggressively to your advantage to catch painful bugs, focus on more important tests that don’t have to do with types, and get a complete editing experience. In the end, you can run TypeScript code through the compiler to get clean readable JavaScript. That includes ECMAScript 3, 5, 2015, and so on.</blockquote><p><a href="https://blogs.msdn.microsoft.com/typescript/2017/06/27/announcing-typescript-2-4/">https://blogs.msdn.microsoft.com/typescript/2017/06/27/announcing-typescript-2-4/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f18e81b0c4fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t bundle React]]></title>
            <link>https://medium.com/@wisegain/dont-bundle-react-caf2b8c7f7b7?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/caf2b8c7f7b7</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[cdn]]></category>
            <category><![CDATA[browserify]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Sat, 08 Jul 2017 00:39:00 GMT</pubDate>
            <atom:updated>2017-08-03T23:41:28.056Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been using Webpack/Browserify for quite some time and I must say they are both great. But one thing I have noticed though, my bundle size is huge: <strong>2 MB!</strong></p><p>I did notice that Webpack compiles faster than Browserify because it uses incremental transpiling. Browserify took about 3 seconds to bundle my files while Webpack is almost instantaneous.</p><p>I tried not to bundle React and just load it from my index.html using a CDN and my bundle size is now around 30 KB.</p><p>When you use a CDN, you will encounter a compile error saying something like “Component not found”. This could easily be solve by adding the following to your js file.</p><pre>let { Component } = React</pre><pre>class App extends Component {</pre><pre>}</pre><p>Your transpiled js file will resolve the React namespace, but not Component, this is why we need to do this.</p><p>I currently use cdnjs as the CDN provider. What I like about it is that it uses an integrity string just like the one below. It made sure that the import file you use is not tampered with.</p><pre>&lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.min.js">https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.min.js</a>&quot; integrity=&quot;sha256-ivdPAn5h6U67z6OPgwfiLM9ug6levxmYFqWNxNCV0YE=&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;</pre><p>CDN’s are great, take advantage of it. Their servers are scattered all over the globe. 3rd party module files don’t change very often. Popular ones like jquery and React are most likely cached already by the user’s browser. But your javascript code changes frequently, and if your bundle size is 2 MB, would you want your user to download it every time?</p><p>Certainly not. And if your site is hosted in just one place, it will perform very slowly when a user access it from a far away geographical region.</p><p>You may argue and say “hey I can use vendor.js to separate 3rd party libraries from my codes”. This is fine if all your files are hosted on a CDN, but if not, users will have a hard time downloading your 2 MB vendor.js file.</p><p><strong>Conclusion</strong>: Use CDN as much as possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caf2b8c7f7b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gulp vs Webpack]]></title>
            <link>https://medium.com/@wisegain/gulp-vs-webpack-6d1dac0c505b?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d1dac0c505b</guid>
            <category><![CDATA[browserify]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[gulp]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Fri, 07 Jul 2017 03:28:40 GMT</pubDate>
            <atom:updated>2017-07-11T09:55:45.477Z</atom:updated>
            <content:encoded><![CDATA[<p>I don’t think they are in direct competition, nor are they mutually exclusive.</p><p>In fact, you can use Webpack as part of your Gulp workflow, or the other way around.</p><p>To me the difference all boils down to personal preference.</p><p>Gulp is programmatic while Webpack is declarative. This difference is popularly known in computer science circles as code vs configuration or convention over configuration.</p><p>If you look at the Gulp config, you will find that it is a bunch of tasks chained together.</p><p>While in a Webpack config, you would see a set of variable declarations.</p><p>I don’t think there is a clear winner here. Don’t decide to choose one because it’s more “popular” than the other. Choose the one which feels like home.</p><p>Here is one use case that Gulp could be better for you. For instance, in my development workflow, I synchronize my files on my local pc to a remote via ssh. Everytime I make a local change, that file gets uploaded on the remote server. I am using a remote server because installing npm dependencies there is quite fast compared to my local pc. I did this by using a gulp plugin called gulp-ssh. I tried to look for this same functionality in Webpack, but can’t find one. The closest plugin I could find is one that deploys the whole build folder to remote, but that’s not what I need.</p><p>If you really don’t have special needs in your project, perhaps Webpack is all you need. It’s really something that you setup once, and seldom touch again. If you are like me, who wants more control, and enjoy scripting, then Gulp could be better choice for you. In my case, I tend to modify my gulp scripts once in a while during development as I discover new ways of automating things.</p><p>To be continued…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d1dac0c505b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Babel without webpack]]></title>
            <link>https://medium.com/@wisegain/babel-without-webpack-a4551e0c10f1?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4551e0c10f1</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[babeljs]]></category>
            <category><![CDATA[browserify]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Sat, 24 Jun 2017 13:10:56 GMT</pubDate>
            <atom:updated>2017-07-08T01:31:11.581Z</atom:updated>
            <content:encoded><![CDATA[<p>If you just want to get started on React real quick and you don’t mind using <strong><em>require</em> </strong>or <strong><em>import </em></strong>in your code, then <strong>babel </strong>could be enough to jump start your React project.</p><p>Say for example that all your javascript files are in the ./src folder, you can bundle them into one file with this command.</p><pre>babel src --out-file dev.js</pre><p>This is nice if you just have a few javascript source files, but what if your project gets bigger, you may want to incorporate the use of <strong><em>imports</em></strong>.</p><p>This is where <strong>Webpack </strong>and <strong>Browserify </strong>comes in.</p><p>Getting started with Browserify is easy.</p><pre>npm install -g browserify<br>npm install --save babelify babel-preset-react</pre><p>Now use this command to bundle your file.</p><pre>browserify src/dev.js -o dev.js -t [ babelify --presets [ react ] ]</pre><p>Done! You can now use use <strong>require/import</strong> in your files.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4551e0c10f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Actions on Google]]></title>
            <link>https://medium.com/@wisegain/actions-on-google-3c7a95b911b7?source=rss-d2aa81d31fcb------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c7a95b911b7</guid>
            <category><![CDATA[launch]]></category>
            <dc:creator><![CDATA[Wise G]]></dc:creator>
            <pubDate>Sat, 24 Jun 2017 07:31:40 GMT</pubDate>
            <atom:updated>2017-06-24T07:31:40.142Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>There was certainly lots of great launches at Google’s October 4th event. Not only did we get <a href="http://www.androidauthority.com/google-pixel-xl-specs-price-release-date-718756/">the new Pixel smartphones</a>, <a href="http://www.androidauthority.com/google-home-specs-price-release-date-719718/">Google Home</a>, <a href="http://www.androidauthority.com/google-announces-daydream-view-coming-november-79-719946/">Daydream VR</a> and <a href="http://www.androidauthority.com/google-wifi-announced-designed-support-new-ways-use-wifi-719921/">Google WiFi</a>, but there was some interesting announcements on the expansion of Google’s ecosystem via its Google Assistant and Actions on Google.</blockquote><p><a href="http://www.androidauthority.com/actions-on-google-719980/">http://www.androidauthority.com/actions-on-google-719980/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c7a95b911b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>