Tech Stack
The Modern.js framework comes with built-in popular libraries and development tools from the community.
In this document, you can learn about the main technology stack involved in the Modern.js framework, as well as some optional libraries and tools.
UI Library
Modern.js uses React 18 to build user interfaces and is also compatible with React 17.
Rsbuild supports building Vue applications. If you need to use Vue, you can refer to "Rsbuild - Vue".
Routing
Modern.js uses React Router v7 for routing.
Modern.js supports conventional routing, self-controlled routing, or other routing schemes. Please refer to "Routing" to make your choice.
Package Manager
Modern.js can be used with any community package manager, such as npm, yarn, pnpm, or Bun.
We recommend using pnpm for faster installation speed.
Bundler
Modern.js uses Rspack to bundle your web applications.
Transpiler
Modern.js uses SWC as JavaScript transpiler to transform TypeScript or JSX into JavaScript code that can run in browsers and perform syntax downgrades.
When using Rspack for building, babel-loader is not enabled by default. If you need to add Babel plugins, you can configure them through babel plugin, which will generate additional compilation overhead and slow down Rspack build speed to some extent.
Minimizer
During production builds, Modern.js uses SWC to minify JS code.
CSS Transformer
Modern.js uses PostCSS to transform CSS code and enables autoprefixer by default to add CSS prefixes.
Modern.js supports enabling "Lightning CSS", which uses Lightning CSS to downgrade CSS syntax.
Modern.js supports enabling "Tailwind CSS" and is compatible with both Tailwind CSS v3 and v4.
CSS Preprocessors
Modern.js supports three CSS preprocessors: Sass, Less, and Stylus:
- Sass and Less are supported by default and ready to use.
- Stylus is optional and can be used by referring to the "Stylus Plugin".
CSS Modules
Modern.js provides out-of-the-box support for CSS Modules, which is implemented internally based on css-loader.
Please refer to "Use CSS Modules" for usage instructions.
CSS-in-JS
Modern.js supports the use of styled-components. Please refer to "Using CSS-in-JS" for usage instructions.
If you need to use other CSS-in-JS solutions, you can integrate them into your project on your own.
UI Components
Modern.js can be used with any React UI component library from the community, such as MUI, Ant Design, Arco Design, Semi Design, Radix UI, and more.
Component Development
Modern.js supports the use of Storybook for developing UI components. This feature is optional. Please refer to "Using Storybook" to enable it.
Node.js Framework
Modern.js Server and BFF use Hono.js as the runtime framework, and you can extend the Server based on the Hono.js ecosystem. Please refer to Custom Web Server.