bullshit

Maybe a lot of people will think this is something, they never heard of you during vuE2!

That’s true. Trying open source for the first time, not knowing what to do, or what to do right. I just made something that worked, recommended it on a small scale, got some good feedback, got some natural star, and that’s it.

background

In late 2017, the company began a multi-party collaborative project with a strong need for independent management and responsibility division. In vain, I designed an architecture pattern that supports separate library development, construction and deployment, as well as independent and consolidated operation. At the time, the architecture integrated a lot of preset content, including UI frameworks, third-party libraries, and public methods. It was a large and comprehensive design. The term “micro front end” had not been heard in the community at the time, so there was no accurate expression. After more than a year of internal project validation, this architectural pattern has proven to be reliable, so I’ve put it together and called it Admincraft.

history

As the project has evolved, AdminCraft has highlighted a number of issues, such as rigid layout hierarchies, built-in third-party libraries, and a non-generic built-in approach that makes the architecture inflexible and only applicable to specific mid-background projects. After much thought, I removed almost all of the application layer content and only retained the core capability of module loading. I released the first micro-front-end module loader supporting vuE2 version: VUE-module-loader V1.x reading documentation.

Since it is only a loader, it is not a framework, but a VUE plug-in for loading lib modules that conform to the convention design pattern.

I can’t remember how it was promoted at that time. The official website only left a QQ group QR code, and then some friends gradually joined.

The Github repository is also slowly getting some stars.

There are also people in the group who are working on production projects, which is very exciting.

In the future

Vue3 stable version has been released, there are also some friends in the group hope to support Vue3, vuE-module-loader to the update time.

Vue -module-loader V3.x is based on vite. Vite’s capabilities are not described here, you know.

In keeping with the concept of 1.x, vue-module-loader only has loader capabilities and exists as a vue3 plug-in. At the same time, in keeping with vue3’s initial use of Hooks, vuE-module-Loader’s API is also provided in Hook form without binding vUE component instances.

use

automatic

  1. Install the command line tool

    npm install -g vue-module-creator
    # or use YARN
    yarn global add vue-module-creator
    Copy the code
  2. Create a project

    vml create
    Copy the code
  3. Follow and guide operation

manual

  1. The installation

    yarn add vue-module-loader@next
    Copy the code

    Note: be sure to install vue3 supported versions using the next tag

  2. use

    // main.js
    // Import the Vue3 object as a whole
    import * as vue from "vue";
    import vml from "vue-module-loader";
    const app = vue.createApp({});
    // Use plugins
    app.use(vml, vue);
    Copy the code

    Use it in any JS or Vue file after installation

    import { useModule } from "vue-module-loader";
    useModule(
      // Test the module connection
      "http://static.mengqinghe.com/vml/module/vue-module-module.iife.js"
    );
    Copy the code

Interested friends can read the detailed documentation further

Welcome your criticism and correction!