<?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[Meth Meth Method - Medium]]></title>
        <description><![CDATA[Complimentary blog for the YouTube series where I publish brain droppings that sometimes leads to ideas for the show. https://youtube.com/MethMethMethod - Medium]]></description>
        <link>https://medium.com/meth-meth-method?source=rss----e4ab73c8a073---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Meth Meth Method - Medium</title>
            <link>https://medium.com/meth-meth-method?source=rss----e4ab73c8a073---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 17:46:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/meth-meth-method" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[On Fearless Development and Pair Programming]]></title>
            <link>https://medium.com/meth-meth-method/on-fearless-development-and-pair-programming-5c030dbdb981?source=rss----e4ab73c8a073---4</link>
            <guid isPermaLink="false">https://medium.com/p/5c030dbdb981</guid>
            <category><![CDATA[pair-programming]]></category>
            <category><![CDATA[happiness-at-work]]></category>
            <category><![CDATA[fearless-development]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Pontus Alexander]]></dc:creator>
            <pubDate>Wed, 08 Nov 2017 07:00:14 GMT</pubDate>
            <atom:updated>2017-11-08T07:00:14.209Z</atom:updated>
            <content:encoded><![CDATA[<p>As a developer, it is easy to get lonely. You may work in a team, that you go to lunch with, do code reviews with and share out of office activities. But you are still working alone. In the sense that you are solving problems on your own. I wish teamwork was more like doing stuff together than putting stuff together you did on your own.</p><p>It is easy to get into some real time waste when solving problems on your own. It has often been said that one of the most important skills to have as a programmer is to know when to take a break from a problem. I have so many times sat in front of my computer and being unable to let go of a problem for hours, just to come up with the solution on my way home from work or while having breakfast the next morning.</p><p>I can sometimes feel a bit nostalgic, and even some kind of pride of my perseverance. But honestly, I think this is cognitive dissonance. I defend it because I did it. Because seriously, it is not fun. Does programming really have to be like this? I think not.</p><p>During recent years I have become more and more passionate about having fun at work and not feel stress. Two concepts comes to mind here; Fearless Development and Compassionate Coding.</p><p>I’m going to loosely define these concepts according to my own understanding.</p><h4>Fearless Development</h4><p>What is fearless development. Let me tell you a story from when I was younger and worked for a fairly big company. We were redoing the company web site from scratch. Don’t do that by the way. We had been working for at least half a year and were getting ready to launch. We were doing manual testing to build confidence for days before deploy and I’m sure we delayed the launch several times because of discrepancies we found. Then came the day when we finally launched.</p><p>We launched at night to minimize interruptions to the business. Today I would laugh in the face of this decision. It’s such a bad idea. When launching we had to migrate a bunch of data into a new database structure. We didn’t have a script to migrate back, so once we had migrated and started taking traffic there was no way to really go back so this was pretty much point of no return. And after that we started finding small bugs that kept us up all night.</p><p>It was so difficult to sleep that night. After we patched the bugs we had found, and when trying to sleep that night I couldn’t relax and just felt like I was waiting for a call to arrive telling me a serious flaw had been detected. Next morning I just remember being in the office, cranky as a toddler, almost breaking down crying for having to answer some basic questions.</p><p>I’m not joking if I’m saying I was pretty much working 36 hours in a row around that time. The sleep I got was almost wasted to anxiety. You think I would learn a lesson from this but I did similar things two more times. One night we sat awake in a server hall when we had moved our hardware to a new location and while I did feel pride once we were done; now I just feel like I was an idiot and nobody should have to go thru that. I slowly evolved anxiety towards making code changes because it often forced me to work while I wasn’t able.</p><p>What I just explained is the epitome of fearful development — being scared of your work. <strong>Fearless</strong> development is the idea that you never get into such a state. Today I have more knowledge, and as a community we have more tools to avoid this.</p><p>We have great version control systems like Git. And version control systems help us keep track of changes we do to our code. Because of it we can do Continous Integration which means we don’t have changes to code lying around that aren’t in use.</p><p>When we do Continous Integration it becomes natural to do Continous Deployment which means we should update what is run in production as often as possible in small increments. Continous Deployment helps us pinpoint a problem when something breaks.</p><p>Thanks to Virtual Machines and Containers it has become trivial to test changes with very high confidence. All these tools are awesome but there is something that I think is more important than tools when it comes to Fearless Development, and that is <strong>Shared Responsibility</strong>.</p><p>As a programmer it is easy to accidentally become the sole expert in a system. If you are the one the created a feature, even though it went thru review and many people have seen the code the person that wrote it alone will always be the expert and the goto guy when it runs into problems. This will never change until You change it and you change it with Pair Programming.</p><p>I think Pair Programming is so damn fun and important. When I worked at Spotify pair programming was highly encourage but in reality it was quite rare and at my last employer I don’t think I did pair programming more than once in 9 months.</p><p>I think that intuitively it feels like wasting time. Worst case scenario your boss don’t get it either. After all, two programmers working on two problems should get double the amount of work done. I think this is a myth. There are so many reasons team productivity can go up when pair programming.</p><ul><li>You are less likely to waste time going down a dead end. When pursuing a bad solution two persons are more likely to realize earlier.</li><li>You also get autonomous knowledge sharing in the team. This can benefit hugely if the team gets a bug report which is hard to track down. If 10 people have a rough map of how their software works you are much more likely to hit the nail on the head when making an educated guess. This effect is know as the Wisdom of Crowds. You get this for free when you pair program a lot.</li><li>When you code you often have these elusive bugs that make you think there is something wrong with your computer just to realize some ironic mistake was made. When you run into these alone, it can feel like you’re an idiot and you may be so enveloped in your ideas that you can’t even begin to explain it to someone. Being in this situation alone feels awful but being two idiots typing on the same keyboard and getting this, is like a festival of laughter.</li></ul><p>It’s hard to quantify how valuable it is in the long run to do Pair Programming. But I found a study that tried to do that and their conclusion was</p><blockquote>The development cost for these benefits is not the 100% that might be expected, but is approximately 15%. This is repaid in shorter and less expensive testing, quality assurance, and field support.[1]</blockquote><p>If you start Pair Programming with your team today for the first time, it is likely there is no immediate return on investment. The benefits come later when you have shared a lot of knowledge and everyone is better aligned with how the teams software is built and what makes it tick.</p><p>And more importantly, never again does the responsibility of a feature burden one poor developer. Some people call this job security. I call it being reckless to yourself and your team. And I’ve been reckless like that a lot unfortunately. Don’t be like me.</p><h4>References</h4><p><a href="https://collaboration.csc.ncsu.edu/laurie/Papers/XPSardinia.PDF">The costs and benefits of Pair Programming</a></p><p>This is actually not a blog post, it is a script for a video I made.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FbtRQcQANfWQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbtRQcQANfWQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FbtRQcQANfWQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f5addb684f54c7db3d67a7d53581918/href">https://medium.com/media/4f5addb684f54c7db3d67a7d53581918/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c030dbdb981" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meth-meth-method/on-fearless-development-and-pair-programming-5c030dbdb981">On Fearless Development and Pair Programming</a> was originally published in <a href="https://medium.com/meth-meth-method">Meth Meth Method</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Becoming Prettier]]></title>
            <link>https://medium.com/meth-meth-method/becoming-prettier-7104e832c3f9?source=rss----e4ab73c8a073---4</link>
            <guid isPermaLink="false">https://medium.com/p/7104e832c3f9</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Pontus Alexander]]></dc:creator>
            <pubDate>Mon, 09 Oct 2017 14:09:34 GMT</pubDate>
            <atom:updated>2017-10-09T14:09:33.924Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post I will talk about how a program called Prettier can speed up your team and get rid of formatting nit picks in code review.</p><p>Before we start talking about Prettier, I want to talk about linting. Linting is when you run a program that analyses code you have written and identifies problems with it before it is compiled or run.</p><p>The name linting comes from a program written by <a href="https://en.wikipedia.org/wiki/Stephen_C._Johnson">Stephen Johnson</a> in the 1970s, that was used to find common problems in C code that could prevent it from compiling.</p><p>Today we use linting loosely to describe any process that analyses code before it is run for syntax errors or ugly formatting, but most importantly common mistakes that are likely to produce errors, confusion, or surprises.</p><p>Usually when we check formatting using a linter, there is a plethora of rules to configure, and once you configure it as you like, aligning the team on it and making you all fluid in your ruleset might be painful.</p><p>Prettier tries to solve the above annoyance. It is an opinionated tool that reads your code and reformat it automatically. Lets take a look at how it works.</p><p>I have created a valid, but poorly formatted React component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_m77P909aP5IrnS2GOPrEA.png" /></figure><p>Now I’m going to run npx prettier src/CharacterCount.jsx on the file. (npx is a command bundled with NPM 5.2 that will automatically execute a binary package.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qn9oUcvBfvDO-_JfdBNrqw.png" /></figure><p>As you can see, Prettier has cleaned the file up and applied what it thinks is the best formatting for the syntax.</p><p>I loudly applaud this. We want nice formatting when we read code, but to spend time on actually formatting the code is wasting time. Getting rid of the change / lint / change / lint workflow to fix formatting problems is a blessing.</p><p>Most editors integrate with Prettier. In Sublime Text all I did was install JsPrettier from inside Sublime and that gave me access to a command that will format the current file. Before this you should install Prettier globally with npm install -g prettier or yarn global prettier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fvF-eLa6izxDpGpdCwxMBg.png" /></figure><p>So, how does Prettier do this? There is a program called ESPrima that you might have seen it as a dependency when using NPM sometime. It stands for <strong>ECMAScript parsing infrastructure for multipurpose analysis</strong> and it’s a tokenizer for JavaScript which job it is to create a syntax tree from JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uO-rz8V9MLNfTZBlu6rZOQ.png" /></figure><p>Prettier does this, then abolishes all your formatting, and reformats it according to its ruleset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8I6m0GLsUBy-ob78O-1EKw.png" /></figure><p>If you want to understand better what a syntax tree looks like and how it behaves, you can check out <a href="https://astexplorer.net/">AST Explorer</a> pictured above, where you can play around with it on the fly. It also has the Prettier formatter built in.</p><p>If you decide to use Prettier on your project or with your team, you can add a hook to Git that checks everything in staging, but I prefer to do it manually by running prettier ‘*/**/*.{js,jsx} --write using an NPM script.</p><pre>{<br>  &quot;name&quot;: &quot;becoming-prettier&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;format&quot;: &quot;prettier &#39;*/**/*.{js,jsx}&#39; --write&quot;<br>  },<br>  &quot;dependencies&quot;: {<br>    &quot;prettier&quot;: &quot;^1.7.4&quot;<br>  }<br>}</pre><p>I think the ideal solution would be to automate this in your Continuous Integration suite, however, it requires some PR discipline that is extremely opinionated and I can’t vouch for any specific solutions. But let me outline the problem. If you would to auto-format on Travis or Circle CI, the integration runs would have to commit to the pull request. This might conflict with a developers way of committing. Each commit in the pull request that had formatting errors would now be dependent on the auto-formatting commit, preventing easy reverts. However, if your team decided that all PRs are squashed before commit, and you see all PRs as atomic changes, then it would work fine for you.</p><p>I love that Prettier can remove some pointless opinions from development, but I wish there was a tool that went even further, and was extremely opinionated about not only formatting, but standards too. ESLint can be used for this, but in my opinion ESLint has so many options it can be difficult to start using it on a project which has many contributors and lots of work in progress.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7104e832c3f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meth-meth-method/becoming-prettier-7104e832c3f9">Becoming Prettier</a> was originally published in <a href="https://medium.com/meth-meth-method">Meth Meth Method</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Distribute React component to NPM]]></title>
            <link>https://medium.com/meth-meth-method/creating-distributable-react-components-as-node-modules-57b74ed32b0f?source=rss----e4ab73c8a073---4</link>
            <guid isPermaLink="false">https://medium.com/p/57b74ed32b0f</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[npm]]></category>
            <dc:creator><![CDATA[Pontus Alexander]]></dc:creator>
            <pubDate>Mon, 14 Aug 2017 08:12:48 GMT</pubDate>
            <atom:updated>2017-12-20T06:24:43.959Z</atom:updated>
            <content:encoded><![CDATA[<p>Lately I’ve invested a lot of time in researching how to effectively build React components that are highly reusable and publishable to NPM.</p><p>Before you can upload a React component to NPM, there are a couple of questions that needs to be answered.</p><ul><li>What format should the package be written in.</li><li>What format should the published code be in.</li><li>How to think about styling (CSS).</li><li>How to handle resources like images.</li></ul><h4>Source code format</h4><p>By source code format I’m referring to format of the source code for your package. This include ECMAScript version and if you’re using JSX, or a superset of Javascript like Coffee-script or TypeScript.</p><p>The answer is you should write the code in the style you prefer. When publishing your package you will have a build step, and there is few strong reasons to avoid transpiling.</p><p>In this post, we will bundle a React component that uses ES6 and JSX.</p><h4>Published format</h4><p>The published format is the state the code is in when installed by an end user. Common practice seems to be to use <em>babel-preset-es2015</em>. This means you will be able to use ES6 features like const, destructuring ( const {busy} = this.state;), class, and other syntactic sugar.</p><p>It might seem a bit counter intuitive to publish your code in a transpiled format. After all, this makes assumptions about where your code will run in the future that might not be sane. Lots of browsers are perfectly happy with const, destructuring and class. This is a good point. However, when you think about that the end user would need to know every possible superset of Javascript ever invented, and their build pipeline would need to support every superset that any of their dependencies has, it becomes obvious that this is the lesser evil.</p><h4>Bundling styles</h4><p>The question on what to do with styles was the biggest show stopper for me. As of now, there seems to be no standard way to get styles from your package into the parent project without sorcery.</p><p>My recommendation is to inline them using the style attribute and only include functional styles. By functional styles I mean style properties that affect functionality. These include display values, absolute positioning, and specific graphics that are required for the component to make sense. Always try to achieve your goal with semantic HTML elements first. There is a high likelihood that the grunt of the work your React component does is data processing and handling, and less that of styled presentation.</p><p>It is very important to be conservative here. When you set the style attribute you interfere with the cascading part of cascading style sheets, and you make it difficult for a user to customize. Therefore, include inline styles with caution. Colors, fonts and absolute dimensions are off limits as it prevents customization and defeats the purpose of publishing your component.</p><p>If you are uncertain, it is much better to not embed the style and bundle your package with documentation on how to customize it. By using classes in a smart way you give the power to your users to customize.</p><p>I want to stress again to be conservative. Your component looking great is the least of your users interest when they install your component. They want your component to solve a repetitive task, and they want to use it on their own terms. If you feel you need to bundle lots of CSS with your component, you may be going down the wrong path.</p><h4>Bundling graphics</h4><p>Few components will require you to bundle graphics. If you must, embed them in the code as data URIs. You want your component to come with batteries included — work out of the box and not have the user manually copy files after the install of you package is finished.</p><p>This bloats your componenent. Therefore I stress the “if you <strong>must”</strong> part here.</p><p>In our example we are bundling an SVG throbber.</p><h3>Developing</h3><p>I will suggest tools, but not go into depth on how to use all the tools. In order to follow this guide it is assumed that you are comfortable researching <a href="https://www.npmjs.com/">NPM</a>, <a href="https://yarnpkg.com/">Yarn</a> and <a href="https://facebook.github.io/react/">React</a> development.</p><h4>Setup development environment</h4><p>Your development enviroment is a directory that will contain the component you are developing and a React app that implements your component during development.</p><p>For your convenience, I have created <a href="https://github.com/meth-meth-method/react-package-boilerplate">a boilerplate repo</a> with some prerequisites bundled called <a href="https://github.com/meth-meth-method/react-package-boilerplate">react-package-boilerplate</a>.</p><p>The react-package-boiler plate comes installed with my preference for transpiling. This includes the following packages.</p><pre>babel-cli<br>babel-core<br>babel-plugin-inline-import-data-uri<br>babel-plugin-transform-class-properties<br>babel-preset-es2015<br>babel-preset-react</pre><p>It also comes with a babel config .babelrc</p><pre>{<br>  &quot;presets&quot;: [<br>    &quot;es2015&quot;,<br>    &quot;react&quot;,<br>  ],<br>  &quot;plugins&quot;: [<br>    &quot;inline-import-data-uri&quot;,<br>    &quot;transform-react-jsx&quot;,<br>    &quot;transform-class-properties&quot;,<br>  ],<br>}</pre><p>This allows you to build React components using ES6 classes and JSX and will import PNG and SVG files as data URIs. If you want other options for importing consult the <a href="https://github.com/pomle/babel-plugin-inline-import-data-uri">babel-plugin-inline-import-data-uri documentation.</a></p><p>Clone <a href="https://github.com/meth-meth-method/react-package-boilerplate">react-package-boilerplate</a> and setup a new React app using <a href="https://github.com/facebookincubator/create-react-app">Create React App</a>. If you don’t have <em>Create React App</em> installed you can install it with yarn global add create-react-app .</p><p>The <strong>react-package-boilerplate</strong> provides examples on inlining styles, embedding an SVG image as data URI, and logic for toggling visibility on a throbber.</p><pre>mkdir distributable-react-component<br>cd distributable-react-component<br><br>git clone https://github.com/meth-meth-method/react-package-boilerplate.git my-component<br><br>create-react-app react-app</pre><p>Now we have the prerequisites to start working. The first thing we want to do is install component dependencies and “link” our component using <strong>yarn</strong>. When you link a component you can use a local folder as if it was an installable <strong>NPM</strong> package which we have to do since we have not published our package yet.</p><p>Enter the <strong>my-component</strong> directory and run <strong>yarn </strong>followed by <strong>yarn link</strong>.</p><pre>cd my-component<br>yarn link</pre><p>When the linking is successful, you should see something like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*DLr4-0LL1P1Zv2PGMPPgSQ.png" /></figure><p>We also want to start <strong>watching</strong> the component for changes and auto-rebuild. We do this so that the changes we make to the component we are developing is automatically reloaded in the React app.</p><p>yarn run build -- --watch</p><p>Now we want to enter the react-app, import my-component, and start developing. Since we are running a process already in my-component dir, you should do this in a new terminal.</p><pre>cd react-app<br>yarn link my-component<br>yarn start</pre><p>This should fake install my-component as a Node module and open the template app bundled with Create React App.</p><p>Find the file App.js from react-app, import my-component, and render it. In the example below I have removed everything but &lt;MyComponent/&gt; for brevity and set the property initiallyVisible for fun.</p><p>Your environment should now look similar to below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-TRqyf-Hv1AN6oUlRheZg.png" /></figure><p>And your browser should display the throbber component in its default state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*OkCZn0emnUDOYM_X9AWm2A.png" /></figure><p>This is your basic development environment setup.</p><p>From here on, you will develop your application until fit for publishing.</p><h4>Development and Documenting</h4><p>This section will show how a user could customize your component. While you develop you want to make sure you do not restrict the user from applying their own style to your component, while still maintaining some sane default so that it is usable out of the box . You don’t want your component to be hidden by default for example.</p><p>Key for allowing customization is to document the class names your component uses and consider these part of your component’s API. Being part of the API means they are stable (do not change without notice), are documented, and clearly intended for use.</p><p><strong>MyComponent </strong>from the boilerplate have three points of interaction useful for CSS. The main class .MyComponent, the &lt;button&gt;<strong> </strong>element, and the .throbber class.</p><p>Find the file App.css from <strong>react-app</strong> and remove all CSS that we do not use any more. Your App.css should now look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d3dcO-P3pGUx2Hc3TzXYig.png" /></figure><p>The first thing we want to customize is the size of the throbber. Add CSS to App.css .</p><pre>.App .MyComponent .throbber {<br>  margin: 1em auto;<br>  height: 20vw;<br>  width: 20vw;<br>}</pre><p>It should now look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*eOUDrsvyGltFbDpP1GKu7Q.png" /></figure><p>Next we will customize the button. Add CSS for button.</p><pre>.App .MyComponent button {<br>  background: #de4d5f;<br>  border: none;<br>  border-radius: 0.2em;<br>  color: #fff;<br>  font-size: 30px;<br>  margin: 1em;<br>  padding: 0.5em;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*ouIcClm1Mgoe26xzPAujwQ.png" /></figure><p>Lastly, we will add some custom fonts from <a href="https://fonts.google.com/">Google Fonts</a>. Find the file index.html from react-app and add a custom CSS from Google Fonts between&lt;head&gt; and &lt;/head&gt; .</p><pre>&lt;link href=&quot;https://fonts.googleapis.com/css?family=Titan+One&quot; rel=&quot;stylesheet&quot;&gt;</pre><p>Then add a font-family property to App.css .</p><pre>* {<br>  font-family: &#39;Titan One&#39;;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*upAraKm_QEPA_aRf0ZUI2Q.png" /></figure><p>What we can see here, is because we were conservative on what styles we inline, we allow the user to override them via CSS in their project. If we would have inlined color, background-color, font-size, or font-family the user would not be able to customize colors or text without using !important. No code intended to live for longer than a hack day should use !important.</p><p>We have now shown that our component can be imported and customized by an end user. It is ready for publishing.</p><h4>Publishing</h4><p>Once you have everything else out of the way, publishing is easy. Before publishing, you should update the file <strong>README.md</strong> and make sure you change the following fields in the boilerplate’s <strong>package.json</strong>.</p><ul><li>name</li><li>description</li><li>version</li><li>author</li></ul><p>Once you are satisfied and want to publish your package you will want to familiarize yourself with <a href="https://docs.npmjs.com/getting-started/publishing-npm-packages">NPM’s publishing guide</a> and then go ahead and publish your first React component.</p><p>After publishing, it can be installed by running yarn add [your package].</p><h4>What about Webpack?</h4><p>I tried bundling modules with Webpack and it can certainly be done. However it is in the nature of Webpack to bake everything together into one file, and avoiding embedding code from a third party is an opt-out strategy which you will play catch up with as your component changes. My recommendation is to avoid bundling NPM modules with Webpack as of now.</p><p>I hope you found my thoughts on this to be insightful. Please let me know if you find out of any improvements. And as always, I might be wrong about everything.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57b74ed32b0f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meth-meth-method/creating-distributable-react-components-as-node-modules-57b74ed32b0f">Distribute React component to NPM</a> was originally published in <a href="https://medium.com/meth-meth-method">Meth Meth Method</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pong Numbers using proper binary]]></title>
            <link>https://medium.com/meth-meth-method/pong-numbers-using-proper-binary-27fc1b4d1f89?source=rss----e4ab73c8a073---4</link>
            <guid isPermaLink="false">https://medium.com/p/27fc1b4d1f89</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Pontus Alexander]]></dc:creator>
            <pubDate>Sat, 20 Aug 2016 10:38:43 GMT</pubDate>
            <atom:updated>2016-08-20T10:38:43.173Z</atom:updated>
            <content:encoded><![CDATA[<p>After I released the Pong episode of Meth Meth Method one of my clever friends, Felix Bruns, made a patch showing how we can simplify the numbers-string-array using binary.</p><p>When we express the number 0 as a string of on-off values like 111101101101111 we see a resemblance with typical binary notation. Doing a binary-to-decimal conversion of the number above gives us 31599 which in hexadecimal is 7B6F.</p><p>Knowing how we can iterate over each bit in the binary number we can make the number drawing algorithm shorter as demonstrated in the diff below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*A10FBfMJD9xWssRik89v5A.png" /><figcaption><a href="https://github.com/meth-meth-method/pong/commit/1ac51f325d60b52d8489e9fd3343b0fe8330581f">https://github.com/meth-meth-method/pong/commit/1ac51f325d60b52d8489e9fd3343b0fe8330581f</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27fc1b4d1f89" width="1" height="1" alt=""><hr><p><a href="https://medium.com/meth-meth-method/pong-numbers-using-proper-binary-27fc1b4d1f89">Pong Numbers using proper binary</a> was originally published in <a href="https://medium.com/meth-meth-method">Meth Meth Method</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>