Lokiedu / libertysoil-site

GNU Affero General Public License v3.0
8 stars 5 forks source link

ExpressJS -> KoaJS #technicaldebt #100

Closed imboogieman closed 8 years ago

imboogieman commented 8 years ago

We use ExpressJS as a framework for our web-backend code (api-server, server which rendeds React-components on the server-side).

There are 2 issues here:

  1. While our code-base tends to use modern async capabilities, ExpressJS uses "classical" callback-style controllers. They make code harder to read and it's easier to miss crucial error handler somewhere.
  2. ExpressJS is pretty much dead (all original core-dev team is dissolved, project is hijacked by IBM)

On the other hand, Koa 2.0 framework is based on ES7 await/async primitives which guarantee robust error handling and is actively developed. It is marked as "alpha", but (quote from official documentation follows):

We do not plan to release v2 as "stable" until async/await hits node.js. … Don't be scared to use Koa v2 Alpha right now, though. People are already using it in production, and we don't foresee any major changes until we mark it stable.

The task is to convert our server-side code from ExpressJS to Koa2. This means:

  1. server itself
  2. middlewares
  3. testing middleware (we use "unexpected-express", which probably wouldn't work with koa)
voidxnull commented 8 years ago

plus! 0/4

voidxnull commented 8 years ago

plus! 5/1 Now we need find a suitable replacement for unexpected-express.

guiltypet commented 8 years ago

plus! 1.33/1.33

guiltypet commented 8 years ago

According to my observation response header X-Powered-By is still Express which means according to this https://en.wikipedia.org/wiki/List_of_HTTP_header_fields that framework was not migrated to Koa2

RusAlex commented 8 years ago

plus! 3/0

RusAlex commented 8 years ago

plus! 3/1

RusAlex commented 8 years ago

plus! 3/1

RusAlex commented 8 years ago

plus! 7/7

RusAlex commented 8 years ago

plus! -1d 7/7

RusAlex commented 8 years ago

plus! -7/-7

RusAlex commented 8 years ago

plus! -1d 4.1/4.1

guiltypet commented 8 years ago

Looks like implemented. Verified on Windows Pro 7/Chrome 50