@modular-vue/runtime

vue-router runtime for @modular-vue modules: createRegistry with module registration, dependency validation, lifecycle hooks, plugin machinery, and manifest resolution.
6,230 7
Install
npm install @modular-vue/runtime
Latest Version:1.4.1
Vue:3
Last Updated:Oct 13, 2026
Links: GitHub  ·  npm
Maintainer: kibertoad

@modular-vue/runtime

Runtime registry for @modular-vue modules on vue-router. Collects registered modules, validates their dependencies, runs lifecycle hooks, drives the plugin machinery, and resolves the navigation manifest, slots, and module descriptors.

This is the registry half of the runtime. The router-owning resolve() entry, the Providers context component, the router.addRoute() route-builder, and the auth guard land alongside it in a following release; this package assembles everything that does not need a router or a Vue render tree.

Installation

npm install @modular-vue/runtime

What's included

  • createRegistry(config) — build a registry from stores / services / reactiveServices / slots.
  • registry.register(module) / registry.registerLazy(descriptor) — register eager and lazily-loaded modules.
  • registry.use(plugin) — attach a plugin; its extend surface is intersected onto the returned registry reference, so contributed methods (e.g. a future registerJourney) are typed on the same object.
  • registry.resolveManifest(options?) — resolve all modules into a ResolvedManifest: navigation, slots, modules, moduleDescriptors, plugin extensions (+ the journeys alias), onModuleExit, and recalculateSlots. Idempotent — the first call does the work and caches the result; later calls return it and must pass no options.

Usage

import { createRegistry } from "@modular-vue/runtime";
import { billingModule } from "@myorg/billing";

export const registry = createRegistry<AppDeps, AppSlots>({
  stores: { auth: authStore },
  services: { api },
  slots: { commands: [] },
});

registry.register(billingModule);

export const manifest = registry.resolveManifest();
// manifest.navigation, manifest.slots, manifest.moduleDescriptors, ...

Validation

resolveManifest() runs the shared core validators before assembly:

  • duplicate module IDs throw,
  • modules whose requires are not provided by the registry throw,
  • optionalRequires gaps warn (the module still loads),
  • malformed entry/exit declarations throw.

Registration is locked once resolveManifest() runs — registering a module or attaching a plugin afterwards throws.

Related Packages

@modular-vue/nuxt

Nuxt 4 integration for @modular-vue: a Nuxt module plus a runtime installer that...

6,377 7
@modular-vue/journeys

Vue 3 journeys for @modular-vue: JourneyProvider, instance composables (useJourn...

5,443 7
@modular-vue/core

vue-router core for @modular-vue modules: defineModule with createRoutes(): Rout...

0 7

Version History

Version Released Vue License
1.4.1 ^3.5.40
1.4.0 ^3.5.40
1.3.0 ^3.5.40
1.2.0 ^3.5.40
1.1.0 ^3.5.40