On Monday the Node Long-term Support Working Group met to discuss plans for Node's future release schedule. The plan is described as a strawman LTS plan, meaning it's preliminary and hasn't yet been approved. There's a discussion on GitHub about it that I found through this Tweet (retweeted by @rvagg which is seemingly how I learn everything about io.js/Node):
The plans are based on several assumptions -- again, nothing is official yet. One assumption is that the next major and officially supported Node release will be from the merged io.js/Node project, and will follow io.js's versioning. Subsequent major releases will be yearly, and will transition into maintenance after 18 months. There's a handy visualisation of the release schedule:
Relä (GitHub: joakimbeng/relae, License: MIT, npm: relae) by Joakim Carlstein is a library for fetching data from RESTful servers using React components. It can fetch data from a base URL, but can also filter data.
If you've already injected JSON into the initial page load, then you can bootstrap it with Relae.bootstrap(data).
To use Relä, you need to wrap a React component with Relae.createContainer. This is where you pass the REST API URL and filtering options:
This project is based on React Relay -- you can compare the API from the Relay Newsfeed blog post. The author has planned more features, but has already implemented some cool stuff like caching.
If you find yourself generating lists of class names (often done in React projects), then have you ever wondered if there's a better way to do it? Luke William Westby has a suggestion: ClassNameBuilder (GitHub: lukewestby/class-name-builder, License: MIT, npm: class-name-builder). This library offers a chainable API for manipulating class name strings. It supports conditional expressions and merging instances together:
Mesh (GitHub: mojo-js/mesh.js, License: MIT, npm: mesh) by Craig Condon is a data synchronisation library that caters for server-side and client-side requirements. The author has pitched it as the "underscore of data", meaning it's a highly focused library that you can drop in to existing applications.
It covers both storage and transit. For example, in the browser you could use localStorage, and Socket.IO to broadcast data to other clients. The supported databases are in-memory, localStorage, and MongoDB. If you want to use Mesh with a database that isn't supported, then you can write a new database adapter based on a CRUD API.
The API is based on CRUD operations and Node-like streams. Let's say you want to store data to local storage:
var mesh = require('mesh');
var storage = require('mesh-local-storage');
var bus = storage();
You can now insert data (persisted to local storage) like this:
The main motivation behind this library is to make data sources interoperable with one another, so I'd like to see what this looks like with a React application in the client, and a MongoDB-based REST API on the server.
If you want to try it, use npm install -g email@example.com but be careful: not only is it a beta, but you can also break your npm installation if the global install fails. How do I know? My permissions were messed up on /usr/local/bin/npm, so when I tried to upgrade I saw "Error: EACCES, unlink ... node_modules/npm/.eslintrc". From that point npm was no longer in my $PATH... I actually reinstalled my current version of Node to fix it quickly, but I can imagine people getting very confused and frustrated about seeing command not found: npm.
If you're wondering what npm 3 will do for you, then a big thing is actually the UI: installation has a different appearance (it's more like npm ls), and npm outdated has changed. The "location" column shows which module required a dependency rather than where it is on disk.
Big projects should feel a little saner thanks to less nesting:
Your dependencies will now be installed maximally flat. Insofar as is possible, all of your dependencies, and their dependencies, and THEIR dependencies will be installed in your project's node_modules folder with no nesting.
If you make use of peerDependencies for modules that you distribute, you should be aware that they don't install dependencies anymore. Instead the user is warned about an unmet dependency.
This shifts the responsibility for fulfilling peer dependencies from library framework / plugin maintainers to application authors, and is intended to get users out of the dependency hell caused by conflicting peerDependency constraints. npm's job is to keep you out of dependency hell, not put you in it.
npm 3 is considered a rewrite by the authors. The level of redevelopment means we'll hopefully see some rich new features in the near future for front-end developers. If you're like me and you use Node for lightweight server-side apps, with rich client-side logic, then this will appeal to you.
The changelog for version 3 is actually very good and you really should read the full thing if you manage Node projects or distribute modules with npm.
Version 3 has a new API designed specifically for building web applications. It's called Vert.x-Web, and it supports routing, body and cookie parsing, authentication, static files, and it has an event bus bridge.
var route = router.route('POST', '/catalogue/products/:productype/:productid/');
var productType = routingContext.request().getParam('producttype');
var productID = routingContext.request().getParam('productid');
// Do something with them...
Vert.x 3 has support for MongoDB, Redis, and JDBC. It also supports reactive streams, and it has RxJava style APIs if you want to avoid using too many nested callbacks. The reactive API supports things like converting readable streams to observables (Rx.Observable.fromReadStream), and asynchronous future objects (Rx.observableFuture). Vert.x pushes reactive programming pretty hard, so if reactive programming is your thing then you might want to try it out.