Graceful Degradation
Wujie provides a transparent fallback mechanism for browsers that do not support modern APIs.
In standard mode, the sub-app's DOM lives inside a Web Component and its JavaScript runs inside an iframe, with Proxy bridging DOM operations from the iframe to the Web Component. Because legacy browsers such as IE do not support Web Components or Proxy, Wujie falls back to using a second iframe in place of the Web Component and Object.defineProperty in place of Proxy.
Note
Wujie does not bundle ES6 polyfills because browser support targets vary by project. If you need to support older browsers, include the required polyfills via Babel in your own build setup.
Pros
Automatic detection — Wujie automatically degrades when the browser lacks Web Components or
Proxysupport.Strict application isolation is preserved even in Degrade Mode.
Zero code changes required — existing preloading, Keep-Alive mode, and communication code continue to work identically across standard and degraded environments.
Opt-in forced degradation — even on modern browsers, you can explicitly set degrade to
trueif you prefer rendering the sub-app's DOM inside aniframe.
Cons
Modals and popups are constrained inside the sub-app's
iframeand cannot cover the full viewport.Without
Proxy, Wujie cannot interceptwindow.location, so readingwindow.location.hostreturns the main app's host. Use $wujie.location to retrieve the sub-app's actual host instead.
