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');
Errors
Common errors & fixes
TypeError: wu.mount is not a function
Trying to import 'wu' incorrectly (default import instead of named).
fixUse 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.
fixEnsure 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.
fixCall 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.
fixImport the correct adapter import: import { wuReact } from 'wu-framework/adapters/react'. 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