Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1318 lines (1278 loc) · 77.6 KB
/
Copy pathindex.html
File metadata and controls
1318 lines (1278 loc) · 77.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>wcstack — What if the browser had these built in?</title>
<meta name="description" content="A thought experiment turned into code. 41 zero-dependency packages: reactive binding, declarative routing, 30+ Web APIs as HTML tags, and in-page devtools — no framework required.">
<meta property="og:title" content="wcstack — What if the browser had these built in?">
<meta property="og:description" content="A thought experiment turned into code. 41 zero-dependency packages: reactive binding, declarative routing, 30+ Web APIs as HTML tags, and in-page devtools — no framework required.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://wcstack.github.io">
<meta property="og:site_name" content="wcstack">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="wcstack — What if the browser had these built in?">
<meta name="twitter:description" content="A thought experiment turned into code. 41 zero-dependency packages: reactive binding, declarative routing, 30+ Web APIs as HTML tags, and in-page devtools — no framework required.">
<meta name="keywords" content="wcstack, Web Components, Custom Elements, Shadow DOM, reactive state, data binding, SPA router, declarative HTML, zero dependency, buildless, Web API">
<link rel="canonical" href="https://wcstack.github.io/">
<link rel="sitemap" type="application/xml" href="https://wcstack.github.io/sitemap.xml">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebSite",
"@id": "https://wcstack.github.io/#website",
"url": "https://wcstack.github.io/",
"name": "wcstack",
"description": "Standards-first, zero-dependency Web Components packages: reactive binding, declarative routing, and 30+ Web APIs as HTML tags.",
"inLanguage": "en"
},
{
"@type": "SoftwareApplication",
"name": "wcstack",
"alternateName": "Web Components Stack",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any (modern web browser)",
"description": "A monorepo of 41 zero-dependency Web Components packages — reactive state binding, declarative SPA routing, and 30+ Web APIs exposed as plain HTML custom elements. Standards-first, buildless, no framework required.",
"url": "https://wcstack.github.io/",
"codeRepository": "https://github.com/wcstack/wcstack",
"license": "https://github.com/wcstack/wcstack/blob/main/LICENSE",
"author": { "@type": "Person", "name": "mogera551" },
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }
}
]
}
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
--bg: #060a10;
--bg-card: #0c121a;
--bg-code: #080d14;
--border: #182230;
--border-subtle: #101823;
--text: #d3d9e0;
--text-bright: #f7fafc;
--text-dim: #6f7d8e;
--accent: #38bdf8;
--accent-glow: rgba(56, 189, 248, .12);
--accent-hover: #6dd2fc;
--c-cyan: #38bdf8;
--c-violet: #a78bfa;
--c-green: #5bb98c;
--c-salmon: #d48872;
--c-gold: #d4a017;
--font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
--mono: 'JetBrains Mono', 'Fira Code', monospace;
}
html { scroll-behavior: smooth; }
body {
font-family: var(--font);
background: var(--bg);
color: var(--text);
line-height: 1.7;
-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }
code, pre { font-family: var(--mono); }
/* ── Layout ── */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
section { padding: 100px 0; }
/* ── Header ── */
header {
position: fixed; top: 0; left: 0; right: 0; z-index: 100;
background: rgba(6, 10, 16, .9);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border-subtle);
}
header .container {
display: flex; align-items: center; justify-content: space-between;
height: 56px;
}
.logo {
font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em;
color: var(--text-dim);
}
.logo span { color: var(--accent); }
nav { display: flex; gap: 22px; }
nav a {
font-size: .8rem; font-weight: 500;
color: var(--text-dim); transition: color .2s;
letter-spacing: .02em;
}
nav a:hover { color: var(--text); }
/* ── Hero ── */
.hero {
padding-top: 180px; padding-bottom: 110px;
text-align: center;
background:
radial-gradient(ellipse 60% 40% at 50% 0%, var(--accent-glow), transparent 70%);
}
.hero h1 {
font-size: clamp(2.2rem, 5.5vw, 3.5rem);
font-weight: 700; letter-spacing: -.03em;
line-height: 1.2;
color: var(--text-bright);
}
.hero h1 em {
font-style: normal;
color: var(--accent);
}
.hero .subtitle {
margin-top: 28px;
font-size: clamp(1rem, 2vw, 1.15rem);
color: var(--text-dim);
max-width: 660px; margin-left: auto; margin-right: auto;
line-height: 1.8;
}
.hero .subtitle-ja {
margin-top: 12px;
font-size: .88rem;
color: var(--text-dim);
opacity: .5;
}
.release-pill {
display: inline-flex; align-items: center; gap: 8px;
padding: 5px 14px; border-radius: 999px;
border: 1px solid var(--border);
background: var(--bg-card);
font-family: var(--mono);
font-size: .74rem; font-weight: 500;
color: var(--text-dim);
margin-bottom: 28px;
transition: border-color .2s, color .2s;
}
.release-pill:hover { border-color: rgba(56,189,248,.35); color: var(--text); }
.release-pill .dot {
width: 6px; height: 6px; border-radius: 50%;
background: var(--c-green);
box-shadow: 0 0 8px rgba(91,185,140,.7);
}
.hero .stats {
display: flex; gap: 0; justify-content: center;
margin-top: 44px; flex-wrap: wrap;
}
.stat {
padding: 0 32px;
border-left: 1px solid var(--border);
}
.stat:first-child { border-left: none; }
.stat .num {
font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em;
color: var(--accent);
line-height: 1.3;
}
.stat .label {
font-size: .72rem; font-weight: 500;
color: var(--text-dim);
letter-spacing: .06em; text-transform: uppercase;
}
.hero .cta-group {
display: flex; gap: 16px; justify-content: center;
margin-top: 44px; flex-wrap: wrap;
}
.btn {
display: inline-flex; align-items: center; gap: 8px;
padding: 10px 24px; border-radius: 6px;
font-size: .88rem; font-weight: 600;
transition: all .2s;
cursor: pointer; border: none;
font-family: var(--font);
}
.btn-primary {
background: var(--accent); color: var(--bg);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--bg); }
.btn-secondary {
background: transparent; color: var(--text-dim);
border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-dim); color: var(--text); }
/* ── Section shared ── */
.section-label {
font-size: .7rem; font-weight: 600; text-transform: uppercase;
letter-spacing: .15em; color: var(--accent); margin-bottom: 16px;
}
.section-title {
font-size: clamp(1.5rem, 3.5vw, 2rem);
font-weight: 700; letter-spacing: -.02em;
color: var(--text-bright);
}
.section-sub {
color: var(--text-dim); margin-top: 8px; font-size: .9rem;
}
.section-sub-ja {
color: var(--text-dim); margin-top: 4px; font-size: .82rem;
opacity: .5;
}
/* ── Topics (What's New) ── */
.topics { border-top: 1px solid var(--border-subtle); }
.topics-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px; margin-top: 48px;
}
.topic-card {
position: relative;
padding: 28px 24px;
border-radius: 10px;
border: 1px solid var(--border);
background: var(--bg-card);
transition: border-color .3s;
}
.topic-card:hover { border-color: rgba(56, 189, 248, .35); }
.topic-ver {
position: absolute; top: 20px; right: 20px;
font-family: var(--mono);
font-size: .68rem; font-weight: 500;
padding: 2px 8px; border-radius: 999px;
border: 1px solid var(--border);
color: var(--text-dim);
background: var(--bg-code);
}
.topic-card .tag-name { padding-right: 64px; }
/* ── Insight ── */
.insight { border-top: 1px solid var(--border-subtle); }
.insight-body {
margin-top: 32px;
font-size: .95rem;
color: var(--text);
line-height: 1.9;
max-width: 760px;
}
.insight-body strong { color: var(--text-bright); }
.insight-body code {
font-size: .82em;
background: var(--bg-code);
border: 1px solid var(--border-subtle);
border-radius: 4px;
padding: 2px 6px;
color: var(--accent);
}
.insight-ja {
margin-top: 14px;
font-size: .84rem;
color: var(--text-dim);
opacity: .55;
line-height: 1.8;
max-width: 760px;
}
.insight-diagram {
margin-top: 36px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--bg-code);
padding: 28px 32px;
overflow-x: auto;
}
.insight-diagram pre {
padding: 0; background: none;
font-size: .85rem; line-height: 2.1;
overflow: visible;
}
.insight-diagram .layer { color: var(--text-bright); font-weight: 500; }
.insight-diagram .path { color: var(--accent); }
.insight-diagram .note { color: var(--text-dim); }
/* ── Core packages ── */
.core-section { border-top: 1px solid var(--border-subtle); }
.tag-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
gap: 20px; margin-top: 48px;
}
.tag-card {
padding: 28px 24px;
border-radius: 10px;
border: 1px solid var(--border);
background: var(--bg-card);
transition: border-color .3s;
}
.tag-card:hover {
border-color: rgba(56, 189, 248, .35);
}
.tag-name {
font-family: var(--mono);
font-size: .82rem; font-weight: 500;
color: var(--accent);
margin-bottom: 12px;
display: block;
}
.tag-card h3, .topic-card h3 {
font-size: 1.05rem; font-weight: 600;
color: var(--text-bright);
margin-bottom: 8px;
}
.tag-card .what-if, .topic-card .what-if {
font-size: .85rem;
color: var(--text-dim);
font-style: italic;
margin-bottom: 10px;
}
.tag-card p, .topic-card p {
font-size: .85rem; color: var(--text-dim); line-height: 1.6;
}
.tag-card .ja, .topic-card .ja {
font-size: .78rem; color: var(--text-dim); opacity: .5;
margin-top: 6px;
}
.card-link {
display: inline-block;
margin-top: 16px;
font-size: .78rem; font-weight: 600;
letter-spacing: .02em;
}
.tag-features {
list-style: none; margin-top: 14px;
display: flex; flex-wrap: wrap; gap: 6px;
}
.tag-features li {
font-size: .7rem; font-weight: 500;
padding: 3px 8px; border-radius: 4px;
border: 1px solid var(--border);
color: var(--text-dim);
}
/* ── Web API nodes ── */
.io-section { border-top: 1px solid var(--border-subtle); }
.io-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
gap: 10px; margin-top: 44px;
}
.io-node {
padding: 14px 16px;
border-radius: 8px;
border: 1px solid var(--border-subtle);
background: var(--bg-card);
transition: border-color .25s;
}
.io-node:hover { border-color: rgba(56, 189, 248, .35); }
.io-node .io-tag {
font-family: var(--mono);
font-size: .74rem; font-weight: 500;
color: var(--accent);
display: block;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.io-node .io-desc {
font-size: .72rem; color: var(--text-dim);
margin-top: 3px; line-height: 1.5;
display: block;
}
.protocol-note {
margin-top: 36px;
border: 1px solid var(--border);
border-left: 3px solid var(--accent);
border-radius: 8px;
background: var(--bg-card);
padding: 22px 26px;
}
.protocol-note h3 {
font-size: .92rem; font-weight: 600; color: var(--text-bright);
margin-bottom: 8px;
}
.protocol-note h3 code {
font-size: .85em; color: var(--accent);
background: var(--bg-code); border: 1px solid var(--border-subtle);
border-radius: 4px; padding: 2px 6px;
}
.protocol-note p {
font-size: .84rem; color: var(--text-dim); line-height: 1.7;
}
.protocol-note .ja {
font-size: .78rem; opacity: .5; margin-top: 6px;
}
/* ── Code Examples ── */
.code-section { border-top: 1px solid var(--border-subtle); }
.code-tabs {
display: flex; gap: 0; margin-top: 40px;
border-bottom: 1px solid var(--border);
overflow-x: auto;
}
.code-tab {
padding: 10px 20px; cursor: pointer;
font-size: .8rem; font-weight: 500;
color: var(--text-dim); background: none; border: none;
border-bottom: 2px solid transparent;
transition: all .2s;
font-family: var(--font);
letter-spacing: .02em;
white-space: nowrap;
}
.code-tab:hover { color: var(--text); }
.code-tab.active {
color: var(--accent);
border-bottom-color: var(--accent);
}
.code-panels { position: relative; }
.code-panel {
display: none;
border: 1px solid var(--border);
border-top: none;
border-radius: 0 0 10px 10px;
overflow: hidden;
}
.code-panel.active { display: block; }
.code-header {
display: flex; align-items: center; justify-content: space-between;
padding: 10px 20px;
background: rgba(12, 18, 26, .8);
border-bottom: 1px solid var(--border);
font-size: .75rem; color: var(--text-dim);
}
.code-header .filename { font-family: var(--mono); font-weight: 500; }
pre {
padding: 20px 24px;
background: var(--bg-code);
overflow-x: auto;
font-size: .82rem;
line-height: 1.7;
tab-size: 2;
}
/* Syntax highlight */
code[class*="language-"], pre[class*="language-"] { color: var(--text); text-shadow: none; background: none; }
pre > code[class*="language-"] { padding: 0; }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #45566b; font-style: italic; }
.token.punctuation { color: #566b84; }
.token.tag { color: #38bdf8; }
.token.attr-name { color: #a78bfa; }
.token.attr-value { color: #5bb98c; }
.token.string { color: #5bb98c; }
.token.keyword { color: #d48872; }
.token.function { color: #d4a017; }
.token.number, .token.boolean { color: #d48872; }
.token.operator { color: #566b84; }
.token.property { color: #d3d9e0; }
/* ── Rules ── */
.rules { border-top: 1px solid var(--border-subtle); }
.rules-list {
margin-top: 48px;
display: flex; flex-direction: column;
gap: 1px;
background: var(--border-subtle);
border-radius: 10px;
overflow: hidden;
}
.rule {
display: grid;
grid-template-columns: 48px 1fr;
gap: 20px;
padding: 24px 28px;
background: var(--bg-card);
align-items: start;
}
.rule-num {
width: 36px; height: 36px;
display: flex; align-items: center; justify-content: center;
border-radius: 8px;
font-size: .85rem; font-weight: 700;
flex-shrink: 0;
}
.rule h3 {
font-size: 1rem; font-weight: 600;
color: var(--text-bright);
margin-bottom: 4px;
}
.rule p {
font-size: .85rem; color: var(--text-dim); line-height: 1.6;
}
.rule .ja {
font-size: .78rem; color: var(--text-dim); opacity: .5;
margin-top: 2px;
}
.rules-epilogue {
margin-top: 40px;
font-size: .92rem;
color: var(--text-dim);
line-height: 1.8;
max-width: 720px;
}
.rules-epilogue-ja {
margin-top: 12px;
font-size: .82rem;
color: var(--text-dim);
opacity: .5;
line-height: 1.7;
}
/* ── Quick Start ── */
.quickstart { border-top: 1px solid var(--border-subtle); }
.cdn-block {
margin-top: 40px;
border: 1px solid var(--border);
border-radius: 10px;
overflow: hidden;
}
.cdn-note {
margin-top: 16px;
font-size: .85rem;
color: var(--text-dim);
}
.cdn-note-ja {
font-size: .78rem;
color: var(--text-dim);
opacity: .5;
margin-top: 4px;
}
.tooling-note {
margin-top: 32px;
display: flex; gap: 14px; align-items: flex-start;
border: 1px solid var(--border);
border-radius: 8px;
background: var(--bg-card);
padding: 18px 22px;
}
.tooling-note svg { flex-shrink: 0; margin-top: 3px; color: var(--accent); }
.tooling-note p { font-size: .84rem; color: var(--text-dim); line-height: 1.7; }
.tooling-note .ja { font-size: .78rem; opacity: .5; margin-top: 4px; }
/* ── Footer ── */
footer {
border-top: 1px solid var(--border-subtle);
padding: 40px 0;
text-align: center;
}
footer p { font-size: .8rem; color: var(--text-dim); }
.footer-links {
display: flex; gap: 24px; justify-content: center;
margin-bottom: 16px; flex-wrap: wrap;
}
.footer-links a {
font-size: .8rem; font-weight: 500;
color: var(--text-dim);
}
.footer-links a:hover { color: var(--text); }
/* ── Animations ── */
.fade-in {
opacity: 0; transform: translateY(16px);
transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible {
opacity: 1; transform: translateY(0);
}
/* ── Responsive ── */
@media (max-width: 768px) {
section { padding: 72px 0; }
.hero { padding-top: 140px; padding-bottom: 80px; }
nav { gap: 14px; }
nav a { font-size: .74rem; }
.stat { padding: 0 18px; }
.stat .num { font-size: 1.4rem; }
.rule { grid-template-columns: 40px 1fr; padding: 20px; gap: 14px; }
.code-tab { padding: 8px 12px; font-size: .75rem; }
pre { font-size: .76rem; padding: 16px; }
}
@media (max-width: 560px) {
nav { display: none; }
.hero h1 { font-size: 1.8rem; }
.stats { row-gap: 16px; }
.stat { border-left: none; padding: 0 14px; }
.rule { grid-template-columns: 1fr; }
.rule-num { margin-bottom: 4px; }
}
</style>
</head>
<body>
<!-- Header -->
<header>
<div class="container">
<div class="logo"><<span>wc</span>stack /></div>
<nav>
<a href="#topics">What's New</a>
<a href="#insight">Insight</a>
<a href="#core">Core</a>
<a href="#webapis">Web APIs</a>
<a href="#examples">Examples</a>
<a href="#rules">Rules</a>
<a href="#quickstart">Quick Start</a>
<a href="tutorial/">Tutorial</a>
<a href="https://github.com/wcstack/wcstack" target="_blank" rel="noopener">GitHub</a>
</nav>
</div>
</header>
<!-- Hero -->
<section class="hero">
<div class="container">
<a class="release-pill" href="https://github.com/wcstack/wcstack/releases" target="_blank" rel="noopener"><span class="dot"></span>Latest release: v4.1.1</a>
<h1>What if the browser<br>had <em>these</em> built in?</h1>
<p class="subtitle">wcstack is a thought experiment turned into code. We imagine what future web standards <em>could</em> look like — reactive data binding, declarative routing, and thirty-plus Web APIs as plain HTML tags — and build them as if they already existed in the browser.</p>
<p class="subtitle-ja">未来のWeb標準を想像し、それがすでにブラウザに存在するかのようにコードにする思考実験。30以上のWeb APIをHTMLタグに。</p>
<div class="stats">
<div class="stat">
<div class="num">47</div>
<div class="label">Packages</div>
</div>
<div class="stat">
<div class="num">30+</div>
<div class="label">Web API Tags</div>
</div>
<div class="stat">
<div class="num">0</div>
<div class="label">Dependencies</div>
</div>
<div class="stat">
<div class="num">1</div>
<div class="label">Script Tag Each</div>
</div>
</div>
<div class="cta-group">
<a class="btn btn-primary" href="#quickstart">Get Started</a>
<a class="btn btn-secondary" href="tutorial/">Tutorial</a>
<a class="btn btn-secondary" href="https://github.com/wcstack/wcstack" target="_blank" rel="noopener">
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>
View on GitHub
</a>
</div>
</div>
</section>
<!-- What's New / Topics -->
<section class="topics" id="topics">
<div class="container">
<p class="section-label">What's New</p>
<h2 class="section-title">Shipped in v4.0.0 → v4.1.1</h2>
<p class="section-sub">4.0 replaces the engine inside <code>@wcstack/state</code> — a smaller core and faster updates behind the same markup: <code>auto.min.js</code> goes from 88.0 to 47.7 KB gzip, and the CPU-weighted geometric mean on the official js-framework-benchmark is <strong>1.07</strong>, against 1.44 for 3.5.4. Most of what breaks is what 3.5 announced, and there is <strong>no compatibility layer</strong>: upgrade to 3.5, clear its warnings, then move every <code>@wcstack/*</code> package to 4.0 at once — <code>@wcstack/server</code> together with the client — following the <a href="state/#v4-migration">migration table</a> and the <a href="https://github.com/wcstack/wcstack/blob/main/docs/migration-v4.md" target="_blank" rel="noopener">3.x → 4.0 migration guide</a>. The VS Code extension ships the 4.0 rules as 2.0.0; keep 1.21.x, <code>@wcstack/lint</code> 3.5 and <code>@wcstack/typescript</code> 3.5 for 3.x projects. <strong>v4.0.1</strong> comes from writing the <a href="tutorial/">tutorial</a>: a <code>class:</code> or <code>attr:</code> without a name is refused by name (<code>#122</code>), and the lint stops reporting the fields of a list a getter returns and reports an unknown filter as an error. <strong>v4.0.2</strong> comes from <a href="tutorial/#part2">Part 2</a>: the lint learns the shape of data loaded from outside from a JSDoc type, and reports a <code><wcs-storage></code> binding that would not save (<code>wcs/input-nested-write</code>, <code>wcs/storage-init-seed</code>). <strong>v4.0.3</strong> comes from <a href="tutorial/#part3">Part 3</a>: the lint also catches a storage binding that forgets <code>#init=element</code> and a <code><wcs-fetch></code> body sent only once, and checks pinned URLs. <strong>v4.0.4</strong>, also from Part 3: a <code><wcs-outlet></code> placed away from its <code><wcs-router></code> stayed empty without a word — the router now warns about it, and so does the lint. <strong>v4.1.0</strong> comes from four <em>seam apps</em> — apps written from the documents alone to find what tests miss: route guards that redirect without trapping Back, a confirmation before leaving unsaved changes (<code>leaveConfirm</code>), <code><wcs-network offline></code>, view transitions only for list and branch changes, and keyed signals rows that see their current item. <strong>v4.1.1</strong> puts those apps in the repository's examples, each with a real-browser test, and fixes what that found: the lint now knows <code><wcs-network offline></code>. The numbers are in <a href="state/#performance">Performance</a>, the rest in the version notes of the <a href="state/">state page</a>.</p>
<p class="section-sub-ja">4.0は<code>@wcstack/state</code>の中のエンジンを置き換える — 同じマークアップの裏で、より小さなコアとより速い更新を。<code>auto.min.js</code>は88.0から47.7 KB gzipへ、公式のjs-framework-benchmarkでのCPUの重み付き幾何平均は<strong>1.07</strong>(3.5.4は1.44)だ。変わるものの大半は3.5が予告したもので、<strong>互換層は無い</strong>: 3.5に上げ、その警告を消し、それから<code>@wcstack/*</code>のパッケージをすべて一度に4.0へ移す — <code>@wcstack/server</code>もクライアントと一緒に — 手順は<a href="state/#v4-migration">移行表</a>と<a href="https://github.com/wcstack/wcstack/blob/main/docs/migration-v4.md" target="_blank" rel="noopener">3.x → 4.0移行ガイド</a>にある。VS Code拡張は4.0の規則を2.0.0として出す。3.xのプロジェクトでは1.21.x、<code>@wcstack/lint</code> 3.5、<code>@wcstack/typescript</code> 3.5を使い続けること。<strong>v4.0.1</strong>は<a href="tutorial/">チュートリアル</a>を書く中で見つかったものを直す: 名前の無い<code>class:</code>や<code>attr:</code>は名指しで拒まれ(<code>#122</code>)、lintはgetterが返すリストのフィールドを報告しなくなり、未知のフィルタをerrorとして報告する。<strong>v4.0.2</strong>は<a href="tutorial/#part2">Part 2</a>から: lintは外から読むデータの形をJSDocの型で知り、保存されない<code><wcs-storage></code>のバインディングを報告する(<code>wcs/input-nested-write</code>・<code>wcs/storage-init-seed</code>)。<strong>v4.0.3</strong>は<a href="tutorial/#part3">Part 3</a>から: lintは<code>#init=element</code>を忘れたstorageのバインディングと、1回しか送られない<code><wcs-fetch></code>の本文も見つけ、固定したURLも検査する。<strong>v4.0.4</strong>もPart 3から: <code><wcs-router></code>から離れた<code><wcs-outlet></code>は何も言わずに空のままだった — いまはrouterが警告し、lintも報告する。<strong>v4.1.0</strong>は、テストが見逃すものを見つけるために文書だけから書いた4本の<em>継ぎ目アプリ</em>から: 「戻る」を閉じ込めないガードのリダイレクト、未保存の変更を残して出る前の確認(<code>leaveConfirm</code>)、<code><wcs-network offline></code>、一覧と分岐の変化だけのビュー遷移、今のitemを見るsignalsのkey付きの行。<strong>v4.1.1</strong>はそのアプリを実ブラウザのテスト付きでリポジトリのexamplesに置き、そこで見つかったものを直す: lintが<code><wcs-network offline></code>を知るようになった。数値は<a href="state/#performance">Performance</a>に、残りは<a href="state/">stateのページ</a>の版ごとの注記にある。</p>
<div class="topics-grid fade-in">
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name"><wcs-state></span>
<h3>A new engine behind the same markup</h3>
<p class="what-if">What if the engine were rewritten from scratch — and no page had to change a tag?</p>
<p>4.0 keeps everything you write against and replaces what runs it. Built with esbuild and terser, <code>auto.min.js</code> is <strong>47.7 KB</strong> gzip (88.0 in 3.5.4); on the official js-framework-benchmark the CPU-weighted geometric mean is <strong>1.07</strong> against 1.44, with about a third of the JavaScript time and 1,000 rows in 2.97 MB instead of 6.35. A list whose items repeat no longer goes quadratic — a 90,000-cell board from <strong>4.6 s to 6 ms</strong> — and the new engine closes issues open against 3.x.</p>
<p class="ja">4.0は、書く側が向き合うものをすべて残し、それを動かすものを取り替える。esbuildとterserでビルドし、<code>auto.min.js</code>は<strong>47.7 KB</strong> gzip(3.5.4では88.0)、公式のjs-framework-benchmarkでのCPUの重み付き幾何平均は<strong>1.07</strong>(3.5.4は1.44)で、JavaScriptの時間は約3分の1、1,000行のメモリは6.35 MBから2.97 MBになった。要素が繰り返すリストはもう二乗にならず — 9万セルの盤面は<strong>4.6 sから6 ms</strong> — 新しいエンジンは3.xに対して開いていたissueも閉じる。</p>
<ul class="tag-features">
<li>Same Markup, New Engine</li>
<li>auto.min.js 47.7 KB (−46 %)</li>
<li>CPU 1.07 vs 1.44</li>
<li>90,000 Cells: 4.6 s → 6 ms</li>
</ul>
<a class="card-link" href="state/#performance">Learn more →</a>
</div>
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name">$behavior: { enableMustache: false }</span>
<h3>What 3.5 announced, done</h3>
<p class="what-if">What if every warning of the last minor turned into exactly one error, named where you wrote it?</p>
<p>4.0 removes what 3.5 named with <code>[wcs/v4-migration]</code>: <code>$scan</code>, the names 3.2 renamed, the <code>substr</code> filter and three <code>bootstrapState()</code> options. A removed filter name fails with <code>[wcs/filter-unknown]</code> naming its replacement. <code>enableMustache</code>, <code>sameValueGuard</code> and <code>enableDirectionalInitialSync</code> move to the <code>$behavior</code> of <strong>each root state</strong>, <strong>every package’s <code>bootstrapXxx(config)</code> throws on an option it does not have</strong>, and failures are reported once (<code>#49</code>, <code>#50</code>).</p>
<p class="ja">4.0は3.5が<code>[wcs/v4-migration]</code>で名指ししたもの — <code>$scan</code>、3.2が改名した旧名、<code>substr</code>フィルタ、<code>bootstrapState()</code>の3つのオプション — を取り除く。取り除かれたフィルタ名は、置き換え先を名指しする<code>[wcs/filter-unknown]</code>で失敗する。<code>enableMustache</code>・<code>sameValueGuard</code>・<code>enableDirectionalInitialSync</code>は<strong>各ルートのstate</strong>の<code>$behavior</code>へ移り、<strong>各パッケージの<code>bootstrapXxx(config)</code>は、持っていないオプションでthrowする</strong>。失敗は一度だけ報告される(<code>#49</code>、<code>#50</code>)。</p>
<ul class="tag-features">
<li>$scan and the 3.2 Names Removed</li>
<li>$behavior per Root State</li>
<li>Every bootstrapXxx() Throws</li>
<li>Failures Reported Once</li>
</ul>
<a class="card-link" href="state/#v4-migration">Learn more →</a>
</div>
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name">onclick#direct,stop: save</span>
<h3>One listener per event type</h3>
<p class="what-if">What if a thousand rows of buttons needed one click listener, not a thousand?</p>
<p><code>on*:</code> bindings of eleven common event types — <code>click</code>, <code>input</code>, <code>change</code>, <code>submit</code>, <code>keydown</code>, … — are <strong>delegated</strong>: one listener per type sits on the root the state binds and runs the handlers of the elements the event passed, innermost first. <code>event.currentTarget</code> is that root, so find the element with <code>event.target.closest(…)</code> or use the loop index, and an ancestor that calls <code>stopPropagation()</code> keeps the handlers inside it from running. <code>on*#direct:</code> keeps the 3.x listener on the element for one binding.</p>
<p class="ja">よく使う11種類のイベント — <code>click</code>・<code>input</code>・<code>change</code>・<code>submit</code>・<code>keydown</code>など — の<code>on*:</code>バインディングは<strong>委譲</strong>される: 種類ごとに1つのリスナーがstateのバインドするルートに置かれ、イベントが通った要素のハンドラを内側から順に走らせる。<code>event.currentTarget</code>はそのルートなので、要素は<code>event.target.closest(…)</code>で探すかループのインデックスを使う。<code>stopPropagation()</code>を呼ぶ祖先は、その内側のハンドラを走らせない。<code>on*#direct:</code>はバインディング1つについて、3.xと同じく要素にリスナーを付ける。</p>
<ul class="tag-features">
<li>11 Event Types Delegated</li>
<li>currentTarget Is the Root</li>
<li>#direct Opts One Binding Out</li>
<li>Two-Way Stays on the Element</li>
</ul>
<a class="card-link" href="state/#events">Learn more →</a>
</div>
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name">this["items.0"] = item</span>
<h3>A row stays where it is</h3>
<p class="what-if">What if writing a list element changed what that row shows — and nothing moved?</p>
<p>Writing a list element (<code>this["items.0"] = …</code>) <strong>replaces the value at that position</strong>: the row stays where it is, with its focus and other DOM state, and everything derived below it is computed again. To move rows, assign a new array — rows follow their objects by identity. <code>for:</code> takes no filters (<code>#121</code>): loop over a getter that returns the list, and writes through its rows reach the source (#365). A numeric segment is an index only under an array: <code>usersById.42.name</code> is a key (#382).</p>
<p class="ja">リストの要素への書き込み(<code>this["items.0"] = …</code>)は<strong>その位置の値を置き換える</strong>: 行はその場にとどまり、フォーカスなどのDOMの状態もそのままで、その下で導かれるものは計算し直される。行を動かすには新しい配列を代入する — 行は同一性でオブジェクトについていく。<code>for:</code>はフィルタを取らない(<code>#121</code>): リストを返すgetterの上で回せば、その行を通した書き込みは元のリストに届く(#365)。数値の区間が添字になるのは配列の下だけで、<code>usersById.42.name</code>はキーだ(#382)。</p>
<ul class="tag-features">
<li>Element Writes Replace in Place</li>
<li>Reorder by a New Array</li>
<li>for: Over a Getter, Not a Filter</li>
<li>Writes Reach Filtered Copies</li>
</ul>
<a class="card-link" href="state/#directives">Learn more →</a>
</div>
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name">"items.*.price"(cur, prev, i)</span>
<h3>Watches that need no for:</h3>
<p class="what-if">What if a row watch fired for every row that changed — rendered or not?</p>
<p>A row watch is headless now: <code>$watch: { "items.*.price"(cur, prev, i) { … } }</code> fires for a list the page does not render, where 3.x fired it zero times. A watch on a row getter is evaluated eagerly for every row, with a real <code>prev</code>, so keep it cheap. Assigning a whole array fires only the rows that came in (#389), and a <code>$watch</code> → <code>$stream</code> loop stops after about <strong>16 laps</strong> instead of freezing the page.</p>
<p class="ja">行のwatchはいまヘッドレスだ: <code>$watch: { "items.*.price"(cur, prev, i) { … } }</code>は、ページが描いていないリストでも発火する(3.xでは一度も発火しなかった)。行getterへのwatchは全行について先行して評価され、<code>prev</code>も本当の前の値になるので、軽く保つこと。配列全体の代入が発火させるのは新しく入った行だけで(#389)、<code>$watch</code> → <code>$stream</code>のループはページを止めずに約<strong>16周</strong>で打ち切られる。</p>
<ul class="tag-features">
<li>Row Watches Without for:</li>
<li>Row Getters Eager, prev Real</li>
<li>Whole Arrays Fire New Rows</li>
<li>Stream Loops Cut at ~16 Laps</li>
</ul>
<a class="card-link" href="state/#watch">Learn more →</a>
</div>
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name">onclick: cart.checkout</span>
<h3>Volumes hold data, components run their own</h3>
<p class="what-if">What if a module held only its data — and a component ran everything it declares?</p>
<p>A volume (<code><wcs-state mount="cart"></code>) holds data, getters, setters and methods, and its methods are reachable by path — <code>onclick: cart.checkout</code>. One that declares <code>$watch</code>, <code>$listKeys</code>, <code>$renderedCallback</code>, <code>$behavior</code> or <code>$features</code>, or carries a <code>data-wcs</code>, is not grafted: declare those on the root with full paths. A mounted component goes the other way: it runs its own <code>$listKeys</code>, tokens, <code>$on</code> and <code>$errorCallback</code>, and a host inserted by code is wired when its <code><wcs-state bind-component></code> connects.</p>
<p class="ja">ボリューム(<code><wcs-state mount="cart"></code>)が持つのはデータ・getter・setter・メソッドで、メソッドはパスで届く — <code>onclick: cart.checkout</code>。<code>$watch</code>・<code>$listKeys</code>・<code>$renderedCallback</code>・<code>$behavior</code>・<code>$features</code>を宣言したボリュームや、<code>data-wcs</code>を持つボリュームは接ぎ木されない: それらはルートに完全なパスで書く。マウントされたコンポーネントは逆へ向かう: 自分の<code>$listKeys</code>・トークン・<code>$on</code>・<code>$errorCallback</code>を動かし、コードが差し込んだホストは、その<code><wcs-state bind-component></code>が接続したときに配線される。</p>
<ul class="tag-features">
<li>Volumes: Data, Getters, Methods</li>
<li>Volume Methods by Path</li>
<li>Components Run Their Own Tokens</li>
<li>Unbound Hosts Wired on Connect</li>
</ul>
<a class="card-link" href="state/#v4-volumes">Learn more →</a>
</div>
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name"><wcs-ssr version="4.0.0"></span>
<h3>Server and client move together</h3>
<p class="what-if">What if a server-rendered page hydrated every row it drew — nested ones too?</p>
<p>4.0 writes a new server output — rows, branches and text bindings marked with comments, no <code>data-wcs-ssr-id</code> or props table — and the client <strong>adopts the server’s rows and branches where they are, nested ones included</strong>. The output is <strong>not compatible across 3.x and 4.0</strong>: a 4.0 client discards a 3.x snapshot with one warning and renders on the client, and a 4.0 server with a 3.x client is not supported. Deploy <code>@wcstack/server</code> 4.0 with the 4.0 client, purge HTML cached from 3.x, and keep the comments (<code>removeComments</code> breaks hydration).</p>
<p class="ja">4.0は新しいサーバー出力を書く — 行・枝・テキストバインディングはコメントで印が付き、<code>data-wcs-ssr-id</code>もプロパティの表も無い — そしてクライアントは<strong>サーバーの行と枝を、入れ子のものも含めて、その場で引き取る</strong>。出力は<strong>3.xと4.0の間で互換が無い</strong>: 4.0のクライアントは3.xのスナップショットを警告1つとともに捨ててクライアントで描き、4.0のサーバーと3.xのクライアントの組み合わせはサポートされない。<code>@wcstack/server</code> 4.0を4.0のクライアントと一緒にデプロイし、3.xでキャッシュしたHTMLを捨て、コメントは残すこと(<code>removeComments</code>はハイドレーションを壊す)。</p>
<ul class="tag-features">
<li>Nested Rows Hydrate</li>
<li>No Props Table</li>
<li>Form Values in the Markup</li>
<li>3.x Snapshots Rendered Again</li>
</ul>
<a class="card-link" href="state/#ssr-svg">Learn more →</a>
</div>
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name">command.showModal: $command.edit</span>
<h3>Native elements take commands</h3>
<p class="what-if">What if a state opened a dialog the way it starts a fetch — by emitting a token?</p>
<p>With the <code>native-commands</code> feature, which <code>@wcstack/state</code> and <code>/auto</code> include, <code>command.<method>:</code> subscribes a native element’s method from a fixed table — <code>showModal</code> / <code>close</code> on <code><dialog></code>, <code>focus</code>, <code>requestSubmit</code>, <code>play</code> / <code>pause</code>, … — so the state opens a dialog without ever holding the element; 3.x refused native elements. The split build gains <strong>one-tag loading</strong>: <code>dist/split/auto.js</code> loads the core and the features the page names in <code>features="…"</code> on the root and <code>$features</code> in each state.</p>
<p class="ja"><code>@wcstack/state</code>と<code>/auto</code>が載せている<code>native-commands</code>機能があれば、<code>command.<method>:</code>は決まった表にあるネイティブ要素のメソッドを購読する — <code><dialog></code>の<code>showModal</code> / <code>close</code>、<code>focus</code>、<code>requestSubmit</code>、<code>play</code> / <code>pause</code>など — だからstateは要素を一度も持たずにダイアログを開く。3.xはネイティブ要素を拒んでいた。分割形のビルドは<strong>タグ1つでの読み込み</strong>を得る: <code>dist/split/auto.js</code>が、コアと、ルートの<code>features="…"</code>や各stateの<code>$features</code>で名指しした機能を読み込む。</p>
<ul class="tag-features">
<li>command.showModal: on a Dialog</li>
<li>A Fixed Table, Event Args Dropped</li>
<li>Split Build From One Tag</li>
<li>$features per State</li>
</ul>
<a class="card-link" href="state/#native-commands">Learn more →</a>
</div>
<div class="topic-card">
<span class="topic-ver">v4.0.0</span>
<span class="tag-name"><wcs-wakelock data-wcs="active: awake"></span>
<h3>An input is a property</h3>
<p class="what-if">What if a <code>false</code> written to a tag stayed false — as the element understands it?</p>
<p>State writes a custom element’s wc-bindable input to its <strong>property only</strong>; reflecting it to the attribute is the element’s job in its setter. 3.x’s copy turned a <code>false</code> into <code>"false"</code>, which switched on <code><wcs-wakelock active></code> and every <code>manual</code> — an element of your own that relied on state writing its attribute needs a setter that reflects it. The I/O nodes handle <code>null</code> (removes the attribute) and <code>undefined</code> (restores the initial one) instead of opening <code>"undefined"</code>, and the router, <code><wcs-defined></code>, <code><wcs-throttle></code>, <code><wcs-wakelock></code>, <code><wcs-ws></code> and DevTools bring fixes.</p>
<p class="ja">stateはカスタム要素のwc-bindableの入力を<strong>プロパティにだけ</strong>書く。属性への反映はsetterの中で要素がすることだ。3.xの写しは<code>false</code>を<code>"false"</code>にして、<code><wcs-wakelock active></code>やすべての<code>manual</code>をオンにしていた — stateが属性を書くことに頼っていた自作の要素には、それを反映するsetterが要る。I/Oノードは<code>null</code>(属性を取り除く)と<code>undefined</code>(最初の属性を戻す)を扱い、<code>"undefined"</code>を開くことはもう無い。ルーター・<code><wcs-defined></code>・<code><wcs-throttle></code>・<code><wcs-wakelock></code>・<code><wcs-ws></code>・DevToolsにも修正が入る。</p>
<ul class="tag-features">
<li>Property Only, No Attribute Mirror</li>
<li>null Clears, undefined Restores</li>
<li>bindInput Follows A2</li>
<li>Router, Throttle, Wakelock, ws Fixed</li>
</ul>
<a class="card-link" href="state/#bindable">Learn more →</a>
</div>
</div>
</div>
</section>
<!-- The Core Insight -->
<section class="insight" id="insight">
<div class="container">
<p class="section-label">The Core Insight</p>
<h2 class="section-title">The only contract is a path string</h2>
<p class="section-sub">No hooks. No imports. No glue code.</p>
<p class="section-sub-ja">フックなし。インポートなし。グルーコードなし。</p>
<div class="insight-body fade-in">
<p>In every existing framework, the <strong>component</strong> is where UI meets state. Even with external stores, you still write glue code inside the component to pull state in. State and UI always couple through JavaScript.</p>
<p style="margin-top:14px">wcstack takes a different path. Literally. The <strong>only</strong> contract between UI and state is a <strong>path string</strong> — <code>user.name</code>, <code>cart.items.*.subtotal</code>, <code>cart.total</code>. The component's JavaScript doesn't contain a single line that references state. The HTML alone describes every data dependency — the same idea as a REST URL: a simple string contract, no shared code.</p>
</div>
<div class="insight-diagram fade-in">
<pre><span class="layer">State</span> <span class="note">←</span> <span class="path">"user.name"</span> <span class="note">→</span> <span class="layer">UI</span> <span class="note">Path binds the two layers</span>
<span class="layer">Comp A</span> <span class="note">←</span> <span class="path">"cart.total"</span> <span class="note">→</span> <span class="layer">Comp B</span> <span class="note">Mounted path crosses components</span>
<span class="layer">Loop</span> <span class="note">←</span> <span class="path">"items.*"</span> <span class="note">→</span> <span class="layer">Template</span> <span class="note">Wildcard abstracts the index</span></pre>
</div>
<p class="insight-ja fade-in">UIと状態を結ぶ唯一の契約はパス文字列。UIを作り直しても状態に触れなくていい。状態をリファクタリングしてもDOMに触れなくていい。HTMLを読めばすべてが分かる。</p>
</div>
</section>
<!-- Core Packages -->
<section class="core-section" id="core">
<div class="container">
<p class="section-label">The Core</p>
<h2 class="section-title">HTML tags that should exist</h2>
<p class="section-sub">What's missing from the browser — and what we built.</p>
<p class="section-sub-ja">ブラウザに足りないもの — そして我々が作ったもの。</p>
<div class="tag-grid fade-in">
<div class="tag-card">
<span class="tag-name"><wcs-state></span>
<h3>Reactive State</h3>
<p class="what-if">What if HTML had built-in reactive data binding?</p>
<p>Reactive state with Mustache syntax, path getters for computed properties, 40+ built-in filters, two-way binding, and structural directives — no virtual DOM.</p>
<p class="ja">Mustache構文、パスゲッター、40以上のビルトインフィルタ、双方向バインディング、構造ディレクティブ対応のリアクティブ状態管理。</p>
<ul class="tag-features">
<li>Mustache Syntax</li>
<li>Path Getters</li>
<li>40+ Filters</li>
<li>Two-way Binding</li>
<li>for / if / else</li>
</ul>
<a class="card-link" href="state/">Learn more →</a>
</div>
<div class="tag-card">
<span class="tag-name"><wcs-router></span>
<h3>Declarative Router</h3>
<p class="what-if">What if you could define SPA routes directly in HTML?</p>
<p>Define routes with nested layouts, typed URL parameters (<code>:id(int)</code>), route guards, and per-route <code><head></code> management. Built on the Navigation API.</p>
<p class="ja">ネストレイアウト、型付きURLパラメータ、ルートガード、ルート別head管理を備えた宣言的ルーティング。</p>
<ul class="tag-features">
<li>Nested Routes</li>
<li>Typed Params</li>
<li>Layouts</li>
<li>Route Guards</li>
<li>Head Management</li>
</ul>
</div>
<div class="tag-card">
<span class="tag-name"><wcs-autoloader></span>
<h3>Component Autoloader</h3>
<p class="what-if">What if the browser could auto-import components just by seeing their tags?</p>
<p>Detects custom elements in the DOM and dynamically imports them via Import Maps. Supports eager & lazy loading with MutationObserver for dynamically added elements.</p>
<p class="ja">DOMのカスタム要素を検出し、Import Mapsで動的インポート。Eager/Lazy読み込みとMutationObserverに対応。</p>
<ul class="tag-features">
<li>Import Maps</li>
<li>Eager / Lazy</li>
<li>MutationObserver</li>
<li>Pluggable Loaders</li>
</ul>
</div>
<div class="tag-card">
<span class="tag-name">@wcstack/signals</span>
<h3>Signals Core</h3>
<p class="what-if">What if TC39 signals were already here — and drove the same tags?</p>
<p>A fine-grained reactive core — <code>signal</code> / <code>computed</code> / <code>effect</code>, async resources, keyed <code>For</code> / <code>Index</code> — the JS-first counterpart to <code><wcs-state></code>, binding the same elements or their headless Cores.</p>
<p class="ja">signal / computed / effect、非同期resource、キー付きFor/Indexを備えたシグナルベースのリアクティブコア。同じ要素やヘッドレスCoreを束縛できるstateのJSファースト版。</p>
<ul class="tag-features">
<li>TC39-shaped</li>
<li>Async Resources</li>
<li>Keyed For / Index</li>
<li>bindNode / mountNode</li>
</ul>
<a class="card-link" href="signals/">Learn more →</a>
</div>
<div class="tag-card">
<span class="tag-name">@wcstack/server</span>
<h3>Server-Side Rendering</h3>
<p class="what-if">What if your templates rendered on the server — unchanged?</p>
<p>Same HTML, server-rendered. Add <code>enable-ssr</code>, call <code>renderToString()</code>, done. Automatic hydration with zero flicker, and version-safe fallback to CSR.</p>
<p class="ja">同じHTMLをサーバーでレンダリング。enable-ssrを付けてrenderToString()を呼ぶだけ。ゼロフリッカーの自動ハイドレーション付き。</p>
<ul class="tag-features">
<li>Drop-in SSR</li>
<li>Auto Hydration</li>
<li>Zero Flicker</li>
<li>CSR Fallback</li>
</ul>
</div>
<div class="tag-card">
<span class="tag-name"><wcs-fetch></span>
<h3>Fetch as a Tag</h3>
<p class="what-if">What if fetch was a tag?</p>
<p>Declarative HTTP as a headless component. Bind a URL, get data — URL changes automatically re-fetch. htmx-like HTML replace mode, and a headless core that runs in Node.js, Deno, and Workers.</p>
<p class="ja">宣言的HTTP通信。URLをバインドすればデータが届く。URL変更で自動再フェッチ。htmxライクなHTML置換モードも。</p>
<ul class="tag-features">
<li>URL Observation</li>
<li>Trigger Property</li>
<li>HTML Replace</li>
<li>Headless Core</li>
</ul>
</div>
</div>
</div>
</section>
<!-- Web APIs as tags -->
<section class="io-section" id="webapis">
<div class="container">
<p class="section-label">The I/O Nodes</p>
<h2 class="section-title">What if every Web API was a tag?</h2>
<p class="section-sub">Thirty-plus declarative wrappers over the Web platform — each one a headless custom element that binds straight into your state.</p>
<p class="section-sub-ja">Webプラットフォームの30以上のAPIを宣言的タグ化。すべてヘッドレスなカスタム要素として、状態に直接バインドされる。</p>
<div class="io-grid fade-in">
<div class="io-node"><span class="io-tag"><wcs-fetch></span><span class="io-desc">HTTP requests, auto re-fetch</span></div>
<div class="io-node"><span class="io-tag"><wcs-storage></span><span class="io-desc">localStorage / sessionStorage sync</span></div>
<div class="io-node"><span class="io-tag"><wcs-upload></span><span class="io-desc">File upload with progress</span></div>
<div class="io-node"><span class="io-tag"><wcs-ws></span><span class="io-desc">WebSocket real-time comms</span></div>
<div class="io-node"><span class="io-tag"><wcs-sse></span><span class="io-desc">Server-Sent Events streaming</span></div>
<div class="io-node"><span class="io-tag"><wcs-broadcast></span><span class="io-desc">Cross-tab messaging</span></div>
<div class="io-node"><span class="io-tag"><wcs-worker></span><span class="io-desc">Web Worker offloading</span></div>
<div class="io-node"><span class="io-tag"><wcs-timer></span><span class="io-desc">Ticks, elapsed time, polling</span></div>
<div class="io-node"><span class="io-tag"><wcs-raf></span><span class="io-desc">Frame ticks with dt, tab-aware</span></div>
<div class="io-node"><span class="io-tag"><wcs-debounce> <wcs-throttle></span><span class="io-desc">Value & signal coalescing</span></div>
<div class="io-node"><span class="io-tag"><wcs-clipboard></span><span class="io-desc">Clipboard read / write / monitor</span></div>
<div class="io-node"><span class="io-tag"><wcs-geo></span><span class="io-desc">Geolocation, live permission</span></div>
<div class="io-node"><span class="io-tag"><wcs-permission></span><span class="io-desc">Permissions API monitor</span></div>
<div class="io-node"><span class="io-tag"><wcs-notify></span><span class="io-desc">Desktop notifications</span></div>
<div class="io-node"><span class="io-tag"><wcs-intersect></span><span class="io-desc">Visibility, lazy-load, scrollspy</span></div>
<div class="io-node"><span class="io-tag"><wcs-resize></span><span class="io-desc">Element size observation</span></div>
<div class="io-node"><span class="io-tag"><wcs-wakelock></span><span class="io-desc">Screen Wake Lock</span></div>
<div class="io-node"><span class="io-tag"><wcs-camera> <wcs-recorder></span><span class="io-desc">Camera capture & recording</span></div>
<div class="io-node"><span class="io-tag"><wcs-speak> <wcs-listen></span><span class="io-desc">Speech synthesis & recognition</span></div>
<div class="io-node"><span class="io-tag"><wcs-defined></span><span class="io-desc">Custom-element readiness gate</span></div>
<div class="io-node"><span class="io-tag"><wcs-fullscreen></span><span class="io-desc">Fullscreen API</span></div>
<div class="io-node"><span class="io-tag"><wcs-pip></span><span class="io-desc">Picture-in-Picture</span></div>
<div class="io-node"><span class="io-tag"><wcs-pointer-lock></span><span class="io-desc">Pointer Lock for games / canvas</span></div>
<div class="io-node"><span class="io-tag"><wcs-screen-orientation></span><span class="io-desc">Orientation monitor & lock</span></div>
<div class="io-node"><span class="io-tag"><wcs-idle></span><span class="io-desc">Idle Detection</span></div>
<div class="io-node"><span class="io-tag"><wcs-network></span><span class="io-desc">Network Information monitor</span></div>
<div class="io-node"><span class="io-tag"><wcs-media-query></span><span class="io-desc">matchMedia: dark mode, reduced motion, breakpoints</span></div>
<div class="io-node"><span class="io-tag"><wcs-share></span><span class="io-desc">Web Share sheet</span></div>
<div class="io-node"><span class="io-tag"><wcs-contacts></span><span class="io-desc">Contact Picker</span></div>
<div class="io-node"><span class="io-tag"><wcs-credential></span><span class="io-desc">Credential Management</span></div>
<div class="io-node"><span class="io-tag"><wcs-eyedropper></span><span class="io-desc">EyeDropper color picker</span></div>
<div class="io-node"><span class="io-tag"><wcs-tilt></span><span class="io-desc">Device Orientation, iOS-safe</span></div>
<div class="io-node"><span class="io-tag"><wcs-accelerometer> <wcs-gyroscope></span><span class="io-desc">Motion sensors (x / y / z)</span></div>
<div class="io-node"><span class="io-tag"><wcs-magnetometer> <wcs-ambient-light-sensor></span><span class="io-desc">Magnetic field & illuminance</span></div>
<div class="io-node"><span class="io-tag"><wcs-audio> <wcs-osc> <wcs-gain></span><span class="io-desc">Web Audio graph as markup (11 tags)</span></div>
<div class="io-node"><span class="io-tag"><wcs-midi></span><span class="io-desc">Web MIDI in & out, one tag</span></div>
<div class="io-node"><span class="io-tag"><wcs-view-transition></span><span class="io-desc">Leave & move animations, policy only</span></div>
</div>
<div class="protocol-note fade-in">
<h3>One protocol behind them all: <code>wc-bindable</code></h3>
<p>Every I/O node exposes a static manifest — observable <em>properties</em>, settable <em>inputs</em>, invocable <em>commands</em> — so any binding core can discover and wire it generically. Since v1.24.0 each observable also declares its <code>semantics</code> — <code>state</code>, <code>event</code>, or <code>handle</code> — so a generic adapter can tell a current value from an occurrence. <a href="state/"><code><wcs-state></code></a> and <a href="signals/"><code>@wcstack/signals</code></a> speak it natively; thin adapters connect React, Vue, Svelte, and Solid.</p>
<p class="ja">すべてのI/Oノードは静的マニフェスト(properties / inputs / commands)を公開。v1.24.0からは各observableが<code>semantics</code>(state / event / handle)も宣言し、汎用アダプタが現在値と発生を区別できる。stateとsignalsはネイティブ対応、薄いアダプタでReact / Vue / Svelte / Solidからも使える。</p>
</div>
</div>
</section>
<!-- Code Examples -->
<section class="code-section" id="examples">
<div class="container">
<p class="section-label">See it in action</p>
<h2 class="section-title">Code that reads like HTML</h2>
<p class="section-sub">Because it <em>is</em> HTML.</p>
<p class="section-sub-ja">HTMLのように読める。なぜなら、HTMLだから。</p>
<div class="code-tabs" role="tablist">
<button class="code-tab active" data-tab="state" role="tab">State</button>
<button class="code-tab" data-tab="router" role="tab">Router</button>
<button class="code-tab" data-tab="fetch" role="tab">Fetch</button>
<button class="code-tab" data-tab="streams" role="tab">Streams</button>
<button class="code-tab" data-tab="ssr" role="tab">SSR</button>
<button class="code-tab" data-tab="autoloader" role="tab">Autoloader</button>
</div>
<div class="code-panels">
<!-- State -->
<div class="code-panel active" id="panel-state">
<div class="code-header">
<span class="filename">index.html</span>
<span>State</span>
</div>
<pre><code class="language-html"><wcs-state>
<script type="module">
export default {
taxRate: 0.1,
cart: {
items: [
{ name: "Widget", price: 500, quantity: 2 },
{ name: "Gadget", price: 1200, quantity: 1 }
]
},
removeItem(event, index) {
this["cart.items"] = this["cart.items"].toSpliced(index, 1);
},
get "cart.items.*.subtotal"() {
return this["cart.items.*.price"] * this["cart.items.*.quantity"];