wu-framework 1.1.19 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,10 +9,10 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="https://www.npmjs.com/package/wu-framework"><img src="https://img.shields.io/npm/v/wu-framework.svg?color=8b5cf6&label=npm" alt="npm version" /></a>
13
- <a href="https://github.com/LuisPadre25/wu-framework/actions"><img src="https://img.shields.io/github/actions/workflow/status/LuisPadre25/wu-framework/ci.yml?label=tests&color=10b981" alt="tests" /></a>
14
- <img src="https://img.shields.io/badge/tests-650%20passed-10b981" alt="650 tests" />
15
- <img src="https://img.shields.io/badge/dependencies-0-8b5cf6" alt="zero deps" />
12
+ <a href="https://www.npmjs.com/package/wu-framework"><img src="https://img.shields.io/npm/v/wu-framework.svg?color=6366f1&label=npm" alt="npm version" /></a>
13
+ <a href="https://github.com/LuisPadre25/wu-framework/actions"><img src="https://img.shields.io/github/actions/workflow/status/LuisPadre25/wu-framework/ci.yml?label=tests&color=14b8a6" alt="tests" /></a>
14
+ <img src="https://img.shields.io/badge/tests-650%20passed-14b8a6" alt="650 tests" />
15
+ <img src="https://img.shields.io/badge/dependencies-0-6366f1" alt="zero deps" />
16
16
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License" /></a>
17
17
  </p>
18
18
 
@@ -449,12 +449,41 @@ Something is coming. It learned from every LLM call you ever made. It doesn't ne
449
449
 
450
450
  ---
451
451
 
452
+ ## Wu CLI
453
+
454
+ The official CLI for wu-framework. One binary, one port, all your micro-apps.
455
+
456
+ ```bash
457
+ npm install -g @wu-framework/cli
458
+
459
+ wu create my-project # Interactive scaffolding (13 frameworks)
460
+ cd my-project
461
+ wu dev # Native Zig dev server on one port
462
+ wu build # Production build (parallel Vite)
463
+ wu serve # Serve production build
464
+ ```
465
+
466
+ Features:
467
+ - Native SIMD HTTP server written in Zig (16 bytes/cycle parsing)
468
+ - Three-tier compilation: Native Zig JSX (0-2ms) -> Compiler Daemon (10-50ms) -> Node fallback
469
+ - Two-level cache with 73-138x speedup on warm restart
470
+ - Theme-aware production shell with dark/light toggle
471
+ - 13 framework app templates with CSS variable theming
472
+
473
+ See [@wu-framework/cli](https://github.com/LuisPadre25/wu-cli) for full documentation.
474
+
475
+ ---
476
+
452
477
  ## Contributing
453
478
 
454
479
  Contributions welcome. Please open an issue first to discuss what you'd like to change.
455
480
 
456
481
  ## License
457
482
 
458
- [MIT](./LICENSE) Free for personal and commercial use.
483
+ [MIT](./LICENSE) -- Free for personal and commercial use.
459
484
 
460
485
  See [LICENSE-COMMERCIAL.md](./LICENSE-COMMERCIAL.md) for optional enterprise support and consulting.
486
+
487
+ ---
488
+
489
+ *2026 Wu Framework*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wu-framework",
3
- "version": "1.1.19",
3
+ "version": "1.2.0",
4
4
  "description": "Universal Microfrontends Framework - 13 frameworks, zero config, Shadow DOM isolation",
5
5
  "main": "dist/wu-framework.cjs.js",
6
6
  "module": "src/index.js",
@@ -4,10 +4,61 @@
4
4
  * Integrates Qwik components (component$) into Wu Framework's
5
5
  * microfrontend orchestration via @builder.io/qwik render API.
6
6
  *
7
- * Qwik uses QRL-based event delegation — onClick$, onInput$, etc.
8
- * are NOT regular DOM listeners. The qwikloader script must be
9
- * active in the document to intercept events and dispatch QRLs.
7
+ * Shadow DOM compatibility:
8
+ * Qwik uses QRL-based event delegation the qwikloader script
9
+ * attaches capture-phase listeners on `document` to intercept events
10
+ * and resolve QRL attributes (on:click, on:input, etc.) on elements.
11
+ *
12
+ * Inside Shadow DOM, event.target is retargeted to the shadow host,
13
+ * so qwikloader can't find QRL attributes on the actual elements.
14
+ * We fix this by wrapping qwikloader's document listeners with a
15
+ * Proxy that returns event.composedPath()[0] as the real target.
16
+ *
17
+ * See: https://github.com/QwikDev/qwik-evolution/issues/283
18
+ */
19
+
20
+ let _patched = false;
21
+
22
+ /**
23
+ * Patches document.addEventListener so capture-phase handlers (used by
24
+ * qwikloader) receive the real event target from inside Shadow DOM via
25
+ * composedPath()[0], instead of the retargeted shadow host.
26
+ *
27
+ * Only activates when there's actual Shadow DOM retargeting — events
28
+ * in the light DOM pass through with zero overhead (no Proxy created).
10
29
  */
30
+ function patchDocumentListenersForShadowDOM() {
31
+ if (_patched) return;
32
+ _patched = true;
33
+
34
+ const origAdd = document.addEventListener;
35
+
36
+ document.addEventListener = function (type, handler, options) {
37
+ const isCapture = options === true || (options && options.capture);
38
+
39
+ if (isCapture && typeof handler === 'function') {
40
+ const wrapped = function (event) {
41
+ const path = event.composedPath();
42
+ // Only proxy when Shadow DOM retargeting occurred
43
+ if (path.length && path[0] !== event.target && path[0] instanceof Element) {
44
+ const realTarget = path[0];
45
+ const proxy = new Proxy(event, {
46
+ get(obj, prop) {
47
+ if (prop === 'target') return realTarget;
48
+ const val = Reflect.get(obj, prop);
49
+ return typeof val === 'function' ? val.bind(obj) : val;
50
+ }
51
+ });
52
+ return handler.call(this, proxy);
53
+ }
54
+ return handler.call(this, event);
55
+ };
56
+ return origAdd.call(this, type, wrapped, options);
57
+ }
58
+
59
+ return origAdd.call(this, type, handler, options);
60
+ };
61
+ }
11
62
 
12
63
  export const wuQwik = {
13
64
  async register(appName, Component, options = {}) {
@@ -16,8 +67,15 @@ export const wuQwik = {
16
67
 
17
68
  const qwik = await import('@builder.io/qwik');
18
69
 
70
+ // Patch document listeners BEFORE injecting qwikloader so its
71
+ // capture-phase handlers are wrapped with Shadow DOM awareness.
72
+ // Must stay active permanently — qwikloader registers event types
73
+ // lazily as new on: attributes appear in the DOM.
74
+ patchDocumentListenersForShadowDOM();
75
+
19
76
  // Inject qwikloader once per document (event delegation for QRLs)
20
- if (!('__q_context__' in document)) {
77
+ if (!document.__wu_qwikloader) {
78
+ document.__wu_qwikloader = true;
21
79
  try {
22
80
  const { QWIK_LOADER } = await import('@builder.io/qwik/loader');
23
81
  const s = document.createElement('script');