Neutrino: Releasing v8 🎉

Eli Perelman
Dec 14, 2017 · 5 min read
Neutrino v8 is released!

Last week marked the release of Neutrino version 8, the latest in the tool that combines all the features and power you love about webpack with the ability to start zero-configuration projects, all without losing extensibility. There is a lot that went into this release, so let’s dig in.

Creating new projects

For yarn users, you can start a new project with yarn create:

yarn create @neutrinojs/project <directory-name>

For npm users, you can start a new project with the npx command:

npx @neutrinojs/create-project <directory-name>

You will then be guided through a series of quick questions, and you can immediately build and write your project! To see it in action, here’s a screenshot of me creating a new React app:

When prompted by create-project, there are a number of different project types you can start with:

  • React
  • Preact
  • Vue
  • Node.js
  • Web and Node.js libraries
  • Any generic web app
  • Standalone React components

In addition, you can add test runners like Karma, Mocha, and Jest, or even lint your project using ESLint with Airbnb or StandardJS. All of these are pre-configured to use without any additional setup, but remain completely extensible for future use.

Scoped packages

So what does this mean exactly? All the packages you may have relied on in the past simply need to be installed with a scoped name instead of their old name, such as

  • neutrino-preset-web@neutrinojs/web
  • neutrino-preset-react@neutrinojs/react
  • neutrino-preset-node@neutrinojs/node
  • neutrino-preset-jest@neutrinojs/jest

New middleware types

  • @neutrinojs/library: Create JS libraries for Web or Node.js targets
  • @neutrinojs/react-components: Create generic React components. Plays nicely with other Neutrino middleware, so you can build, test, and publish multiple React components from a single repository.
  • @neutrinojs/preact & @neutrinojs/vue: Create Preact and Vue-based projects with support for JSX and more.
  • @neutrinojs/standardjs: Use ESLint with StandardJS rules to lint your projects
  • @neutrinojs/fork: Fork the usage of middleware into separate processes. You can combine this with other middleware to configure and build multiple project types from a single project, such as React+Node for SSR, or build multiple variations of a library in parallel.

Better support for multi-page apps and multiple mains

// .neutrinorc.jsmodule.exports = {
options: {
// Each key in `mains` maps to an entry point
// located in the source code directory, e.g. src/
mains: {
// The key is the file name that will be generated
// The value is the file in src/ to use as the entry point
index: 'index',
admin: 'admin',
login: 'sign-in'
}
}
};

Improved style middleware, CSS modules

In addition, our web-based presets now support CSS Modules out of the box, with *.module.css files in web, react, and preact, and module-based style tags in vue.

Breaking changes

What’s next?

  • WebExtensions
  • Electron
  • Elm

Getting involved!

  • We have good docs, but we want great docs! Having a custom docs theme that fits Neutrino’s personality would make things much better.
  • Video tutorials and courses. Being able to guide new users of Neutrino into starting new types of projects, and customizing them in the future is something that would really help us out!
  • Porting Create-React-App to be backed by Neutrino. We have an issue filed for this, and would really like someone from the community to be the hero on this effort.

Of course, we always are looking for help with bugs, code, and documentation, and promotion. If you’re interested in helping at all, please jump into our community channels and introduce yourself. The team is very friendly, and would be happy to mentor you through anything you want to tackle. ❤️

Spectrum:

Website and Documentation:

GitHub:

Twitter:

Eli Perelman

JavaScript and Node.js