Registry / devops / wu-framework

wu-framework

JSON →
library2.1.2jsnpmunverified

Universal Microfrontends Framework allowing 13 different JavaScript frameworks (React, Vue, Angular, Svelte, Solid, Preact, Lit, Qwik, Alpine.js, Stencil, HTMX, Stimulus, Vanilla JS) to run simultaneously in a single page with Shadow DOM isolation. Current version 2.1.2 (June 2025) introduces honest sandbox modes and reference-counted mount/unmount for robust StrictMode/Suspense support. Zero runtime dependencies, 105KB bundle size, includes built-in AI integration with support for OpenAI, Anthropic, and Ollama. Differentiators include multi-framework support out-of-the-box, AI orchestration, WebMCP readiness for Chrome 146+, and no iframes required.

npm install wu-framework
INSTALL
IMPORT
SIG · WU-FRAMEWORK
W
wu-framework
devopsjavascriptv2.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wu
import { wu } from 'wu-framework'
import wu from 'wu-framework'
wu is a named export, not default. Common mistake for new users.
wuReact
import { wuReact } from 'wu-framework/adapters/react'
import { wuReact } from 'wu-framework'
Adapters are lazily loaded from subpath exports to reduce bundle size. Importing from main package returns undefined.
wuVue
import { wuVue } from 'wu-framework/adapters/vue'
const { wuVue } = require('wu-framework');
Vue adapter, same subpath pattern as React. CJS require from main package fails silently.
wu.ai
import { wu } from 'wu-framework'; wu.ai.provider(...)
import { wuAI } from 'wu-framework/ai'
AI functionality is accessed via wu.ai.*, not a separate export. AI chunk is loaded lazily on first call.

Mounts React and Vue micro-apps side by side, establishes event-based cross-app communication, and adds AI orchestration with a custom action.

// Install: npm install wu-framework import { wu } from 'wu-framework'; import { wuReact } from 'wu-framework/adapters/react'; import { wuVue } from 'wu-framework/adapters/vue'; // Register micro-apps wuReact.register('cart', () => { const div = document.createElement('div'); div.textContent = 'Cart: 3 items'; return div; }); wuVue.register('catalog', { template: '<div>Catalog: 42 products</div>' }); // Mount side by side await wu.mount('cart', '#app-cart'); await wu.mount('catalog', '#app-catalog'); // Cross-app communication wu.on('catalog:product-selected', (e) => { console.log('Product selected:', e.data.productId); }); wu.emit('cart:item-added', { productId: 'SKU-42' }); // AI integration (BYOL: Bring Your Own LLM) wu.ai.provider('openai', { endpoint: '/api/chat' }); wu.ai.action('addToCart', { description: 'Add product to cart', parameters: { productId: { type: 'string', required: true } }, handler: async (params) => wu.emit('cart:item-added', params), }); await wu.ai.send('Add product SKU-42 to cart');
Debug
Known issues
breakingwu.ai.provider() is now lazy-loaded; must call wu.aiReady() before first AI call if you need warm-up guarantees
fix
Add await wu.aiReady() after setting provider if deterministic timing is required.
affects: >=2.0.0
breakingImporting from 'wu-framework/adapters/*' changed from sync to lazy async in v2.0
fix
Ensure adapters are imported with dynamic import or top-level await if needed before first mount.
affects: >=2.0.0
deprecatedwu.getSandboxInfo(name) returns a Promise now; previously it was synchronous
fix
Use await wu.getSandboxInfo(name) instead of direct property access.
affects: >=2.1.0
gotchaAngular micro-apps require Angular 14+ and the adapter must be imported before mounting
fix
Import { wuAngular } from 'wu-framework/adapters/angular' before calling wu.mount with an Angular app.
affects: >=2.0.0
gotchaShadow DOM isolation may break global styles from host page; use styleMode option to control
fix
Set styleMode: 'none' or 'own-only' in mount options to selectively allow host styles.
affects: >=2.1.0
Errors
Common errors & fixes
TypeError: wu.mount is not a function
Trying to import 'wu' incorrectly (default import instead of named).
fix
Use import { wu } from 'wu-framework' instead of import wu from 'wu-framework'.
Error: Cannot find module 'wu-framework/adapters/vue'
Missing adapter file or incorrect import path; adapters are lazily loaded but must be imported exactly from subpaths.
fix
Ensure using import { wuVue } from 'wu-framework/adapters/vue'. Also check that the framework's package is installed (e.g., 'vue').
Warning: wu.aiReady() not called before AI usage – chunk may not be loaded
Lazy loading of AI chunk introduced in v2.0; first AI call may fail if chunk not loaded.
fix
Call await wu.aiReady() after wu.ai.provider() to ensure chunk is loaded before first AI send.
Uncaught TypeError: Cannot read properties of undefined (reading 'register')
Attempting to call adapter method before importing adapter module.
fix
Import the correct adapter import: import { wuReact } from 'wu-framework/adapters/react'.
Upgrade
Version history
2.1.2latest on npm
Audit
Dependencies
@angular/coreoptionalRequired only when using Angular adapter
@builder.io/qwikoptionalRequired only when using Qwik adapter
@hotwired/stimulusoptionalRequired only when using Stimulus adapter
@stencil/coreoptionalRequired only when using Stencil adapter
alpinejsoptionalRequired only when using Alpine.js adapter
htmx.orgoptionalRequired only when using HTMX adapter
litoptionalRequired only when using Lit adapter
preactoptionalRequired only when using Preact adapter
reactoptionalRequired only when using React adapter
react-domoptionalRequired only when using React adapter
solid-jsoptionalRequired only when using Solid adapter
svelteoptionalRequired only when using Svelte adapter
vueoptionalRequired only when using Vue adapter
Agent activity
12 hits · last 30 days
node
10
Resources
wu-framework — npm install wu-framework · libregistry