You might (not) need a JavaScript framework
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.editorconfig add editorconfig, reformat code Feb 25, 2017
package-lock.json update deps Jan 23, 2018

You might (not) need a JavaScript framework

In this repo, you will find examples on how to create a web site with reusable building blocks (aka components). When learning about React and components, I started thinking about how this could be done without using React, ES 2016, Webpack or any other framework out there. Is that even possible?

Okay, but why?

I want to understand the problems that are solved using React, ES 201x, Webpack & friends. I guess one way is to experience it the hard way - to feel the pain - by writing code with plain old vanilla JavaScript, html and css.

The source code in the main branch of this repo is written with Old School vanilla JavaScript, without any frameworks, without a build system and without a transpiler.

Blog post

There is also a blog post related to this repo:


The listItem.js component

vanilla.listItem = (function (templates) {

    function render(props, done) {

        // load the html using a template helper
        templates.load('/src/listItem/listItem.html', function (el) {

            // set data
            el.textContent =;
            el.addEventListener('click', props.onClick);

            if (done) {
                // pass the node to be rendered to the DOM

    return {
        render: render


The listItem.html template

<li class="listItem" title="the listItem component"></li>

Here's an example web page with vanilla components:


Clone this repo and start experimenting! To browse the example web page, run these commands:

npm install
npm start

When switching between the branches (see below), you might need to run the npm install command again (because of the different dependencies used).

What next?

To step by step add tools & frameworks, that will solve current issues and improve the quality & readability of the code base.

Something like this (each one in a separate branch):