mini-star is a robust frontend micro-kernel framework, bundler, and loader designed to help projects implement a plugin-based architecture. It facilitates the independent development and deployment of features as separate plugins. The library, currently at version 2.1.8, supports TypeScript natively and is framework-agnostic, meaning it can be integrated with React, Vue, Angular, jQuery, or other modern web frameworks. Key differentiators include its bundler for building AMD-based plugins, automatic processing of plugin and dependency paths, dynamic asynchronous module loading to optimize project size, and a powerful mechanism for sharing common dependencies across all plugins, reducing boilerplate and bundle size. Unlike `requirejs`, `mini-star` operates at a module level, aligning with modern frontend practices, and it distinguishes itself from micro-frontend solutions like `qiankun` by prioritizing dependency reuse and an isomorphic technology stack rather than isolation for heterogeneous applications. It offers a complete toolchain encompassing CLI, runtime, and bundler functionalities. The project appears to have an active development and maintenance cadence, with recent documentation updates indicating ongoing support.
npm install mini-starVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `mini-star`, register shared dependencies like React and ReactDOM, and dynamically load a plugin. It shows basic configuration, error handling, and how a plugin's exposed methods can be invoked.
Call `ministar.registerShared('dependencyName', dependencyObject);` for all common libraries (e.g., React, Vue, lodash) in your host application's initialization phase, prior to any `ministar.loadPlugin()` calls.Thoroughly test plugin loading paths. For production, consider using absolute URLs or a CDN-based `base` path in `MiniStar` configuration. Ensure your bundler outputs plugins to the expected location and that the host application can access them.
Always use `import { ... } from 'mini-star';` for consuming the `mini-star` library in your host application. Ensure your project's build setup (e.g., Webpack, Rollup) correctly handles ESM.Provide a custom `errorHandler` function in the `MiniStar` constructor options to log detailed information, capture stack traces, or report to an error monitoring service, enabling quicker debugging of plugin issues.
Ensure `React` (and other global dependencies) are properly imported and then registered using `ministar.registerShared('react', React);` in the host application before any plugins are loaded.Verify the `base` path in `MiniStar` configuration. Check the network tab in browser dev tools for 404s on the plugin URL. Ensure the plugin's bundle is correctly built and accessible at the expected location.
Ensure your plugin's entry file explicitly exports the `render` function (or whatever methods you expect). If using TypeScript, cast the loaded plugin to its specific interface: `await ministar.loadPlugin<MyPluginInterface>('my-plugin');`No dependency data recorded yet.