<?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 TasteJS on Medium]]></title>
        <description><![CDATA[Stories by TasteJS on Medium]]></description>
        <link>https://medium.com/@tastejs?source=rss-686e816cf89e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Ia_aAvd5fVJfOQP4.png</url>
            <title>Stories by TasteJS on Medium</title>
            <link>https://medium.com/@tastejs?source=rss-686e816cf89e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 08 Apr 2026 20:33:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tastejs/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[Rewriting A WebApp With ECMAScript 6]]></title>
            <link>https://medium.com/tastejs-blog/rewriting-a-webapp-with-ecmascript-6-39417b642cb2?source=rss-686e816cf89e------2</link>
            <guid isPermaLink="false">https://medium.com/p/39417b642cb2</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es2015]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[TasteJS]]></dc:creator>
            <pubDate>Thu, 29 Jan 2015 08:20:35 GMT</pubDate>
            <atom:updated>2015-10-09T08:39:20.762Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/968/0*rcwe0a-pcNlISe5a.png" /></figure><h2>Introduction</h2><p>Today it’s possible for us to author in ES6 and transpile our sources down to ES5 at build-time, regardless of whether we’re using <a href="https://github.com/addyosmani/es6-tools#grunt-tasks">Grunt</a>, <a href="https://github.com/addyosmani/es6-tools#gulp-plugins">Gulp</a> or <a href="https://github.com/sindresorhus/broccoli-traceur">Broccoli</a>. With projects like <a href="http://emberjs.com/blog/2013/12/17/whats-coming-in-ember-in-2014.html">Ember</a> and <a href="https://docs.google.com/presentation/d/1h3JCS5lwntUBddMv47lmpYQs3JUYy2LsUSfcy6YnlDg/edit#slide=id.p">Angular</a> looking to ES6 as part of their roadmaps too (<a href="https://github.com/stefanpenner/ember-app-kit">Ember App Kit</a> already supports ES6 modules!), now is a great time to learn how ES6 can be used in practice.</p><p>In this guide, we’ll re-write the well known TodoMVC application (implemented with <a href="https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples/backbone">Backbone.js</a>) using ECMAScript 6 language semantics. The implementation is made possible using Google’s <a href="https://github.com/google/traceur-compiler">Traceur</a> compiler and <a href="https://github.com/ModuleLoader/es6-module-loader">ES6-Module-Loader</a>.</p><p>If you haven’t come across these tools before, Traceur is a JavaScript.next-to-JavaScript-of-today compiler that allows you to use features from the future today and the ES6 Module Loader dynamically loads ES6 modules in Node.js and current browsers. If you’re wondering whether Traceur is ready for production-level apps, Erik Arvidsson <a href="https://groups.google.com/forum/#!topic/traceur-compiler-discuss/6OwdP7TIohY">recently</a> answered this on their mailing list.</p><h2>Features covered</h2><p>Features we will be using in this walkthrough include but are not limited to:</p><h2>Source &amp; Demos</h2><p>You can <a href="http://addyosmani.github.io/todomvc-backbone-es6/">run</a> the completed app, view a Docco version of the tutorial (<a href="http://addyosmani.github.io/todomvc-backbone-es6/docs/app.html">app.html</a> and <a href="http://addyosmani.github.io/todomvc-backbone-es6/docs/todo-app.html">todo-app.html</a>) <a href="https://github.com/addyosmani/todomvc-backbone-es6">watch</a> the project repository or look at the original <a href="http://goo.gl/8opExB">ES5 implementation</a>.</p><p>The application was rewritten in ES6 by Addy Osmani, Pascal Hartig, Sindre Sorhus, Stephen Sawchuk, Rick Waldron, Domenic Denicola and Guy Bedford.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mb6GlQkmrU7ZVLbk.png" /></figure><h2>Begin your ES6 adventure here</h2><p>Our application is composed of primarily three files:</p><ul><li>index.html — containing our templates and initial module loading.</li><li>app.js — our main entry point for the app</li><li>todo-app.js — our Todos module</li></ul><p>It is also composed of stylesheets and of course our Backbone, Traceur and ES6 Module Loader dependencies, but we’ll focus on the ES6 portions of the application in this guide.</p><h2>Index (index.html)</h2><p>We first dynamically load our main application — a script located at js/app.js.</p><p>System.import is an asynchronous loader for loading such modules and doesn’t require us to include the extension to our script. This is automatically inferred:</p><p>The two script files we’ll be using for this application are js/app.js and js/todo-app.js. They are ES6 modules.</p><p>ES6 modules allow us to define isolated blocks of reusable code without having to wrap it into an object or closure. Only those functions and variables we explicitly export are available to other consumers and we can just as easily import functionality from other modules. It’s possible to rename exported values, define modules that are inline and even declare defaults for import/export.</p><h2>Application entry-point (app.js)</h2><h4>Imports</h4><p>We import the classes we defined in the TodoApp module using the import keyword.</p><pre>import {AppView, Filters} from &#39;./todo-app&#39;;</pre><h3>Document ready</h3><h4>Arrow Functions (Statements)</h4><p>We then load the application once the DOM is ready, using jQuery.ready () =&gt; { … } which you’ll see below is the statement form of the arrow function syntax. Practically speaking, it is lightweight sugar for function () { … }.bind(this).</p><p>Apart from containing statements instead of an automatically-returned expression, it has the same properties as the expression-form arrow functions we look at below:</p><pre>$(() =&gt; { // Finally, we kick things off by creating the App. new AppView(); new Filters(); Backbone.history.start(); });</pre><h2>TodoApp Module (todo-app.js)</h2><h4>Destructuring Assignments</h4><p>Constant (const) declarations are block scoped, and cannot be re-declared or have their value reassigned once the binding is initialized.Backbone’s core component definitions don’t need to be modified, so we can combine constants and an ES6 pattern called destructuring assignment to create shorter aliases for Models, Views and other components.</p><p>This avoids the need to use the more verbose Backbone.* forms we’re accustomed to. Destructuring of array and object data uses a syntax that mirrors the construction of array and object literals.</p><p>const is currently disabled in Traceur due to <a href="https://github.com/google/traceur-compiler/issues/595">https://github.com/google/traceur-compiler/issues/595</a> but it would otherwise be written as:</p><pre>const { Model, View, Collection, Router, LocalStorage } = Backbone;</pre><p>We’ll use var here for now as we require a functional implementation:</p><pre>var { Model, View, Collection, Router, LocalStorage } = Backbone; // Note, if Backbone was written with ES6 you // would use an import for this. var ENTER_KEY = 13; // const var TodoFilter = &#39;&#39;; // let</pre><h2>Todo Model class</h2><h4>Classes</h4><p>In JavaScript, we’ve relied on prototypal inheritance anytime we’ve needed a class-like system. This has led to overly verbose code using custom types. ES6 changes that by removing the ugly multi-step inheritance patterns we’re used to and introducing a minimal class syntax that makes defining classes a lot more terse.</p><p>ES6 classes desugar to prototypal inheritance behind the scenes and the only real change is that there’s less typing required for us. Classes are compact and we can use an ‘extends’ keyword to implement a new sub-class from a base-class. Below, we do this to define a Todo class which extends Backbone’s Model component.</p><pre>class Todo extends Model { // Note the omission of the &#39;function&#39; keyword // Method declaractions inside ES6 classes don&#39;t // use it // Define some default attributes for the todo. defaults() { return { title: &#39;&#39;, completed: false }; } // Toggle the `completed` state of this todo item. toggle() { this.save({ completed: !this.get(&#39;completed&#39;) }); } }</pre><h2>TodoList Collection class</h2><p>We define a new class TodoList extending Backbone’s `Collection. The collection of todos is backed by <em>localStorage </em>instead of a remote server.</p><pre>class TodoList extends Collection {</pre><h4>Constructors and Super Constructors</h4><p>Specifying a constructor lets us define the class constructor. Use of the super keyword in your constructor lets you call the constructor of a parent class so that it can inherit all of its properties.</p><pre>constructor(options) { super(options); // Hold a reference to this collection&#39;s model. this.model = Todo; // Save all of the todo items under the &#39;todos&#39; namespace. this.localStorage = new LocalStorage(&#39;todos-traceur-backbone&#39;); }</pre><h4>Arrow Functions (Expressions)</h4><p>The arrow (=&gt;) is shorthand syntax for an anonymous function. It doesn’t require the function keyword and the parens are optional when there’s a single parameter being used. The value of this is bound to its containing scope, and when an expression follows the arrow — like in this case — the arrow function automatically returns that expression’s value, so you don’t need return.</p><p>Arrow functions are more lightweight than normal functions, reflecting how they’re expected to be used — they don’t have a prototype and can’t act as constructors. Because of how they inherit this from the containing scope, the meaning of this inside of them can’t be changed with call or apply.</p><p>To recap, when using =&gt;:</p><ul><li>The function keyword isn’t required.</li><li>Parentheses are optional with a single parameter.</li><li>return is unnecessary with a single expression.</li><li>Arrow Functions are lightweight — no prototypes or constructors</li></ul><p>We use an arrow function below for our method that sets a Todo item as being completed:</p><pre>completed() { return this.filter(todo =&gt; todo.get(&#39;completed&#39;)); }</pre><p><em>Next, we look at filtering down the list to only todo items that are still not finished.</em></p><pre>remaining() { // The ES6 spread operator reduces runtime boilerplate  // code by allowing an expression to be expanded where  // multiple arguments or elements are normally expected.  // It can appear in function calls or array literals. // The three dot syntax below is to indicate a variable // number of arguments and helps us avoid hacky use of // `apply` for spreading. // Compare the old way... return this.without.apply(this, this.completed()); // ...with the new, significantly shorter way... return this.without(...this.completed()); // This doesn&#39;t require repeating the object on which  // the method is called - (`this` in our case). }</pre><p><em>We keep the Todos in sequential order, despite being saved by unordered GUID in the database. This generates the next order number for new items.</em></p><pre>nextOrder() { if (!this.length) { return 1; } return this.last().get(&#39;order&#39;) + 1; }</pre><p><em>Todos are sorted by their original insertion order using a simple comparator.</em></p><pre>comparator(todo) { return todo.get(&#39;order&#39;); } }</pre><p><em>Create our collection of Todos.</em></p><pre>var Todos = new TodoList();</pre><h2>Todo Item View class</h2><p>We create a TodoView class by extending Backbone’s View as follows:</p><pre>class TodoView extends View { constructor(options) { super(options); // The DOM element for a todo item // is a list tag. this.tagName = &#39;li&#39;;</pre><p>Next we setup a cached instance of our template and DOM listener events for individual items:</p><pre>// Cache the template function for a single item. this.template = _.template($(&#39;#item-template&#39;).html()); this.input = &#39;&#39;; // Define the DOM events specific to an item. this.events = { &#39;click .toggle&#39;: &#39;toggleCompleted&#39;, &#39;dblclick label&#39;: &#39;edit&#39;, &#39;click .destroy&#39;: &#39;clear&#39;, &#39;keypress .edit&#39;: &#39;updateOnEnter&#39;, &#39;blur .edit&#39;: &#39;close&#39; }; this.listenTo(this.model, &#39;change&#39;, this.render); this.listenTo(this.model, &#39;destroy&#39;, this.remove); this.listenTo(this.model, &#39;visible&#39;, this.toggleVisible); }</pre><p><em>Re-render the contents of the todo item.</em></p><pre>render() { this.$el.html(this.template(this.model.toJSON())); this.$el.toggleClass(&#39;completed&#39;, this.model.get(&#39;completed&#39;)); this.toggleVisible(); this.input = this.$(&#39;.edit&#39;); return this; } toggleVisible() { this.$el.toggleClass(&#39;hidden&#39;, this.isHidden); }</pre><h4>Accessor Properties</h4><p>isHidden() is a get accessor property, but commonly referred to as a ‘getter’. Although technically part of ECMAScript 5.1, getters and setters allow us to write and read properties that lazily compute their values. Properties can process values assigned in a post-process step, validating and transforming during assignment.</p><p>In general, this means using set and get to bind a property of an object to a function which is invoked when the property is being set and looked up. <a href="http://ariya.ofilabs.com/2013/03/es6-and-method-definitions.html">Read more</a> on accessor properties, or ‘getters and setters’.</p><pre>get isHidden() { var isCompleted = this.model.get(&#39;completed&#39;); return (hidden cases only (!isCompleted &amp;&amp; TodoFilter === &#39;completed&#39;) || (isCompleted &amp;&amp; TodoFilter === &#39;active&#39;) ); }</pre><p><em>Toggle the ‘completed’ state of the model.</em></p><pre>toggleCompleted() { this.model.toggle(); }</pre><p><em>Switch this view into ‘editing’ mode, displaying the input field.</em></p><pre>edit() { var value = this.input.val(); this.$el.addClass(&#39;editing&#39;); this.input.val(value).focus(); }</pre><p><em>Close the ‘editing’ mode, saving changes to the todo.</em></p><pre>close() { var title = this.input.val(); if (title) { // Note that here we use the new  // object literal property value  // shorthand this.model.save({ title }); } else { this.clear(); } this.$el.removeClass(&#39;editing&#39;); }</pre><p><em>If you hit enter, we’re through editing the item.</em></p><pre>updateOnEnter(e) { if (e.which === ENTER_KEY) { this.close(); } }</pre><p><em>Remove the item and destroy the model.</em></p><pre>clear() { this.model.destroy(); } }</pre><h2>The Application class</h2><p><em>Our overall AppView is the top-level piece of UI.</em></p><pre>export class AppView extends View { constructor() {</pre><p><em>Instead of generating a new element, bind to the existing skeleton of the App already present in the HTML.</em></p><pre>this.setElement($(&#39;#todoapp&#39;), true); this.statsTemplate = _.template($(&#39;#stats-template&#39;).html()),</pre><p><em>Delegate events for creating new items and clearing completed ones.</em></p><pre>this.events = { &#39;keypress #new-todo&#39;: &#39;createOnEnter&#39;, &#39;click #clear-completed&#39;: &#39;clearCompleted&#39;, &#39;click #toggle-all&#39;: &#39;toggleAllComplete&#39; };</pre><p><em>At initialization, we bind to the relevant events on the Todos collection, when items are added or changed. Kick things off by loading any preexisting todos that might be saved in localStorage.</em></p><pre>this.allCheckbox = this.$(&#39;#toggle-all&#39;)[0]; this.$input = this.$(&#39;#new-todo&#39;); this.$footer = this.$(&#39;#footer&#39;); this.$main = this.$(&#39;#main&#39;); this.listenTo(Todos, &#39;add&#39;, this.addOne); this.listenTo(Todos, &#39;reset&#39;, this.addAll); this.listenTo(Todos, &#39;change:completed&#39;, this.filterOne); this.listenTo(Todos, &#39;filter&#39;, this.filterAll); this.listenTo(Todos, &#39;all&#39;, this.render); Todos.fetch(); super(); }</pre><p><em>Re-rendering the App just means refreshing the statistics — the rest of the app doesn’t change.</em></p><pre>render() { var completed = Todos.completed().length; var remaining = Todos.remaining().length; if (Todos.length) { this.$main.show(); this.$footer.show(); this.$footer.html( this.statsTemplate({ completed, remaining }) ); this.$(&#39;#filters li a&#39;) .removeClass(&#39;selected&#39;) .filter(`[href=&quot;#/${TodoFilter || &#39;&#39;}&quot;]`) .addClass(&#39;selected&#39;); } else { this.$main.hide(); this.$footer.hide(); } this.allCheckbox.checked = !remaining; }</pre><p><em>Add a single todo item to the list by creating a view for it, then appending its element to the &lt;ul&gt;.</em></p><pre>addOne(model) { var view = new TodoView({ model }); $(&#39;#todo-list&#39;).append(view.render().el); }</pre><p><em>Add all items in the Todos collection at once.</em></p><pre>addAll() { this.$(&#39;#todo-list&#39;).html(&#39;&#39;); Todos.each(this.addOne, this); } filterOne(todo) { todo.trigger(&#39;visible&#39;); } filterAll() { Todos.each(this.filterOne, this); }</pre><p><em>Generate the attributes for a new Todo item.</em></p><pre>newAttributes() { return { title: this.$input.val().trim(), order: Todos.nextOrder(), completed: false }; }</pre><p><em>If you hit enter in the main input field, create a new Todo model, persisting it to localStorage.</em></p><pre>createOnEnter(e) { if (e.which !== ENTER_KEY || !this.$input.val().trim()) { return; } Todos.create(this.newAttributes()); this.$input.val(&#39;&#39;); }</pre><p><em>Clear all completed todo items and destroy their models.</em></p><pre>clearCompleted() { _.invoke(Todos.completed(), &#39;destroy&#39;); } toggleAllComplete() { var completed = this.allCheckbox.checked; Todos.each(todo =&gt; todo.save({ completed })); } }</pre><h2>The Filters Router class</h2><pre>export class Filters extends Router { constructor() { this.routes = { &#39;*filter&#39;: &#39;filter&#39; } this._bindRoutes(); }</pre><h3>Default Parameters</h3><p>param in the filter() function is using ES6’s support for default parameter values. Many languages support the notion of a default argument for functional parameters, but JavaScript hasn’t until now.</p><p>Default parameters avoid the need to specify your own defaults within the body of a function. We’ve worked around this by performing logical OR (||) checks against argument values to default if they’re empty/null/undefined or of the incorrect type. Native default parameter values provide a much cleaner solution to this problem. Notably they are only triggered by undefined, and not by any falsy value.</p><p>Compare the old way…</p><pre>function hello(firstName, lastName) { firstName = firstName || &#39;Joe&#39;; lastName = lastName || &#39;Schmo&#39;; return &#39;Hello, &#39; + firstName + &#39; &#39; + lastName; }</pre><p>…to the new way, where we can also drop in Template String..</p><pre>function hello(firstName = &#39;Joe&#39;, lastName = &#39;Schmo&#39;) { return `Hello, ${firstName} ${lastName}`; }</pre><p>which we implement as follows:</p><pre>filter(param = &#39;&#39;) { // Set the current filter to be used. TodoFilter = param; // Trigger a collection filter event,  // causing hiding/unhiding of Todo view  // items. Todos.trigger(&#39;filter&#39;); } }</pre><p>And that’s it. Don’t forget you can check out the source for the application over on the project <a href="https://github.com/addyosmani/todomvc-backbone-es6">repository</a>.</p><h2>Web Components</h2><p>Although we haven’t seen a huge amount of research into how ES6 modules will play with Web Components, Guy Bedford has been <a href="https://github.com/ModuleLoader/es6-module-loader/issues/58">exploring</a> this (via <a href="http://polymer-project/">Polymer</a>) and we’re looking forward to more examples of interop in the wild.</p><h2>Tracking ECMAScript 6 Support</h2><p>ECMAScript 6 is being progressively implemented by browser vendors over time and as such there is no ‘fixed’ date on it being available everywhere.</p><p>Whilst specs and implementations continue to finalize and ship, you may find the below resources helpful in keeping track of where we are with browser and environment support:</p><ul><li><a href="http://pointedears.de/scripts/test/es-matrix/">Feature comparison matrix</a> of ECMAScript implementations (V8, JSC, JScript etc) by Thomas Lahn</li><li>Harmony features available in Node can be listed with node —v8-options | grep harmony</li><li>ECMAScript 6 compatibility <a href="http://kangax.github.io/es5-compat-table/es6/">table</a> by Kangax</li><li>Google’s V8: Harmony features with corresponding open bugs in <a href="https://code.google.com/p/v8/issues/list?q=label:Harmony">on the tracker</a> (i.e what ES6 features Chrome and Opera will support, either by default or behind the about:flags &gt; ‘Enable Experimental JavaScript’ flag).</li><li>ECMAScript 6 support in <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla">Firefox</a> (MDN). There is also a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=694100">meta-bug</a> on Buzilla you can check-out that’s slightly more in the trenches (HT @domenic). In addition, Rick Waldron suggests subscribing for component notifications from bugzilla and then creating a filter, however this might be a little high-volume.</li><li>IE <a href="http://msdn.microsoft.com/en-us/library/ie/br212465(v=vs.94).aspx">Dev Center</a> on supported ES6 features (hunting down a better list for IE11+)</li><li>ECMAScript 6 official <a href="http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts">draft</a> specification (and the unofficial <a href="http://people.mozilla.org/~jorendorff/es6-draft.html">HTML version</a> of the draft)</li></ul><p>We recommended that you follow <a href="https://twitter.com/esdiscuss">@esdiscuss</a> for a summary of what is happening on the es-discuss mailing list for links to the latest discussions.</p><p>Sindre Sorhus also maintains a <a href="https://github.com/sindresorhus/esnext-showcase">list</a> of real-world usage of ECMAScript 6 features in today’s libraries and frameworks that may be of interest.</p><h2>ES6 Tools</h2><p>If you’re interested in doing the deep-dive into ES6 today, the community has an evolving list of tools that can help with your workflow over at <a href="https://github.com/addyosmani/es6-tools">https://github.com/addyosmani/es6-tools</a>.</p><p>We’ve also recently been playing with <a href="http://es6fiddle.net/">http://es6fiddle.net</a>, which is awesome for experimenting with ES6 with zero-setup. Try it out!.</p><h2>Wrapping up</h2><p>In closing, we hope you found this brief walkthrough helpful. We’re pretty excited about seeing ES6 used to author more projects and invite you to share your own ES6 authoring experiences with us on <a href="http://twitter.com/tastejs">Twitter</a>.</p><p>With lots of ❤z,</p><p>Addy, Sindre, Pascal and Stephen.</p><p><em>With special thanks to Rick Waldron and Domenic Denicola for their reviews.</em></p><p><em>Originally published at </em><a href="http://blog.tastejs.com/rewriting-a-webapp-with-ecmascript-6"><em>blog.tastejs.com</em></a><em> on February 24, 2014.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39417b642cb2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tastejs-blog/rewriting-a-webapp-with-ecmascript-6-39417b642cb2">Rewriting A WebApp With ECMAScript 6</a> was originally published in <a href="https://medium.com/tastejs-blog">TasteJS blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yet Another Framework Syndrome (YAFS)]]></title>
            <link>https://medium.com/tastejs-blog/yet-another-framework-syndrome-yafs-cf5f694ee070?source=rss-686e816cf89e------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf5f694ee070</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[framework]]></category>
            <dc:creator><![CDATA[TasteJS]]></dc:creator>
            <pubDate>Thu, 29 Jan 2015 08:19:03 GMT</pubDate>
            <atom:updated>2015-10-09T08:38:26.733Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*b1GkjlBvVV0RPNba.png" /></figure><p>Almost every day, we see new libraries, frameworks and tools being released in the JavaScript community — many of which simply reinvent the wheel.</p><p>This regular stream of solutions, which opt to create something new rather than improve an existing solution is what we at <a href="http://todomvc.com/">TodoMVC</a> refer to as ‘Yet Another Framework Syndrome’ — or in more general terms NIH (Not Invented Here). Whilst innovation is something we should all welcome, YAFS can lead to confusion and frustration for users because there’s a big risk of it introducing more noise than value. Just one example is MVC.</p><p>Developers often just want to start writing an app but don’t want to manually evaluate 300 different options in order to select something maintainable. There’s currently however almost too much choice when it comes to what to use for structuring your JavaScript application. Part of this problem is fueled by how different JavaScript developers interpret how a scalable JavaScript application should be organized — everyone feels their way is the best. As a community we seem to prefer creating our own silos over improving existing solutions.</p><p>It’s not just MVC. Ask yourself how many results pop-up if you’re looking for a templating, routing, charting or Pub/Sub library and you’ll see what we mean. It sometimes feels like trying to find a needle in a haystack. Everyone has a different opinion about how apps should be structured, how libraries or tools should be approached and we favor creating our own silos and getting glory over genuinely improving something that is already there, so how do we solve this problem? Well, we recommend a few steps:</p><p><strong>Research. </strong>Investigate whether there aren’t already strong options developers already have in the market for the project you’re considering open-sourcing (or working on). Is it possible for you to help improve an existing project rather than creating a brand new one? If it’s meant as just learning or you don’t intend to maintain it, clearly mark it as so. Why not speak to developers involved in similar projects early on to see what they think of your ideas?</p><p>They may have input that can help you improve these or save you time in case you’re told someone has already implemented the idea, you just didn’t find it earlier. Involving others in the community early on is always a good thing. Twitter. GitHub gists. Groups. There are plenty of channels for getting feedback early on and you should use them.</p><p>Even if you think they’re doing it wrong, there may be good reasons for doing something in a particular way. They may have even started out like you but had to adapt. You have the benefit of learning from others mistakes.</p><p><strong>Document. </strong>If you go ahead with your project, make sure you document the heck out of what you do release. At TodoMVC, we currently get pull requests for a new MVC framework a few times a week and you would be surprised how many people consider documentation an optional after-thought. It’s not! Documentation is one of those things that can help make the difference between someone using your project and simply skipping over it.</p><p>You should argue for how your solution is better than the existing options and why the user should care about it. Demonstrate how it can make their lives easier and why it’s worth them investing their time in it. A lot of the repeated effort we set in the community doesn’t justify itself or try to set itself apart. For example, by promoting your project as AngularJS or Ember in 50 lines of vanilla JavaScript, you’re discounting the underlying complexity and completeness of those solutions. You’re also discounting the efforts that went into architecting and optimizing them without going into detail of how your solution compares performance wise to the exact same set of usecases. It’s more fair to both your audience and other framework authors to be balanced and honest in your claims.</p><p><strong>Support. </strong>If there are 100 libraries available for achieving one task and only 3 of them are actively maintained with support available (via some channel), developers are going to ignore the other 97 in many cases. Part of open-source is making sure you do your users the service of either maintaining what you put out there, or if you’re unable to do this, saying upfront that this is the case. Your users will thank you in the long-run.</p><p><a href="http://todomvc.com/">This is what YAFS looks like</a>.</p><h2>Further reading</h2><ul><li><a href="http://en.wikipedia.org/wiki/Not_invented_here#In_computing">Not invented here</a></li><li><a href="https://the-pastry-box-project.net/addy-osmani/2014-January-19">Front-end Choice Paralysis</a></li></ul><p><strong>A post from Addy, Sindre, Pascal, Stephen and Colin</strong></p><p><em>Originally published at </em><a href="http://blog.tastejs.com/yet-another-framework-syndrome-yafs"><em>blog.tastejs.com</em></a><em> on February 3, 2014.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf5f694ee070" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tastejs-blog/yet-another-framework-syndrome-yafs-cf5f694ee070">Yet Another Framework Syndrome (YAFS)</a> was originally published in <a href="https://medium.com/tastejs-blog">TasteJS blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>