<?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 Mikko Haapoja on Medium]]></title>
        <description><![CDATA[Stories by Mikko Haapoja on Medium]]></description>
        <link>https://medium.com/@mikkoh?source=rss-3dcc607cbb3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*WwT2Yy9owFmHvAAt.jpg</url>
            <title>Stories by Mikko Haapoja on Medium</title>
            <link>https://medium.com/@mikkoh?source=rss-3dcc607cbb3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 02:04:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mikkoh/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[Should I use a Library/Framework or Document Dev Practices?]]></title>
            <link>https://medium.com/@mikkoh/should-i-use-a-library-framework-or-document-dev-practices-1dc88a28373?source=rss-3dcc607cbb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1dc88a28373</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Mikko Haapoja]]></dc:creator>
            <pubDate>Mon, 23 Nov 2015 18:56:20 GMT</pubDate>
            <atom:updated>2015-11-23T18:56:42.209Z</atom:updated>
            <content:encoded><![CDATA[<p>I once had a discussion with a web developer at Apple. I asked him what Javascript framework they used in development. I was surprised when he said: “We actually don’t really use a major framework. We have common well documented development patterns that developers follow”. I was a bit taken a back but I understood what he was talking about. At my work for many years we’ve used no frameworks just modules, libraries and best practices.</p><p>React has become very popular today. I’d like to make a case that outside of the Virtual DOM what React brings is a “common well documented pattern of development”. React is praised for having such a minimal api and it’s shrinking.</p><p>The entire lifecycle of a React application is well understood: props are changed, state of the application changes, the DOM is rendered. JSX brings a simple common way to initialize and create views. Lifecycle hooks give the ability for developers to be reactive at each phase of the render lifecycle. Basically there are few and very common places to put code.</p><p>The point I’m trying to get at above is that React clearly has a solid api which leaves little guessing to developers in teams working together. It’s essentially common standard development pattern in the form of a library.</p><p>So why not React? When using any framework there’s a feeling of trading control of parts of your application for “features that help you”. In Reacts case this is the Virtual DOM. This is ok most of the time until things go bad and you have performance issues or bugs in the library/framework. Another issue many have with React is it’s file size and “boot up” performance. I’m not sure it’s worth talking about here but do go check out <a href="https://aerotwist.com/blog/the-cost-of-frameworks/">Aerotwist’s post and talk</a>.</p><p>So what have we been doing at Jam3 until today? We’ve had a simple router which calls life cycle hooks of components, in turn those components call the lifecycle hooks of child components. Think of “pages” the hooks of child ui elements. These component’s are simple vanilla JS with the following hooks:</p><ul><li>init — called when the component should render to the dom, to the 2D Canvas Context or a 3D webGL context. A callback is called when initialization is complete.</li><li>resize — called whenever the user changes their browser size this will allow for components to have responsive JS along with the responsive CSS we’ve written.</li><li>animateIn — presenting content to screen should be deferred and at Jam3 EVERYTHING must animate in and out therefore we have a lifecycle hook called animateIn to tell the component ok you should become visible now. A callback is called when animate in is finished.</li><li>animateOut — if thing’s are made to present themselves then we should also make itself un-present itself. A callback is called when content is not presented anymore.</li><li>destroy — this is the opposite of init it should remove all dom content and clear itself from canvas contexts and maybe do some advanced garbage collection.</li></ul><p>This simple concept has worked for us for almost 7 years. In fact we’ve been able to use the same concepts in other render engines and environments other than the DOM such as Flash. Of course there’s been evolution and supporting module/library development to aid with the above methodology. So of course hasn’t been smooth sailing but at least we’ve been in control of replacing the crappy parts and improving the good parts.</p><p>This all being said at Jam3 we’re considering switching to a major framework such as React. Why is that?</p><p>There are other factors when selecting a library or workflow outside of technical considerations. For instance as a sr developer can I get a job if I go into an interview and state “I do not use any frameworks but instead I use well documented patterns of development that flow from a basic router down to the most basic ui component”. I’m sure the interviewer would throw you out of the room immediately. This is a bit sad… Not only that clients are starting to demand use of specific frameworks on their projects this means that choosing the right framework can have serious business implications in winning/loosing a job.</p><p>On the flip side it’s nice to put on the badge of using a major framework. It allows you to get into that frameworks community. This allows you to have a quick and immediate talent pool. It’s easy to put up a job posting and say you’re looking for React/Angular/Vue developers. There are always developers wanting to work with the hot new framework. Also there will need to be minimal training of these developers as they’ll know 80% of your workflow. Along with human beings (developers) you’ll be able to access the supporting tooling and libraries used to aid in development of that frameworks applications.</p><p>Anyway… This post could continue to go in circles forever so here’s a small take away to end off. We’ve been writing a series of questions that can be used to evaluate the a library/framework the idea is to use these questions to “score” a library and to give data to evaluate against vs feelings. Feel free to take a read, use it, and contribute:</p><p><a href="https://github.com/Jam3/library-evaluation-rubric">https://github.com/Jam3/library-evaluation-rubric</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1dc88a28373" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Almost of a year: Browserify + Jam3]]></title>
            <link>https://medium.com/@mikkoh/almost-of-a-year-browserify-jam3-10d46febeef4?source=rss-3dcc607cbb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/10d46febeef4</guid>
            <dc:creator><![CDATA[Mikko Haapoja]]></dc:creator>
            <pubDate>Mon, 06 Apr 2015 14:05:55 GMT</pubDate>
            <atom:updated>2015-04-06T14:05:55.805Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gopbDXjBaH5FLJRpwIGUSw.jpeg" /></figure><h3>NPM + Jam3: Clients, Open Source, and 1000s of Dwarfs</h3><p>At Jam3 in the past two years we’ve gone from no modules to, AMD Modules with RequireJS, and now onto CommonJS with Browserify. We’d like to talk about what we’ve learned during the past 8 months to help people deciding a path for their development workflow as individuals and as companies.</p><p>Something which may not be apparent at first is that if your company begins to work with NPM and CommonJS modules is that the company might fundamentally change.</p><p>For years Jam3 has used OSS without contributing much. It’s hard for a small company to justify putting their secret sauce out there for competitors to “steal”. Today Jam3 has realized, as many companies have, the code is not the product but rather the knowledge and skill to use that code is the product.</p><p>We may, if we’re generous, have had maybe five public repos on GitHub. Now we have <a href="https://github.com/jam3?query=+only%3Apublic+">65 public repos</a> (and counting). Since CommonJS modules are designed around the <a href="http://en.wikipedia.org/wiki/Unix_philosophy">Unix Philosophy</a> people may place just a small bit of reusable code in one public repo therefore you’re going to have many more public repos. Those individual small bits of code are worth little individually but the sum of those small parts and how you put them together is powerful.</p><p>It’s much easier as a company to justify Open Source as “we’ll put the nuts and bolts out there for everyone to use” rather than “we’re going to put an entire car out there for everyone to use”. Now we’re not saying we’re not going to put cars out there for everyone to use (we will) but most of the time it’ll be nuts and bolts. We see “cars” as libraries or tools which will pull together all the nuts and bolts. For instance in our case for one of our projects we developed a library and a set of tools to allow for exporting After Effects 3D Compositions and rendering/modifying them in the Browser. This would be considered a car which is private but built from many public modules (nuts and bolts). The point is as you begin to develop more modularly you’ll have to create rules and boundaries for what gets open sourced and what does not. These are rules your company may not have had before.</p><p>Working for our clients while adopting this approach makes contributing to OSS a bit tougher. Some of our clients who have been around the block a few times are savvy to the pitfalls of Open Source. Really it’s not Open Source but using code developed by a third party rather than the company their hiring. The real issue is who is liable and responsible if things go bad. These clients will demand up front before the project starts a list of open source libraries which will be used.</p><p>Providing a list of open source code that will be used on a project is much easier with monolithic libraries. In the past that list may have included things like <a href="http://jquery.com/">jQuery</a>, <a href="http://backbonejs.org/">Backbone</a>, <a href="http://threejs.org/">ThreeJS</a>. Today that exact same list might look like this: <a href="https://www.npmjs.com/package/dom-select">dom-select</a>, <a href="https://www.npmjs.com/package/dom-style">dom-style</a>, <a href="https://www.npmjs.com/package/dom-event">dom-event</a>, <a href="https://www.npmjs.com/package/dom-tree">dom-tree</a>, <a href="https://www.npmjs.com/package/xhr">xhr</a>, <a href="https://www.npmjs.com/package/bigwheel">bigwheel</a>, <a href="https://www.npmjs.com/package/vue">vue</a>, and <a href="http://threejs.org/">ThreeJS</a>. This only lists the top most modules we’ll be using and we also need to list the dependencies of these modules to our clients. So we’ve gone from listing three libraries to ten (if we’re being generous it maybe way more than ten).</p><p>So the challenge is: What is the method to communicate to the client third party software being used for their project? This issue is also compounded by the fact that developers are more likely to include more modules during the project. We’re currently experimenting with a workflow where we initially list modules and libraries we’ll definitely be using on project and then during the project giving updates on libraries/modules used. This process could potentially be automated by creating a project scraper which analyzes dependencies on a project through package.json files and listing them out in a human readable website.</p><p>It’s one thing to use modules on projects it’s also another thing creating modules for a client project. It would be unfair to work on a project for a client and open source code developed on a project however it’s still vital. In order to facilitate this we’ve negotiated with clients what we can and cannot open source. Most clients are ok with the fact that we’re open sourcing nuts and bolts and not cars.</p><p>Obviously these decisions may affect the type of clients you want to work with. We’ve had to do projects where all code used would be developed by ourselves, closed source, but having to do that now seems archaic and like you’re constantly reinventing the wheel. We’d like to say it’s better to stand on the shoulders of giants but the reality with modules we’re standing on the shoulders of thousands of dwarfs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10d46febeef4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The thing about bulky sites]]></title>
            <link>https://medium.com/@mikkoh/the-thing-about-bulky-sites-ddcbc73b245e?source=rss-3dcc607cbb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddcbc73b245e</guid>
            <dc:creator><![CDATA[Mikko Haapoja]]></dc:creator>
            <pubDate>Wed, 05 Feb 2014 04:09:18 GMT</pubDate>
            <atom:updated>2014-02-06T15:02:34.842Z</atom:updated>
            <content:encoded><![CDATA[<h4>Sometimes you gotta wait for the load</h4><p>One of our designers at Jam3 (<a href="https://twitter.com/rogerdario">Roger Dario</a>) brought a certain blog post to my attention. In this blog post they specifically single out <a href="http://www.heartofthearctic.ca/">Heart Of The Arctic</a> a website I was lead developer on.</p><p>All in all the site turned out quite well. Are there things I don’t like about the site. Of course there are. There always are on every project I do. In fact many of my co-workers laugh at the fact that I can’t even look at some sites I’ve worked on because I get frustrated by the things I’d like to fix. This includes some of the most successful projects we’ve worked on.</p><p>The article I reference above basically states that load time must be managed by proper load sequencing and that we didn’t do it right on Heart Of The Arctic. I couldn’t agree more on the importance of proper load techniques. In fact it’s something I suggested during development to pause the user in between every environment and load the next. There was a lot discussion about this and ultimately it was decided not to go that route.</p><h4>When mid experience loading ruins the experience</h4><p>The first thing with Heart Of The Arctic that you have to realize is that it’s for kids. Although kids are less patient than adults they will sit through an initial load. Kids will actually get more frustrated if they’re going through the experience and they get cut off due to a loader coming up.</p><p>The next consideration in putting mid experience loaders is that there are instances where you just want to “zoom” from one side of the map to the other. If you decided to go from the base camp to the final ship environment and you had to sit through 4 loaders along the way it would suck. Of course we discussed the fact that we could perhaps just take the user from one location to another when a button is clicked but it was decided that it wouldn’t give the user a sense of environment if we did that.</p><h4><strong>We don’t have the tools yet</strong></h4><p>Have you ever thought about tooling and libraries for HTML/JS dev. There’s a crap ton of utility libraries, mvc frameworks, and productivity tools. How many animation libraries are there? How many animation tools are there? One of my fav tools that I’ve seen is <a href="http://esotericsoftware.com/">Spine</a>. Spine is really nice. It’s a bone based animation tool. The nice thing about bone based animation is that your animation file size will be very small because essentially you’ll just be exporting bone deformations and those will be applied to images which are different parts of a body for instance. Low file size with high quality animations.</p><p>The problem with animation in HTML/JS is that the tools are new and most animators don’t use them. Most animators are use to the Flash IDE or After Effects. What do those tools produce well? Sprite sheets. The bane of my existence. The problem with sprite sheets are that they are MASSIVE in file size, they are not able to run frame rate independent (you export the animation at 24fps it must run at 24fps even if your site performs at 60fps), and they are bad on performance on mobile. (more on that in a bit)</p><p>So what did we try to do to stay away from Sprite Sheets. We created our own After Effects to JS exporter. Basically we wrote our own exporter in JS to look at an entire composition/animation in After Effects and export a JSON representation of the entire scene. If you’ve been on Heart Of The Arctic you might’ve seen a massive giant that wakes up and screams at you. That giant was not a sprite sheet. That giant was fully exported out of After Effects.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FM4rHqJwBWX4%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DM4rHqJwBWX4&amp;image=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FM4rHqJwBWX4%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/298f12b731ec25d1e92a92c2938ea1bd/href">https://medium.com/media/298f12b731ec25d1e92a92c2938ea1bd/href</a></iframe><p>So in other words we took the best parts of Spine and brought them to AE. Why? Well because we were working with <a href="http://www.tendril.ca/">Tendril</a>. One of the best motiongraphics studios in Toronto (if not the world). You’re not going to go to a carpenter and give them a new set of tools because you think they are better. It would be the same thing as a typist giving a developer MS Word. Changing toolsets is a long haul process it doesn’t happen on one project. I hope some day we’ll have really solid animators that focus fully on animation for the web.</p><p>That being said doing certain animations such as the bear raising on it’s back paws is almost impossible without Sprite Sheeting at this point so we had to live with it even though mobile dev was hell because of it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FpK6YydY9sMo%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpK6YydY9sMo&amp;image=http%3A%2F%2Fi1.ytimg.com%2Fvi%2FpK6YydY9sMo%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4701c78258b927a0465df0cf67e2dae8/href">https://medium.com/media/4701c78258b927a0465df0cf67e2dae8/href</a></iframe><h4><strong>Large Images On Mobile</strong></h4><p>If you’ve ever had the joy of working with current mobile browsers and large images such as sprite sheets. You’ll quickly realize that <a href="http://www.cocoanetics.com/2011/10/avoiding-image-decompression-sickness/">image decompression is horrible</a>. What that means is that if you load and render a large image the very first time it’s rendered there will actually be a significant drop in performance. Tools like <a href="http://imageoptim.com/tweetbot.html">ImageOptim</a> will help with image decompression (I believe they remove some meta data from images and do other magical things) but still the fact of the matter is that a Tablet/Phone CPU is no where near as capable as a desktop CPU.</p><p>All this being said what does image decompression have to do with loading images? Well in an ideal world we’d actually load most images for animations and other assets in the background and then hot swap them in once they’ve loaded. The issue is that you’ll see noticeable jank (I got the secret word in there Addy Osmani) on mobile devices as images get decompressed. So if in heart of the arctic on mobile (and desktop with VERY VERY large images) scrolling across the screen would be almost impossible. Believe me because that’s the way Heart Of The Arctic was developed at one point. Actually I believe still a bulk of the animations are being loaded in the background and being pulled in once they are loaded.</p><p>To help mediate the problem of Image Decompression performance drops on mobile we decided to take a big deep breath and do the unthinkable. We resized our images to be much smaller than they should be and then upscaled them in the experience. In other words if one of the characters is 200 x 200 we saved them out at 100 x 100 and scaled them up to be the original size they needed to be. (sometimes you gotta do what you gotta do) On mobile devices when working with Canvas we also noticed that the VRAM of the GPU would get heavily over burdened by our very large images causing a lot of swapping again making performance bad even after decompression. (note working with Canvas + GPU is much more performant than CSS3 Transforms + GPU)</p><h4><strong>Block Busters vs Documentaries</strong></h4><p>This is not the first time in my career that I’ve heard <strong>“Why is the load so long!!!” </strong>Believe me I have never grown to accept it nor do I still not cringe at the load on some of the sites I’ve worked on. You can optimize the crap out of all your images. (<a href="https://tinypng.com/">TinyPNG</a>, <a href="http://pngmini.com/">ImageAlpha</a>, <a href="http://imageoptim.com/">ImageOptim</a>) Render out all your videos at the lowest acceptable quality. The site is still going to be heavy… Why? Because we’re building Blockbusters vs Documentaries. Have you ever thought of video games compared to back in the day to now? We had like 5 disks we’d swap in and out and now Star Craft fills half my hard drive. Have you ever seen that annoying message on iOS where it states <strong>“You can’t download this app because it’s more than 100mb” </strong>meanwhile it’s like Candy Crush (Candy Crush is actually 40mb. Wait how is Candy Crush 40mb???). The fact of the matter is not every website now a day is utilitarian we have websites that are purely for entertainment. I’d hate it if I went and hit up Google.com and I had to sit through a load screen. But sometimes I want to be entertained vs looking for information. Thank goodness we have web tech that we can do that on now. I think there are a lot of people out there that will sit through a load to be entertained on the web. Think of Youtube + our Internet connection speeds a few years back (I’m sure we all sat around waiting for a load to finish). The expectation shouldn’t be that every website will load in 39kb or less. Of course we should strive for that.</p><p>If there’s one thing I would change is deploy HOTA to a stronger CDN ;) Hint hint.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddcbc73b245e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>