This is a short article about implementing routing in your single-page app (SPA) without external libraries. The examples use React, but should port over to your framework of choice. We’ll keep it short and sweet — the routing code itself is just a dozen lines or so.

You can see the app running here: spa-routing.netlify.com

Let’s imagine an app having the following pages:

  • Home page: /home.html
  • About page: /about
  • Landing page for Todos: /todos
  • A details page (which is a child of /todos): /todos/1

The details page demonstrates how a parent page can display child routes as children within the…


Update: Basho’s README on GitHub is more recent and accurate. Basho itself has changed significantly, and now evaluates lazily and only as needed.

I was faced with a rather mundane task last week. I had to clone my work from GitHub to GitLab, clean up the projects list and append some text to all the READMEs. With about 150 public and private repositories (of which I wanted to keep 50), manually doing this was not one of the best ways to spend a day.

If your bash foo is up to the task, this would have seemed achievable. Mine wasn’t…


Summary of features:

  • Streaming UI Components (via generators)
  • Async route handling
  • Easy integration with Redux, MobX and the like
  • Server-side Rendering
  • Powerful nested routes
  • Avoid re-implementing features which already exist in HTML/JS
  • Minimal learning curve

GitHub Repo: https://github.com/nsoap-official/sailboat

NSOAP — A Routing Convention for JavaScript

One of the big lessons from the success of React is that sticking close to the underlying programming language makes a framework way more powerful than otherwise, while remaining easy to learn. NSOAP (Native Syntax Object Access Protocol) takes this lesson to heart; and defines a URL convention for accesssing JavaScript methods and objects locally (client-side routing) or remotely (server-side routing).

If…


By some distance, the most widely used state management library in the React Universe is Redux. It has everything going for it; great documentation, active community, fantastic core team and great adoption. Perhaps more importantly, Redux design patterns allow clear separation of concerns. That makes it a natural choice in larger organisations, where being able to assess and distribute work predictably is more important than conciseness or cleverness.

My team did just that; and while we mostly succeeded and love Redux as a framework, we found canonical Redux design patterns tedious even for a team prepared to repeat code. Let…


There is a cottage industry of articles explaining why photographers shouldn’t share RAW files with clients. This isn’t a minority opinion; it is a well-entrenched, vigorously-defended idea among photographers. Alice is one among them. Even when a client fully pays for her work, she would not hand over the master copies of the photographs she took.

It’s time we put an end to this absurdity. If we’re paying for it, we should demand RAW files from the assignment. The notion of not owning the work we paid for doesn’t make sense.

To illustrate how unfair this is, let’s introduce a…


Marshall Smith is a relatively unknown tinkerer. Living a quiet life, he rarely stepped out of his small, some may say tiny social circle. On most days Marshall is at work in his basement with mechanical devices of different forms and sizes, some of which may bear the name of an uncertain Rube Goldberg if such a man were to be born as some of us expect. But to Marshall, these machines quench a momentary curiosity, an itch that would die only if the idea was molded into a geared-machination and the truth wrung out. …


Or why Microsoft’s recent Open Source announcements are likely to have very limited impact

I woke up to some interesting news from Microsoft’s Build Conference. Microsoft is creating a community called the .Net Foundation with the aim of open sourcing key components of the .Net framework. As part of it, they also announced an open source C# compiler called Roslyn. It seems that their goals are even broader; rumor has it that they might open source the .Net Framework itself and actively support Mono on non-Windows platforms.

It’s too little, too late, however.

The problem with C# is .Net. The problem with .Net is Windows.

For programmers who have used Linux or a Mac for a while, the lack of a good command shell in Windows…


OCCUPY PROTESTS by Adrian Kinloch

Or how patents changed the way I look at capitalism today

I have always supported Capitalism. Just like most other people, freedom is among the most fundamental of rights I cherish and Capitalism appeared to protect it better than other economic models. Being an entrepreneur (of fairly limited consequence I must add), a system that supported and rewarded independent innovation seemed right. Maybe even perfect.

So when the Occupy Protest Movement was taking place at Zuccotti Park and all across the world in 2011, I was vociferously against their demands even though I didn’t belong to the privileged 1% they were fighting against. …


REFUGEES FROM THE FIRST BALKAN WAR

I am signed into Facebook right now. At a quick glance, the entire list of posts on the first screen are irrelevant to me. If I scrolled down I can find 4 stories I actually care about, from a list of about 30. The most important page on Facebook has more than three-fourths of absolutely useless content.

Surprising. Facebook is a company with a very large number of talented people. They know a lot about me. Yet, their product looks like one of those spam filled mailboxes from the nineties.

The problem is Sharing. It is the most fundamental feature…


I am excited about the changes Marissa Mayer is making at Yahoo. The company is back in the news, there is excitement in the air, stock prices have soared. But from what we have seen in the past week, I can’t help think that Yahoo doesn’t really get design.

Flickr announced a major update today, and it is getting a lot of good press for it. Users are getting a full terabyte of free storage, and they get to upload huge high resolution images.

But just look at that page. Flickr is about photography, framing matters. Beautiful, high-resolution images will…

jeswin

I have an idea.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store