公子
4 min readJan 27, 2018
ThinkJS 3 Release!

ThinkJS is a Node.JS framework to embrace the future. It focus on integrating project best practices and standardizing projects to make enterprise team development easier and more efficient. 🔗 https://github.com/thinkjs/thinkjs here is our Github repo, star welcome if you interested in it~

After ThinkJS 2.x released, we are aware of our shortcomings while we have brought a lot of great features. In response to these issues, after months of intense development, we are pleased to announce that ThinkJS has ushered in a big new version 3.0. The version is now available online on multiple projects, and just a simple command lets you download and use it:

npm install -g think-cli

😍What’s new?😍

As mentioned earlier, we have developed a new version to address the remaining deficiencies, as shown in below our new version of the frame composition.

In addition to introducing a new architecture and a high level of deconstruction of the framework, we have added a number of new features to optimize the use of the old version of the disease, let’s take a look at specific updates.

👨‍💻‍Reconstruction Framework Architecture based on Koa‍‍👨‍💻‍

The biggest change to 3.0 is to refactor the underlying architecture based on Koa as opposed to using its own integration architecture. The reconstructed ThinkJS 3.0 version is fully compatible with the Koa middleware.There are several main reasons for using Koa refactor:

  • Koa is now stable, the middleware of the onion model is more versatile, and the middleware ecosystem is maturing. All of those are ThinkJS did not have before. Base on Koa, we can do better just like stand on the giant’s shoulder.
  • Developers use a more elegant function async/await to solve asynchronous problems in Koa 2.0. This idea is perfectly consistent with ThinkJS. Earlier we can use these ES next syntax features easily with Babel in ThinkJS 2.x version. With the upcoming release of Node 8.x LTS, async/await is native support so we can use it directly in the production environment without using Babel transpile.

✂️Streamline core, support extend and adapter️✂️

The ThinkJS 2.x version has a number of built-in features that are basically best practices for many enterprise projects. But not all of these features are required for each project, it’s very difficult to achieve customize framework base on old version ThinkJS 2.x. So we refactored and streamlined ThinkJS base on Koa in 3.0 version. ThinkJS no longer offers rich functionality, but provides a basic core function, and then meets more needs by extending.

🍃Multi-process model🍃

In ThinkJS 2.x multi-process is optional, and the framework design is simple, many features need to be handled manually by the developer. While in new version, we developed think-cluster module to build-in multi-process model directly to maximize the use of multi-core CPU to improve response speed. Also we provide a set of ways to communicate between processes, such as: notify other processes to perform a task, or restart all child processes after source code is updated online.

👼Intelligence error hint👼

One of the headaches in Node.JS development is the problem of error handling. It’s troublesome when it comes to error checking and location problems, especially after Babel transpile. To resolve this, we have developed think-trace module to trace error problems and to capture error stack information more friendly.

🙋And!🙋

In addition to some of the features we have just mentioned, we have other updates to tell you:

🙇Thank you🙇

Finally, thanks to all the users of the ThinkJS framework, for your support over the years, it’s your presence that gives us the courage to go further. And of course, thanks to all the contributors that have contributed to the ThinkJS project, including the main repo and documentation contributions, and your efforts to make ThinkJS better and better! Thanks to all of you, let’s embrace ThinkJS and look forward to a better future!