My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
What's new in MERN 2.0

What's new in MERN 2.0

Somasundaram Ayyappan's photo
Somasundaram Ayyappan
·Jun 22, 2016

After a ton of work, MERN v2 was released yesterday. We have named this version as Turkish Angora since, at Hashnode, we have special love for felines. This release packs tons of new features to give you better performance, feature complete yet flexible and improved developer experience. We've also updated the website. It has a new logo and design. Let us know what you think.

Let me quickly highlight some of the key enhancements in the v2 release.

Modular file structure

MERN File Structure

The file structure is one of the major things which needed improvement in MERN v1. In this version, we have used a domain-specific file structure which nicely encapsulates all the reducers, actions, components, all related assets, and tests into a single folder.

Hot Reloading

MERN Hot Reloading

Powered by react-hot-reloader v3.

Code Splitting with React Router

You don't have to worry about your app's growing bundle size anymore. Now, MERN has code splitting. It generates separate bundle for each page containing the code required for that page to work. When a page is requested, it serves only the corresponding bundle.

Internationalization Support

Now MERN supports i18n, powered by the react-intl library. Thanks to @sirrodgepodge. You can check the example in mern-starter to find out how to use it.

Internationalisation

AVA Test Runner

Now tests are powered by excellent AVA library. It runs tests in parallel and gives better error output. The speed has considerably increased from V1, which was using mocha.

Docker Support

MERN has docker configurations for both development and production. Thanks to @kandros for contributing.

Code Generation Support

We also have mern-cli which come with support to generate code. You can generate components in either shared components directory or inside a module directory. Also, you can generate a module which will generate express routes, controllers & models, actions, reducers and a page component.

MERN code generation


Make your MERN

When we started issue thread to discuss the roadmap for MERN v2, we had different kinds of requests. Quite a few of those things are useful in some projects but doesn't make much sense to include in a boilerplate project like adding a Material-UI library or authentication, etc. So, we came up with an idea to allow other users to make their version of MERN by forking from the original mern-starter project. This modified version can be added to our mern-cli so that anybody using mern-cli can install the fork. We also support modifying generators to support your version of MERN. So, your imagination is the limit.

To know more, check out the documentation.


MERN Deploy

"How to Deploy MERN in production" is one of the most frequently asked questions. So, we are working on an experimental PaaS offering which will let you provision, host and deploy Node.js /MongoDB apps to your favorite cloud easily. If you want to be the first one to hear about it, please signup for the release newsletter here.

This was a quick overview of what's new in MERN v2. Contributions and suggestions are always welcome!