Nimpl News 06/2024

Documentation Changes nimpl.tech

New design. The site now reflects the history of the nimpl family solutions. After all, everything started with next-impl - implementation for next.js. It was decided to make the name simpler afterward. The new name reflects simplification of life, but retains its original goal - implementations, i.e., examples of solving the main problems on next.js.

The new design shows this connection, demonstrates how nimpl interacts with next.js, complements it, and uses its capabilities.

At the same time, the site’s accessibility has been completely improved. The site is now not only fast but also accessible.

A new category was added, tools - utilities that can make life better. At the moment, they include @nimpl/versioner and @nimpl/inio.

New package - @nimpl/middleware-chain

During the work on the package @nimpl/ab-tests, it was decided to test it in several projects. However, adding a simple middleware turned out to be a real adventure. The problem is that there were already middleware in the projects - one with next-intl, one with next-auth.

All existing middleware combination solutions work through their own APIs - they are made in the style of express.js or in their own vision. They are useful, well-implemented, and convenient. But only in those cases when each used middleware can be updated for them.

But it was necessary for each middleware to work like the original middleware from next.js. That’s how @nimpl/middleware-chain appeared:

import { default as authMiddleware } from "next-auth/middleware";
import createMiddleware from "next-intl/middleware";
import { chain } from "@nimpl/middleware-chain";
 
const intlMiddleware = createMiddleware({
  locales: ["en", "dk"],
  defaultLocale: "en",
});
 
export default chain([intlMiddleware, authMiddleware]);

New tool - @nimpl/inio

The comfort of the development is not enough with just build packages and application logic. There is also a need for a work ecosystem that can improve DX.

One of the problems for me is working with local translations. If you need to change the term - you need to go to each of the dozen files, dial the correct key (which is often not unique) and update.

It’s not quick, it’s not comfy, it’s not developer-friendly. Dozens of actions when you literally need a few.

That’s why I appreciated the idea of creating a dynamic new way to edit JSON files. A Plug-and-Play solution - just Run and Edit! With @nimpl/inio.