Thoughts about Vue.js

También en español

I recently attended a workshop about Vue.js, organized by @workshopsjs and given by @ianaya89. This post is an attempt to organize my thoughts regarding the framework, as basic as they might be by having such little exposure to it.

Request-scoped variables in Express

One common requirement in web applications is keeping track of the currently logged in user throughout the execution of a request. While this is fairly simple to do in web servers where each request has its own execution environment (be it a thread or a process), Node's single-process single-thread model makes it less straightforward - but it can be achieved with the help of continuation-local-storage.

Generating Swagger documentation for an Express API

In the process of finishing up an Express project, I wanted to leave a nice set of documentation for future users and/or maintainers of the API. I wanted the documentation to live next to the code, and the tooling to generate a nice site from it. Finally I settled for Swagger and used a combination of packages to get the job done.

Adding JWT authentication to an Express API

One of my most recents tasks was to add some sort of user authentication to an API built with Express running on an embedded device. I'm used to working either with Rails, where these kind of things are mostly provided by gems that make all the decisions for you; or on small Node projects which didn't require authentication at all. So this was new and required me to do some research about alternatives and implementation details.

Creating a conversational Telegram bot in Node.js with a finite state machine and async/await

Telegram, for those who don't know it, is a free multi-platform messaging app.

Using JST as a source of Angular templates

If you're using Rails, a nice tool to expose your Javascript templates is JST. JST allows you to write HTML templates for your JS library of choice, and it exposes them in a JST global object on the client side, using their path relative to the Javascript asset's path as the key. They play nicely with Angular.js and there's a way to make Angular "JST aware" so to speak.

Unexplained syntax error on PhantomJS with strict mode

Short story: PhantomJS considers a syntax error when a named function expression is called the same as some of its parameters, and won't be very explicit about it.

Fixed sidebar with fixed header and footer

These are a couple of ways of constructing a layout that consist of a fixed footer, header, and sidebar. The application we were building had a preview to the left and the fixed sidebar to the right to tweak that preview. The problem to solve is how to give the sidebar the proper height so it will scroll its content correctly.

Recreate ElasticSearch index for integration testing.

I fought against this for most of last week so now that I solved it I figured I could share it with the rest of the world (not that I had much fun running tons of Jenkins' builds to see if it was fixed...).

Hello World

There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.