Aiga Docs

Comparison with Alternatives

How Aiga compares to qiankun, micro-app, wujie, Module Federation, and single-spa.

Framework Comparison Matrix

Featureqiankunmicro-appwujieModule FederationAiga
Isolation StrategyProxy snapshotShadow DOM + Proxyiframe + ProxyNone (shared)4-tier adaptive
CSS IsolationPartial (scope prefix)Shadow DOMiframe boundaryNoneShadow DOM / iframe
JS IsolationProxy snapshot (leaks)Proxy (partial)iframe (full)NoneProxy / iframe (tunable)
Storage IsolationNoneNonePer-app namespaceNonePer-app namespace
Cookie IsolationNoneNoneNoneNonePer-app namespace
Overlay HandlingManual patchingPartial autoiframe promotionN/AAuto teleport + promotion
CommunicationglobalState + eventdata bindingprops + eventShared modulesTyped RPC + events
iframe PoolNoNoNoN/AYes (pre-warmed, LRU)
Keep-AliveLimitedLimitedMemory-basedN/ALRU with priority eviction
Router IntegrationExternalBuilt-in (basic)Built-inExternalBuilt-in (nested, guards)
TypeScript RPCNoNoNoPartialFull
Framework Lock-inNoneNoneNoneWebpack/ViteNone
Web Component APINoYesNoNoYes

Detailed Comparisons

vs. qiankun

qiankun uses a Proxy-based snapshot approach: when a sub-app mounts, it captures the current window state; on unmount, it restores it. This is lightweight but fundamentally flawed:

  • State leakage: Side effects that escape the snapshot (timers, event listeners, global mutations between snapshots) leak between apps
  • No real CSS isolation: Relies on prefix-based scoping which breaks dynamic styles
  • No overlay handling: Modals from antd/Element Plus need per-library patches
  • Untyped communication: globalState is a plain object with no type safety

Aiga's light sandbox provides similar overhead (~2-5MB) with stronger guarantees: Shadow DOM for CSS, Proxy for JS, timer tracking for cleanup, and scoped cookies.

vs. micro-app

micro-app is the closest in philosophy — it also uses Web Components and Shadow DOM. Key differences:

  • Single isolation level: micro-app doesn't let you choose per sub-app
  • No iframe pooling: Every strict-isolated app creates a fresh iframe
  • Limited overlay support: Handles some cases but breaks with nested shadows
  • No typed RPC: Communication is via data attribute binding and custom events

Aiga extends micro-app's approach with tiered isolation, iframe pooling, and a full RPC channel.

vs. wujie

wujie pioneered iframe-based isolation with proxy bridging. Aiga builds on this foundation:

  • All-or-nothing isolation: wujie doesn't offer a lighter option for trusted apps
  • No iframe pool: Each app creates a fresh iframe (~50-100ms cold start)
  • No keep-alive LRU: Memory management is manual
  • No CSS variable syncing: Host theme changes don't propagate to iframe apps
  • No cookie isolation: Apps can read/write each other's cookies

Aiga's strict mode matches wujie's isolation while adding pooling, CSS sync, cookie namespacing, and configurable timeouts.

vs. Module Federation

Module Federation is a build-time solution for code sharing, not a runtime isolation framework:

  • No runtime isolation: Shared modules run in the same context
  • Build-tool coupling: Requires Webpack 5+ or Vite plugin configuration
  • No overlay handling: Not applicable (same runtime)
  • Version conflicts: Shared dependency mismatches cause runtime errors

Module Federation is complementary to Aiga — you can use Federation for shared libraries and Aiga for runtime isolation.

vs. single-spa

single-spa is a meta-framework that orchestrates sub-app lifecycles but provides no isolation:

  • No sandboxing: Apps share the global scope entirely
  • External routing: Relies on framework-specific adapters
  • Manual lifecycle: Each app must export bootstrap, mount, unmount
  • No communication layer: Apps must implement their own messaging

Aiga provides everything single-spa does (lifecycle, routing) plus isolation, RPC, and overlay handling.

When to Use What

ScenarioRecommendation
Same team, shared buildModule Federation
Same team, independent deployAiga (none or light)
Cross-team, trusted appsAiga (light or strict)
Third-party widgetsAiga (strict or remote)
Fully untrusted contentAiga (remote)
Legacy migration (gradual)single-spa + Aiga for new apps

On this page