FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
framework/scripts/build-framework-bundle.js at main · async/framework · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
async
/
framework
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
4
Code
Issues
0
Pull requests
1
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
framework
/
scripts
/
build-framework-bundle.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
2627 lines (2576 loc) · 117 KB
Breadcrumbs
framework
/
scripts
/
build-framework-bundle.js
Copy path
File metadata and controls
2627 lines (2576 loc) · 117 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!/usr/bin/env node
import
{
existsSync
}
from
"node:fs"
;
import
{
copyFile
,
mkdir
,
readFile
,
rm
,
writeFile
}
from
"node:fs/promises"
;
import
{
createRequire
}
from
"node:module"
;
import
{
basename
,
dirname
,
join
,
normalize
,
relative
,
resolve
}
from
"node:path"
;
import
{
fileURLToPath
,
pathToFileURL
}
from
"node:url"
;
import
{
minify
}
from
"terser"
;
const
root
=
resolve
(
dirname
(
fileURLToPath
(
import
.
meta
.
url
)
)
,
".."
)
;
const
require
=
createRequire
(
import
.
meta
.
url
)
;
const
srcRoot
=
join
(
root
,
"src"
)
;
const
distRoot
=
join
(
root
,
"dist"
)
;
const
browserEntry
=
"src/browser.js"
;
const
streamEntry
=
"src/stream.js"
;
const
flowEntry
=
"src/flow-entry.js"
;
const
routerEntry
=
"src/router-entry.js"
;
const
serverEntry
=
"src/index.js"
;
const
packageManifest
=
JSON
.
parse
(
await
readFile
(
join
(
root
,
"package.json"
)
,
"utf8"
)
)
;
const
packageExportSpec
=
packageManifest
.
exports
;
const
browserExport
=
getPackageExport
(
packageExportSpec
,
"./browser"
)
;
const
streamExport
=
getPackageExport
(
packageExportSpec
,
"./stream"
)
;
const
flowExport
=
getPackageExport
(
packageExportSpec
,
"./flow"
)
;
const
routerExport
=
getPackageExport
(
packageExportSpec
,
"./router"
)
;
const
serverExport
=
getPackageExport
(
packageExportSpec
,
"./server"
)
;
const
jsxExport
=
getPackageExport
(
packageExportSpec
,
"./jsx"
)
;
const
jsxRuntimeFactoryExport
=
getPackageExport
(
packageExportSpec
,
"./jsx/jsx-runtime"
)
;
const
jsxDevRuntimeFactoryExport
=
getPackageExport
(
packageExportSpec
,
"./jsx/jsx-dev-runtime"
)
;
const
jsxRuntimeProfileExport
=
getPackageExport
(
packageExportSpec
,
"./jsx/runtime"
)
;
const
jsxRuntimeProfileJsxRuntimeExport
=
getPackageExport
(
packageExportSpec
,
"./jsx/runtime/jsx-runtime"
)
;
const
jsxRuntimeProfileJsxDevRuntimeExport
=
getPackageExport
(
packageExportSpec
,
"./jsx/runtime/jsx-dev-runtime"
)
;
const
jsxBuildtimeProfileExport
=
getPackageExport
(
packageExportSpec
,
"./jsx/buildtime"
)
;
const
jsxBuildtimeProfileJsxRuntimeExport
=
getPackageExport
(
packageExportSpec
,
"./jsx/buildtime/jsx-runtime"
)
;
const
jsxBuildtimeProfileJsxDevRuntimeExport
=
getPackageExport
(
packageExportSpec
,
"./jsx/buildtime/jsx-dev-runtime"
)
;
const
viteExport
=
getPackageExport
(
packageExportSpec
,
"./vite"
)
;
const
runtimeExport
=
getPackageExport
(
packageExportSpec
,
"./runtime"
)
;
const
runtimeSignalsExport
=
getPackageExport
(
packageExportSpec
,
"./runtime/signals"
)
;
const
runtimeEventsExport
=
getPackageExport
(
packageExportSpec
,
"./runtime/events"
)
;
const
rootExport
=
getPackageExport
(
packageExportSpec
,
"."
)
;
const
browserDts
=
packagePathToFile
(
resolveConditionalTarget
(
browserExport
,
[
"types"
]
)
)
;
const
browserEsm
=
packagePathToFile
(
resolveConditionalTarget
(
browserExport
,
[
"import"
,
"default"
]
)
)
;
const
browserEsmMin
=
packagePathToFile
(
resolveConditionalTarget
(
rootExport
,
[
"browser"
,
"default"
]
)
)
;
const
browserUmdMin
=
packagePathToFile
(
resolveConditionalTarget
(
browserExport
,
[
"unpkg"
]
)
??
packageManifest
.
unpkg
)
;
const
browserUmd
=
unminifiedArtifact
(
browserUmdMin
)
;
const
browserTs
=
typedSourceArtifact
(
browserEsm
)
;
const
streamDts
=
packagePathToFile
(
resolveConditionalTarget
(
streamExport
,
[
"types"
]
)
)
;
const
streamEsm
=
packagePathToFile
(
resolveConditionalTarget
(
streamExport
,
[
"import"
,
"default"
]
)
)
;
const
streamEsmMin
=
minifiedArtifact
(
streamEsm
)
;
const
streamUmdMin
=
packagePathToFile
(
resolveConditionalTarget
(
streamExport
,
[
"unpkg"
]
)
)
;
const
streamUmd
=
unminifiedArtifact
(
streamUmdMin
)
;
const
streamTs
=
typedSourceArtifact
(
streamEsm
)
;
const
flowDts
=
packagePathToFile
(
resolveConditionalTarget
(
flowExport
,
[
"types"
]
)
)
;
const
flowEsm
=
packagePathToFile
(
resolveConditionalTarget
(
flowExport
,
[
"import"
,
"default"
]
)
)
;
const
flowEsmMin
=
minifiedArtifact
(
flowEsm
)
;
const
flowUmdMin
=
packagePathToFile
(
resolveConditionalTarget
(
flowExport
,
[
"unpkg"
]
)
)
;
const
flowUmd
=
unminifiedArtifact
(
flowUmdMin
)
;
const
flowTs
=
typedSourceArtifact
(
flowEsm
)
;
const
routerDts
=
packagePathToFile
(
resolveConditionalTarget
(
routerExport
,
[
"types"
]
)
)
;
const
routerEsm
=
packagePathToFile
(
resolveConditionalTarget
(
routerExport
,
[
"import"
,
"default"
]
)
)
;
const
routerEsmMin
=
minifiedArtifact
(
routerEsm
)
;
const
routerUmdMin
=
packagePathToFile
(
resolveConditionalTarget
(
routerExport
,
[
"unpkg"
]
)
)
;
const
routerUmd
=
unminifiedArtifact
(
routerUmdMin
)
;
const
routerTs
=
typedSourceArtifact
(
routerEsm
)
;
const
frameworkDts
=
packagePathToFile
(
resolveConditionalTarget
(
serverExport
,
[
"types"
]
)
)
;
const
frameworkTs
=
typedSourceArtifact
(
frameworkDts
)
;
const
packageJsonArtifact
=
packagePathToFile
(
resolveConditionalTarget
(
packageExportSpec
,
[
"./package.json"
]
)
)
;
const
serverEsm
=
packagePathToFile
(
resolveConditionalTarget
(
serverExport
,
[
"import"
,
"node"
,
"default"
]
)
)
;
const
jsxEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxExport
,
[
"types"
]
)
)
;
const
jsxRuntimeFactoryEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxRuntimeFactoryExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxRuntimeFactoryDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxRuntimeFactoryExport
,
[
"types"
]
)
)
;
const
jsxDevRuntimeFactoryEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxDevRuntimeFactoryExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxDevRuntimeFactoryDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxDevRuntimeFactoryExport
,
[
"types"
]
)
)
;
const
jsxRuntimeProfileEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxRuntimeProfileExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxRuntimeProfileDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxRuntimeProfileExport
,
[
"types"
]
)
)
;
const
jsxRuntimeProfileJsxRuntimeEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxRuntimeProfileJsxRuntimeExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxRuntimeProfileJsxRuntimeDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxRuntimeProfileJsxRuntimeExport
,
[
"types"
]
)
)
;
const
jsxRuntimeProfileJsxDevRuntimeEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxRuntimeProfileJsxDevRuntimeExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxRuntimeProfileJsxDevRuntimeDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxRuntimeProfileJsxDevRuntimeExport
,
[
"types"
]
)
)
;
const
jsxBuildtimeProfileEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxBuildtimeProfileExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxBuildtimeProfileDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxBuildtimeProfileExport
,
[
"types"
]
)
)
;
const
jsxBuildtimeProfileJsxRuntimeEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxBuildtimeProfileJsxRuntimeExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxBuildtimeProfileJsxRuntimeDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxBuildtimeProfileJsxRuntimeExport
,
[
"types"
]
)
)
;
const
jsxBuildtimeProfileJsxDevRuntimeEsm
=
packagePathToFile
(
resolveConditionalTarget
(
jsxBuildtimeProfileJsxDevRuntimeExport
,
[
"import"
,
"default"
]
)
)
;
const
jsxBuildtimeProfileJsxDevRuntimeDts
=
packagePathToFile
(
resolveConditionalTarget
(
jsxBuildtimeProfileJsxDevRuntimeExport
,
[
"types"
]
)
)
;
const
jsxProfileTypesDts
=
"jsx/types.d.ts"
;
const
viteEsm
=
packagePathToFile
(
resolveConditionalTarget
(
viteExport
,
[
"import"
,
"default"
]
)
)
;
const
viteDts
=
packagePathToFile
(
resolveConditionalTarget
(
viteExport
,
[
"types"
]
)
)
;
const
runtimeEsm
=
packagePathToFile
(
resolveConditionalTarget
(
runtimeExport
,
[
"import"
,
"default"
]
)
)
;
const
runtimeDts
=
packagePathToFile
(
resolveConditionalTarget
(
runtimeExport
,
[
"types"
]
)
)
;
const
runtimeSignalsEsm
=
packagePathToFile
(
resolveConditionalTarget
(
runtimeSignalsExport
,
[
"import"
,
"default"
]
)
)
;
const
runtimeSignalsDts
=
packagePathToFile
(
resolveConditionalTarget
(
runtimeSignalsExport
,
[
"types"
]
)
)
;
const
runtimeEventsEsm
=
packagePathToFile
(
resolveConditionalTarget
(
runtimeEventsExport
,
[
"import"
,
"default"
]
)
)
;
const
runtimeEventsDts
=
packagePathToFile
(
resolveConditionalTarget
(
runtimeEventsExport
,
[
"types"
]
)
)
;
const
generatedArtifacts
=
{
browserDts
,
browserEsm
,
browserEsmMin
,
browserUmd
,
browserUmdMin
,
browserTs
,
streamDts
,
streamEsm
,
streamEsmMin
,
streamUmd
,
streamUmdMin
,
streamTs
,
flowDts
,
flowEsm
,
flowEsmMin
,
flowUmd
,
flowUmdMin
,
flowTs
,
routerDts
,
routerEsm
,
routerEsmMin
,
routerUmd
,
routerUmdMin
,
routerTs
,
frameworkDts
,
frameworkTs
,
packageJson
:
packageJsonArtifact
,
serverEsm
,
jsxDts
,
jsxRuntimeFactoryDts
,
jsxDevRuntimeFactoryDts
,
jsxRuntimeProfileDts
,
jsxRuntimeProfileJsxRuntimeDts
,
jsxRuntimeProfileJsxDevRuntimeDts
,
jsxBuildtimeProfileDts
,
jsxBuildtimeProfileJsxRuntimeDts
,
jsxBuildtimeProfileJsxDevRuntimeDts
,
jsxProfileTypesDts
,
viteDts
,
runtimeDts
,
runtimeSignalsDts
,
runtimeEventsDts
}
;
const
copiedArtifacts
=
{
agentGuide
:
{
source
:
"docs/start/app-authoring.md"
,
file
:
"AGENTS.md"
}
,
changelog
:
{
source
:
"CHANGELOG.md"
,
file
:
"CHANGELOG.md"
}
,
readme
:
{
source
:
"README.md"
,
file
:
"README.md"
}
,
license
:
{
source
:
"LICENSE"
,
file
:
"LICENSE"
}
}
;
const
runtimeCopiedArtifacts
=
{
jsxEsm
:
{
source
:
"src/jsx.js"
,
file
:
jsxEsm
}
,
jsxRuntimeProfileEsm
:
{
source
:
"src/jsx/runtime.js"
,
file
:
jsxRuntimeProfileEsm
}
,
jsxRuntimeProfileJsxRuntimeEsm
:
{
source
:
"src/jsx/runtime/jsx-runtime.js"
,
file
:
jsxRuntimeProfileJsxRuntimeEsm
}
,
jsxRuntimeProfileJsxDevRuntimeEsm
:
{
source
:
"src/jsx/runtime/jsx-dev-runtime.js"
,
file
:
jsxRuntimeProfileJsxDevRuntimeEsm
}
,
jsxBuildtimeProfileEsm
:
{
source
:
"src/jsx/buildtime.js"
,
file
:
jsxBuildtimeProfileEsm
}
,
jsxBuildtimeProfileJsxRuntimeEsm
:
{
source
:
"src/jsx/buildtime/jsx-runtime.js"
,
file
:
jsxBuildtimeProfileJsxRuntimeEsm
}
,
jsxBuildtimeProfileJsxDevRuntimeEsm
:
{
source
:
"src/jsx/buildtime/jsx-dev-runtime.js"
,
file
:
jsxBuildtimeProfileJsxDevRuntimeEsm
}
,
jsxRuntimeFactoryEsm
:
{
source
:
"src/jsx/jsx-runtime.js"
,
file
:
jsxRuntimeFactoryEsm
}
,
jsxDevRuntimeFactoryEsm
:
{
source
:
"src/jsx/jsx-dev-runtime.js"
,
file
:
jsxDevRuntimeFactoryEsm
}
,
viteEsm
:
{
source
:
"src/vite.js"
,
file
:
viteEsm
}
,
buildProfileEsm
:
{
source
:
"src/build-profile.js"
,
file
:
"build-profile.js"
}
,
buildOptimizerEsm
:
{
source
:
"src/build-optimizer.js"
,
file
:
"build-optimizer.js"
}
,
revealPolicyEsm
:
{
source
:
"src/reveal-policy.js"
,
file
:
"reveal-policy.js"
}
,
runtimeEsm
:
{
source
:
"src/runtime.js"
,
file
:
runtimeEsm
}
,
runtimeSignalsEsm
:
{
source
:
"src/runtime/signals.js"
,
file
:
runtimeSignalsEsm
}
,
runtimeEventsEsm
:
{
source
:
"src/runtime/events.js"
,
file
:
runtimeEventsEsm
}
,
runtimeSharedEsm
:
{
source
:
"src/runtime/shared.js"
,
file
:
"runtime/shared.js"
}
}
;
const
publishArtifactFiles
=
{
...
Object
.
fromEntries
(
Object
.
entries
(
copiedArtifacts
)
.
map
(
(
[
id
,
{
file
}
]
)
=>
[
id
,
file
]
)
)
,
...
generatedArtifacts
,
...
Object
.
fromEntries
(
Object
.
entries
(
runtimeCopiedArtifacts
)
.
map
(
(
[
id
,
{
file
}
]
)
=>
[
id
,
file
]
)
)
}
;
const
outFiles
=
Object
.
fromEntries
(
Object
.
entries
(
generatedArtifacts
)
.
map
(
(
[
id
,
file
]
)
=>
[
id
,
join
(
distRoot
,
file
)
]
)
)
;
const
legacyRootOutFiles
=
Object
.
entries
(
generatedArtifacts
)
.
filter
(
(
[
id
]
)
=>
id
!==
"packageJson"
&&
!
id
.
startsWith
(
"runtime"
)
)
.
map
(
(
[
,
file
]
)
=>
join
(
root
,
file
)
)
;
const
publishFiles
=
unique
(
Object
.
values
(
publishArtifactFiles
)
)
;
const
copiedPublishFiles
=
Object
.
fromEntries
(
[
...
Object
.
entries
(
copiedArtifacts
)
,
...
Object
.
entries
(
runtimeCopiedArtifacts
)
]
.
map
(
(
[
id
,
{
source
,
file
}
]
)
=>
[
id
,
[
join
(
root
,
source
)
,
join
(
distRoot
,
file
)
]
]
)
)
;
const
check
=
process
.
argv
.
includes
(
"--check"
)
;
const
clean
=
process
.
argv
.
includes
(
"--clean"
)
;
if
(
clean
)
{
await
rm
(
distRoot
,
{
recursive
:
true
,
force
:
true
}
)
;
for
(
const
file
of
legacyRootOutFiles
)
{
await
rm
(
file
,
{
force
:
true
}
)
;
}
process
.
exit
(
0
)
;
}
const
browserBundle
=
await
buildBundle
(
browserEntry
)
;
if
(
browserBundle
.
externalImports
.
length
>
0
)
{
throw
new
Error
(
"Browser bundle must not include external imports."
)
;
}
const
streamBundle
=
await
buildBundle
(
streamEntry
)
;
if
(
streamBundle
.
externalImports
.
length
>
0
)
{
throw
new
Error
(
"Stream bundle must not include external imports."
)
;
}
const
flowBundle
=
await
buildBundle
(
flowEntry
)
;
if
(
flowBundle
.
externalImports
.
length
>
0
)
{
throw
new
Error
(
"Flow bundle must not include external imports."
)
;
}
const
routerBundle
=
await
buildBundle
(
routerEntry
)
;
if
(
routerBundle
.
externalImports
.
length
>
0
)
{
throw
new
Error
(
"Router bundle must not include external imports."
)
;
}
const
serverBundle
=
await
buildBundle
(
serverEntry
)
;
const
umdNamespaceReservedKeys
=
await
readUmdNamespaceReservedKeys
(
browserEntry
)
;
assertNoUmdNamespaceConflicts
(
browserBundle
.
publicBindings
,
umdNamespaceReservedKeys
)
;
const
browserEsmOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled ESM entry for CDN imports."
,
""
,
browserBundle
.
bundleBody
,
""
,
`export {
${
browserBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
join
(
"\n"
)
;
const
browserEsmMinOutput
=
await
minifyJavaScript
(
browserEsmOutput
,
{
module
:
true
}
)
;
const
browserUmdOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled UMD entry for script-tag and CommonJS-style consumers."
,
"(function (root, factory) {"
,
" const namespace = factory();"
,
" if (typeof define === \"function\" && define.amd) {"
,
" define([], function () { return namespace; });"
,
" } else if (typeof module === \"object\" && module.exports) {"
,
" module.exports = namespace;"
,
" } else {"
,
" root.AsyncFramework = namespace;"
,
" root.Async = namespace;"
,
" }"
,
"})(typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : this, function () {"
,
" \"use strict\";"
,
indent
(
browserBundle
.
bundleBody
.
trim
(
)
)
,
` const api = {
${
browserBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
" assertNoUmdNamespaceConflicts(api, Async);"
,
" Object.assign(Async, api);"
,
" Async.Async = Async;"
,
" return Async;"
,
""
,
" function assertNoUmdNamespaceConflicts(api, target) {"
,
" const conflicts = Object.keys(api).filter((key) => key !== \"Async\" && Object.prototype.hasOwnProperty.call(target, key));"
,
" if (conflicts.length > 0) {"
,
" throw new Error(`UMD Async namespace export conflict: ${conflicts.join(\", \")}.`);"
,
" }"
,
" }"
,
"});"
,
""
]
.
join
(
"\n"
)
;
const
browserUmdMinOutput
=
await
minifyJavaScript
(
browserUmdOutput
,
{
module
:
false
}
)
;
const
browserTsOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// @ts-nocheck"
,
"// Bundled browser TypeScript source entry for TS-aware runtimes and higher-layer tooling."
,
""
,
browserBundle
.
bundleBody
,
""
,
`export {
${
browserBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
join
(
"\n"
)
;
const
streamEsmOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled stream ESM entry for opt-in streaming imports."
,
""
,
streamBundle
.
bundleBody
,
""
,
`export {
${
streamBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
join
(
"\n"
)
;
const
streamEsmMinOutput
=
await
minifyJavaScript
(
streamEsmOutput
,
{
module
:
true
}
)
;
const
streamUmdOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled stream UMD entry for opt-in script-tag and CommonJS-style consumers."
,
"(function (root, factory) {"
,
" const namespace = factory();"
,
" if (typeof define === \"function\" && define.amd) {"
,
" define([], function () { return namespace; });"
,
" } else if (typeof module === \"object\" && module.exports) {"
,
" module.exports = namespace;"
,
" } else {"
,
" root.AsyncFrameworkStream = namespace;"
,
" if (root.Async && typeof root.Async === \"object\") {"
,
" Object.assign(root.Async, namespace);"
,
" }"
,
" }"
,
"})(typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : this, function () {"
,
" \"use strict\";"
,
indent
(
streamBundle
.
bundleBody
.
trim
(
)
)
,
` return {
${
streamBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
"});"
,
""
]
.
join
(
"\n"
)
;
const
streamUmdMinOutput
=
await
minifyJavaScript
(
streamUmdOutput
,
{
module
:
false
}
)
;
const
streamTsOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// @ts-nocheck"
,
"// Bundled stream TypeScript source entry for TS-aware runtimes and higher-layer tooling."
,
""
,
streamBundle
.
bundleBody
,
""
,
`export {
${
streamBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
join
(
"\n"
)
;
const
flowEsmOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled Flow ESM entry for opt-in Flow imports."
,
""
,
flowBundle
.
bundleBody
,
""
,
`export {
${
flowBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
join
(
"\n"
)
;
const
flowEsmMinOutput
=
await
minifyJavaScript
(
flowEsmOutput
,
{
module
:
true
}
)
;
const
flowUmdOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled Flow UMD entry for opt-in script-tag and CommonJS-style consumers."
,
"(function (root, factory) {"
,
" const namespace = factory();"
,
" if (typeof define === \"function\" && define.amd) {"
,
" define([], function () { return namespace; });"
,
" } else if (typeof module === \"object\" && module.exports) {"
,
" module.exports = namespace;"
,
" } else {"
,
" root.AsyncFrameworkFlow = namespace;"
,
" }"
,
"})(typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : this, function () {"
,
" \"use strict\";"
,
indent
(
flowBundle
.
bundleBody
.
trim
(
)
)
,
` return {
${
flowBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
"});"
,
""
]
.
join
(
"\n"
)
;
const
flowUmdMinOutput
=
await
minifyJavaScript
(
flowUmdOutput
,
{
module
:
false
}
)
;
const
flowTsOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// @ts-nocheck"
,
"// Bundled Flow TypeScript source entry for TS-aware runtimes and higher-layer tooling."
,
""
,
flowBundle
.
bundleBody
,
""
,
`export {
${
flowBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
join
(
"\n"
)
;
const
routerEsmOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled router ESM entry for opt-in router imports."
,
""
,
routerBundle
.
bundleBody
,
""
,
`export {
${
routerBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
join
(
"\n"
)
;
const
routerEsmMinOutput
=
await
minifyJavaScript
(
routerEsmOutput
,
{
module
:
true
}
)
;
const
routerUmdOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled router UMD entry for opt-in script-tag and CommonJS-style consumers."
,
"(function (root, factory) {"
,
" const namespace = factory();"
,
" if (typeof define === \"function\" && define.amd) {"
,
" define([], function () { return namespace; });"
,
" } else if (typeof module === \"object\" && module.exports) {"
,
" module.exports = namespace;"
,
" } else {"
,
" root.AsyncFrameworkRouter = namespace;"
,
" }"
,
"})(typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : this, function () {"
,
" \"use strict\";"
,
indent
(
routerBundle
.
bundleBody
.
trim
(
)
)
,
` return {
${
routerBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
"});"
,
""
]
.
join
(
"\n"
)
;
const
routerUmdMinOutput
=
await
minifyJavaScript
(
routerUmdOutput
,
{
module
:
false
}
)
;
const
routerTsOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// @ts-nocheck"
,
"// Bundled router TypeScript source entry for TS-aware runtimes and higher-layer tooling."
,
""
,
routerBundle
.
bundleBody
,
""
,
`export {
${
routerBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
join
(
"\n"
)
;
const
serverEsmOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Bundled server-capable ESM entry for Node.js consumers."
,
serverBundle
.
externalImports
.
length
>
0
?
""
:
null
,
...
serverBundle
.
externalImports
,
""
,
serverBundle
.
bundleBody
,
""
,
`export {
${
serverBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
filter
(
(
line
)
=>
line
!==
null
)
.
join
(
"\n"
)
;
const
frameworkTsOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// @ts-nocheck"
,
"// Bundled server-capable TypeScript source entry for TS-aware runtimes and higher-layer tooling."
,
serverBundle
.
externalImports
.
length
>
0
?
""
:
null
,
...
serverBundle
.
externalImports
,
""
,
serverBundle
.
bundleBody
,
""
,
`export {
${
serverBundle
.
publicBindings
.
join
(
", "
)
}
};`
,
""
]
.
filter
(
(
line
)
=>
line
!==
null
)
.
join
(
"\n"
)
;
const
fullBrowserDtsOutput
=
[
"// Generated by scripts/build-framework-bundle.js. Do not edit by hand."
,
"// Browser type declarations for @async/framework/browser."
,
""
,
"export type RuntimeTarget = \"browser\" | \"server\";"
,
"export type RouterMode = \"csr\" | \"spa\" | \"signals\" | \"ssr\" | \"mpa\";"
,
"export type RouterUrlMode = \"path\" | \"hash\";"
,
"export type RouteRenderMode = \"partial\" | \"none\";"
,
"export type LoaderSwapScan = \"auto\" | \"full\" | \"none\";"
,
"export type LoaderSwapManyScan = LoaderSwapScan | \"once\";"
,
"export type LoaderSwapStrategy = \"replace\" | \"morph\";"
,
"export type AsyncSignalStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";"
,
"export type MaybePromise<T> = T | Promise<T>;"
,
"export type Cleanup = () => void;"
,
"export declare const asyncErrorCodes: {"
,
" readonly runtimeError: \"runtime-error\";"
,
" readonly handlerNotRegistered: \"handler-not-registered\";"
,
" readonly invalidHandlerCommand: \"invalid-handler-command\";"
,
" readonly serverCommandUnavailable: \"server-command-unavailable\";"
,
" readonly handlerFailed: \"handler-failed\";"
,
" readonly componentNotRegistered: \"component-not-registered\";"
,
" readonly asyncComponentUnsupported: \"async-component-unsupported\";"
,
" readonly partialNotRegistered: \"partial-not-registered\";"
,
" readonly boundaryNotFound: \"boundary-not-found\";"
,
" readonly routeNotMatched: \"route-not-matched\";"
,
" readonly navigationFailed: \"navigation-failed\";"
,
" readonly entrypointRequired: \"entrypoint-required\";"
,
" readonly invalidServerTransportResponse: \"invalid-server-transport-response\";"
,
" readonly unsupportedServerJsonValue: \"unsupported-server-json-value\";"
,
"};"
,
"export type AsyncErrorCode = typeof asyncErrorCodes[keyof typeof asyncErrorCodes];"
,
"export type AsyncDiagnosticContextValue = string | number | boolean | null;"
,
"export interface AsyncDiagnostic {"
,
" readonly severity: \"error\";"
,
" readonly code: AsyncErrorCode;"
,
" readonly message: string;"
,
" readonly hint?: string;"
,
" readonly context?: Readonly<Record<string, AsyncDiagnosticContextValue>>;"
,
"}"
,
"export interface AsyncErrorReport {"
,
" readonly error: unknown;"
,
" readonly diagnostic: AsyncDiagnostic;"
,
"}"
,
"export type AsyncErrorHandler = (report: AsyncErrorReport) => void;"
,
"export interface AsyncErrorOptions {"
,
" code: AsyncErrorCode;"
,
" message: string;"
,
" hint?: string;"
,
" context?: Record<string, unknown>;"
,
" cause?: unknown;"
,
"}"
,
"export interface ToAsyncDiagnosticOptions {"
,
" error: unknown;"
,
" code?: AsyncErrorCode;"
,
" hint?: string;"
,
" context?: Record<string, unknown>;"
,
"}"
,
"export declare class AsyncError extends Error {"
,
" readonly code: AsyncErrorCode;"
,
" readonly hint?: string;"
,
" readonly context?: Readonly<Record<string, AsyncDiagnosticContextValue>>;"
,
" constructor(options: AsyncErrorOptions);"
,
"}"
,
"export type RegistryType ="
,
" | \"signal\""
,
" | \"handler\""
,
" | \"flow\""
,
" | \"server\""
,
" | \"partial\""
,
" | \"route\""
,
" | \"component\""
,
" | \"asyncSignal\""
,
" | \"cache.browser\""
,
" | \"cache.server\""
,
" | \"cache.browser.entries\""
,
" | \"cache.server.entries\";"
,
""
,
"export interface AttributeConfig {"
,
" async?: string | string[];"
,
" class?: string | string[];"
,
" signal?: string | string[];"
,
" intersect?: string | string[];"
,
" on?: string | string[];"
,
"}"
,
""
,
"export interface NormalizedAttributeConfig {"
,
" async: string[];"
,
" class: string[];"
,
" signal: string[];"
,
" intersect: string[];"
,
" on: string[];"
,
"}"
,
""
,
"export type TemplatePrimitive = string | number | boolean | null | undefined;"
,
"export type TemplateLike = TemplateResult | Children | TemplatePrimitive | Node | TemplateLike[];"
,
"export type ChildrenInput = TemplateLike | ((this: ComponentContext) => TemplateLike);"
,
"export interface LazyDescriptor {"
,
" url: string;"
,
" [key: string]: unknown;"
,
"}"
,
"export interface RegistryAssetsConfig {"
,
" baseUrl?: string;"
,
" paths?: Partial<Record<\"component\" | \"handler\" | \"asyncSignal\" | \"partial\" | \"route\", string>>;"
,
"}"
,
"export interface LazyRegistry {"
,
" registryAssets: Required<Pick<RegistryAssetsConfig, \"baseUrl\">> & { paths: Record<string, string> };"
,
" resolveUrl(type: \"component\" | \"handler\" | \"asyncSignal\" | \"partial\" | \"route\", id: string, descriptor: LazyDescriptor): { moduleUrl: string; exportNames: string[]; url: string };"
,
" resolve<T = unknown>(type: \"component\" | \"handler\" | \"asyncSignal\" | \"partial\" | \"route\", id: string, descriptor: LazyDescriptor): Promise<T>;"
,
" inspect(): { registryAssets: unknown; modules: string[]; exports: string[] };"
,
"}"
,
""
,
"export interface TemplateResult {"
,
" readonly strings: TemplateStringsArray;"
,
" readonly values: readonly unknown[];"
,
"}"
,
""
,
"export interface Children {"
,
" readonly __asyncChildrenBrand: true;"
,
"}"
,
""
,
"export type SchedulerStrategy = \"microtask\" | \"manual\";"
,
"export type SchedulerPhase = \"binding\" | \"lifecycle\" | \"effect\" | \"async\" | \"post\" | string;"
,
"export interface SchedulerJob {"
,
" id: number;"
,
" phase: SchedulerPhase;"
,
" scope?: unknown;"
,
" boundary?: string;"
,
" key?: string;"
,
" canceled: boolean;"
,
" cancel(): void;"
,
"}"
,
"export interface SchedulerOptions {"
,
" strategy?: SchedulerStrategy;"
,
" phases?: SchedulerPhase[];"
,
" maxDepth?: number;"
,
" onError?(error: unknown, job: SchedulerJob): void;"
,
"}"
,
"export interface SchedulerInspection {"
,
" strategy: SchedulerStrategy;"
,
" phases: SchedulerPhase[];"
,
" pending: Record<string, number>;"
,
" scopesDestroyed: number;"
,
" flushing: boolean;"
,
" scheduled: boolean;"
,
"}"
,
"export interface Scheduler {"
,
" strategy: SchedulerStrategy;"
,
" phases: SchedulerPhase[];"
,
" batch<T>(fn: () => T): T;"
,
" enqueue(phase: SchedulerPhase, job: () => MaybePromise<unknown>, options?: { scope?: unknown; boundary?: string; key?: string }): Cleanup;"
,
" flush(): Promise<void>;"
,
" flushScope(scope: unknown): Promise<void>;"
,
" afterFlush(job: () => MaybePromise<unknown>, options?: { scope?: unknown; boundary?: string; key?: string }): Cleanup;"
,
" cancelScope(scope: unknown): this;"
,
" markScopeDestroyed(scope: unknown): this;"
,
" isScopeDestroyed(scope: unknown): boolean;"
,
" destroy(): void;"
,
" inspect(): SchedulerInspection;"
,
"}"
,
""
,
"export interface RequestContextStore {"
,
" run<T>(context: Record<string, unknown> | undefined, fn: () => T): T;"
,
" get(): Record<string, unknown> | undefined;"
,
" snapshot(): Record<string, unknown>;"
,
"}"
,
""
,
"export interface Signal<T = unknown> {"
,
" readonly kind: \"signal\";"
,
" value: T;"
,
" set(value: T): T;"
,
" update(fn: (value: T) => T): T;"
,
" subscribe(fn: (value: T) => void): Cleanup;"
,
" snapshot(): T;"
,
"}"
,
""
,
"export interface ComputedSignal<T = unknown> extends Omit<Signal<T>, \"kind\"> {"
,
" readonly kind: \"computed\";"
,
"}"
,
""
,
"export interface EffectDefinition {"
,
" readonly kind: \"effect\";"
,
" readonly fn: () => unknown;"
,
"}"
,
""
,
"export interface AsyncSignalSnapshot<T = unknown> {"
,
" value: T | undefined;"
,
" loading: boolean;"
,
" error: unknown;"
,
" status: AsyncSignalStatus;"
,
" version: number;"
,
"}"
,
""
,
"export interface AsyncSignal<T = unknown> extends Omit<Signal<T | undefined>, \"kind\" | \"snapshot\"> {"
,
" readonly kind: \"async-signal\";"
,
" readonly id: string;"
,
" readonly loading: boolean;"
,
" readonly error: unknown;"
,
" readonly status: AsyncSignalStatus;"
,
" readonly version: number;"
,
" refresh(): Promise<T | undefined>;"
,
" cancel(reason?: unknown): void;"
,
" snapshot(): AsyncSignalSnapshot<T>;"
,
"}"
,
""
,
"export interface SignalRef<T = unknown> {"
,
" readonly kind: \"signal-ref\";"
,
" readonly id: string;"
,
" value: T;"
,
" readonly loading: boolean;"
,
" readonly error: unknown;"
,
" readonly status: AsyncSignalStatus;"
,
" readonly version: number;"
,
" get(): T;"
,
" set(value: T): T;"
,
" update(fn: (value: T) => T): T;"
,
" subscribe(fn: (value: T, info?: SignalSubscriptionInfo) => void): Cleanup;"
,
" refresh(): Promise<T | undefined>;"
,
" cancel(reason?: unknown): void;"
,
" toString(): string;"
,
"}"
,
""
,
"export interface SignalSubscriptionInfo {"
,
" id: string;"
,
" path: string;"
,
" signal: unknown;"
,
"}"
,
""
,
"export type SignalLike<T = unknown> = Signal<T> | AsyncSignal<T> | ComputedSignal<T>;"
,
"export type SignalMap = Record<string, SignalLike | unknown>;"
,
""
,
"export interface AsyncSignalContext {"
,
" signals: SignalRegistry;"
,
" id: string;"
,
" version: number;"
,
" abort: AbortSignal & { cancel?(reason?: unknown): void };"
,
" server?: ServerNamespace;"
,
" router?: Router;"
,
" loader?: LoaderInstance;"
,
" cache?: CacheRegistry;"
,
" scheduler?: Scheduler;"
,
" refresh(): Promise<unknown>;"
,
"}"
,
""
,
"export type AsyncSignalFunction<T = unknown> = (this: AsyncSignalContext) => MaybePromise<T>;"
,
""
,
"export interface RegistryInspection<T = unknown> {"
,
" registry: RegistryStore;"
,
" keys(): string[];"
,
" entries(): Array<[string, T]>;"
,
" inspect(): Array<[string, T]>;"
,
"}"
,
""
,
"export interface SignalRegistry extends RegistryInspection {"
,
" register<T = unknown>(id: string, signalLike: SignalLike<T> | T): SignalRef<T>;"
,
" registerMany(map?: SignalMap): this;"
,
" unregister(id: string): boolean;"
,
" ensure<T = unknown>(id: string, initial: T): SignalRef<T>;"
,
" has(id: string): boolean;"
,
" get<T = unknown>(path: string): T;"
,
" set<T = unknown>(path: string, value: T): T;"
,
" update<T = unknown>(path: string, fn: (value: T) => T): T;"
,
" ref<T = unknown>(id: string): SignalRef<T>;"
,
" subscribe<T = unknown>(path: string, fn: (value: T, info: SignalSubscriptionInfo) => void): Cleanup;"
,
" snapshot(): Record<string, unknown>;"
,
" asyncSignal<T = unknown>(id: string, fn: AsyncSignalFunction<T>): SignalRef<T>;"
,
" effect(fn: () => unknown): Cleanup;"
,
" destroy(): void;"
,
"}"
,
""
,
"export interface HandlerContext {"
,
" signals: SignalRegistry;"
,
" handlers: HandlerRegistry;"
,
" server?: ServerNamespace;"
,
" loader?: LoaderInstance;"
,
" router?: Router;"
,
" cache?: CacheRegistry;"
,
" scheduler?: Scheduler;"
,
" event?: Event;"
,
" element?: Element;"
,
" el?: Element;"
,
" root?: Document | Element;"
,
" input?: unknown;"
,
" stop(): void;"
,
" [key: string]: unknown;"
,
"}"
,
""
,
"export type HandlerFunction = (this: HandlerContext, context: HandlerContext) => MaybePromise<unknown>;"
,
""
,
"export interface FlowRuntimeRef<T = unknown> {"
,
" readonly kind: string;"
,
" value: T;"
,
" get(): T;"
,
" set?(value: T): T;"
,
" update?(fn: (value: T) => T): T;"
,
" subscribe(fn: (value: T) => void): Cleanup;"
,
" snapshot(): T;"
,
"}"
,
"export interface FlowInstance {"
,
" store: Record<string, unknown>;"
,
" refs: Record<string, FlowRuntimeRef>;"
,
" handlers: Record<string, (input?: unknown) => MaybePromise<unknown>>;"
,
" get<T = unknown>(name: string): T;"
,
" set<T = unknown>(name: string, value: T): T;"
,
" update<T = unknown>(name: string, fn: (current: T) => T): T;"
,
" run(name: string, input?: unknown): MaybePromise<unknown>;"
,
" snapshot(): Record<string, unknown>;"
,
" restore(snapshot: Record<string, unknown>): void;"
,
" destroy(): void;"
,
"}"
,
"export type FlowStep = (store: Record<string, unknown>, input?: unknown) => MaybePromise<unknown>;"
,
"export type FlowPredicate = (store: Record<string, unknown>, input?: unknown) => boolean;"
,
"export type FlowSignalDeclaration<T = unknown> = T | { readonly kind: string; [key: string]: unknown } | FlowStep;"
,
"export interface FlowConfig {"
,
" store?: Record<string, FlowSignalDeclaration>;"
,
" on?: Record<string, FlowStep>;"
,
"}"
,
"export interface FlowDefinition {"
,
" readonly kind: \"flow\";"
,
" readonly definition: unknown;"
,
"}"
,
""
,
"export interface HandlerRegistry extends RegistryInspection<HandlerFunction> {"
,
" register(id: string, fn: HandlerFunction | LazyDescriptor): string;"
,
" registerMany(map?: Record<string, HandlerFunction | LazyDescriptor>): this;"
,
" unregister(id: string): boolean;"
,
" resolve(id: string): HandlerFunction | undefined;"
,
" run(ref: string, context?: Partial<HandlerContext>): Promise<unknown[]>;"
,
"}"
,
""
,
"export interface ServerEnvelope<T = unknown> {"
,
" value?: T;"
,
" signals?: Record<string, unknown>;"
,
" boundary?: string;"
,
" html?: TemplateLike;"
,
" redirect?: string;"
,
" error?: unknown;"
,
" status?: number;"
,
" cache?: { browser?: Record<string, unknown>; server?: Record<string, unknown> };"
,
"}"
,
""
,
"export type ServerResult<T = unknown> = T | ServerEnvelope<T>;"
,
""
,
"export interface ServerContext {"
,
" id: string;"
,
" args: unknown[];"
,
" input?: unknown;"
,
" signals?: SignalRegistry | { get(path: string): unknown; snapshot?(): Record<string, unknown> };"
,
" request?: Request;"
,
" headers?: Headers;"
,
" cookies?: unknown;"
,
" locals?: unknown;"
,
" abort?: AbortSignal;"
,
" cache?: CacheRegistry;"
,
" scheduler?: Scheduler;"
,
" server: ServerNamespace;"
,
" [key: string]: unknown;"
,
"}"
,
""
,
"export type ServerFunction<T = unknown> = (this: ServerContext, ...args: unknown[]) => MaybePromise<ServerResult<T>>;"
,
"export type ServerProxyTransport = (url: string, init: RequestInit) => MaybePromise<Response>;"
,
""
,
"export interface ServerNamespace {"
,
" run<T = unknown>(id: string, args?: unknown[], context?: Partial<ServerContext>): Promise<T>;"
,
" register?(id: string, fn: ServerFunction): string;"
,
" registerMany?(map?: Record<string, ServerFunction>): this;"
,
" unregister?(id: string): boolean;"
,
" resolve?(id: string): ServerFunction | undefined;"
,
" _setContext?(context?: Record<string, unknown>): this;"
,
" _withContext?(context?: Record<string, unknown>): ServerNamespace;"
,
" [key: string]: unknown;"
,
"}"
,
""
,
"export interface ServerProxyOptions {"
,
" endpoint?: string;"
,
" transport: ServerProxyTransport;"
,
" signals?: SignalRegistry;"
,
" loader?: LoaderInstance;"
,
" router?: Router;"
,
" cache?: CacheRegistry;"
,
" scheduler?: Scheduler;"
,
" headers?: Record<string, string>;"
,
"}"
,
""
,
"export interface CacheDefinition {"
,
" readonly kind: \"cache-definition\";"
,
" store: string;"
,
" ttl?: number;"
,
"}"
,
""
,
"export interface CacheRegistry extends RegistryInspection<CacheDefinition> {"
,
" register(id: string, definition?: CacheDefinition | CacheDefinitionOptions): string;"
,
" registerMany(map?: Record<string, CacheDefinition | CacheDefinitionOptions>): this;"
,
" unregister(id: string): boolean;"
,
" resolve(id: string): CacheDefinition | undefined;"
,
" get<T = unknown>(key: string): T | undefined;"
,
" set<T = unknown>(key: string, value: T, options?: CacheSetOptions): T;"
,
" getOrSet<T = unknown>(key: string, fn: () => MaybePromise<T>, options?: CacheSetOptions): Promise<T>;"
,
" delete(key: string): boolean;"
,
" clear(prefix?: string): this;"
,
" snapshot(): Record<string, unknown>;"
,
" restore(snapshot?: Record<string, unknown>): this;"
,
" entryKeys(): string[];"
,
" entryEntries(): Array<[string, unknown]>;"
,
"}"
,
""
,
"export interface CacheDefinitionOptions {"
,
" store?: string;"
,
" ttl?: number;"
,
"}"
,
""
,
"export interface CacheSetOptions {"
,
" ttl?: number;"
,
" cache?: string;"
,
"}"
,
""
,
"export interface PartialContext {"
,
" id: string;"
,
" props: Record<string, unknown>;"
,
" params?: Record<string, string>;"
,
" route?: RouteDefinition;"
,
" signals?: SignalRegistry;"
,
" handlers?: HandlerRegistry;"
,
" server?: ServerNamespace;"
,
" cache?: CacheRegistry;"
,
" browserCache?: CacheRegistry;"
,
" partials: PartialRegistry;"
,
" abort?: AbortSignal;"
,
" scheduler?: Scheduler;"
,
" request?: Request;"
,
" locals?: unknown;"
,
" [key: string]: unknown;"
,
"}"
,
""
,
"export type PartialFunction = (this: PartialContext, props: Record<string, unknown>) => MaybePromise<TemplateLike | ServerEnvelope>;"
,
""
,
"export interface PartialRegistry extends RegistryInspection<PartialFunction> {"
,
" register(id: string, fn: PartialFunction | LazyDescriptor): string;"
,
" registerMany(map?: Record<string, PartialFunction | LazyDescriptor>): this;"
,
" unregister(id: string): boolean;"
,
" resolve(id: string): PartialFunction | undefined;"
,
" render(id: string, props?: Record<string, unknown>, context?: Partial<PartialContext>): Promise<ServerEnvelope>;"
,
"}"
,
""
,
"export interface RouteDefinition {"
,
" partial?: string;"
,
" load?: string;"
,
" render?: RouteRenderMode;"
,
" meta?: Record<string, unknown>;"
,
" [key: string]: unknown;"
,
"}"
,
""
,
"export interface RouteMatch {"
,
" pattern: string;"
,
" params: Record<string, string>;"
,
" route: RouteDefinition;"
,
"}"
,
""
,
"export interface RouterNavigationOptions {"
,
" replace?: boolean;"
,
" initial?: boolean;"
,
" source?: string;"
,
" history?: boolean;"
,
" force?: boolean;"
,
"}"
,
""
,
"export interface RouteRegistry {"
,
" registry: RegistryStore;"
,
" register(pattern: string, definition: RouteDefinition | string): RouteMatch;"
,
" registerMany(map?: Record<string, RouteDefinition | string>): this;"
,
" unregister(pattern: string): boolean;"
,
" match(url: string | URL): RouteMatch | null;"
,
" entries(): Array<{ pattern: string; route: RouteDefinition }>;"
,
" keys(): string[];"
,
" inspect(): Array<[string, RouteDefinition]>;"
,
"}"
,
""
,
"export interface RouterOptions {"
,
" mode?: RouterMode;"
,
" urlMode?: RouterUrlMode;"
,
" root?: Document | Element;"
,
" boundary?: string;"
,
" loader?: LoaderInstance;"
,
" handlers?: HandlerRegistry;"
,
" server?: ServerNamespace;"
,
" cache?: CacheRegistry;"
,
" attributes?: AttributeConfig;"
,
" scheduler?: Scheduler;"
,
" onError?: AsyncErrorHandler;"
,
"}"
,
""
,
"export interface Router {"
,
" mode: RouterMode;"
,
" urlMode: RouterUrlMode;"
,
" root: Document | Element;"
,
" boundary: string;"
,
" routes: RouteRegistry;"
,
" loader: LoaderInstance;"
,
" signals: SignalRegistry;"
,
" handlers: HandlerRegistry;"
,
" server?: ServerNamespace;"
,
" cache?: CacheRegistry;"
,
" partials?: PartialRegistry;"
,
" scheduler: Scheduler;"
,
" attributes: NormalizedAttributeConfig;"
,
" onError?: AsyncErrorHandler;"
,
" start(): this;"
,
" match(url: string | URL): RouteMatch | null;"
,
" prefetch(url: string | URL): Promise<unknown>;"
,
" navigate(url: string | URL, options?: RouterNavigationOptions): Promise<unknown>;"
,
" destroy(): void;"
,
"}"
,
""
,
"export interface AsyncRouterFacadeInspection {"
,
" ready: boolean;"
,
" pending: number;"
,
" mode?: RouterMode;"
,
" urlMode?: RouterUrlMode;"
,
"}"
,
""
,
"export interface AsyncRouterFacade {"
,
" loader: AsyncLoaderFacade;"
,
" readonly current?: Router;"
,
" ready(): Promise<Router>;"
,
" match(url: string | URL): RouteMatch | null;"
,
" navigate(url: string | URL, options?: RouterNavigationOptions): Promise<unknown>;"
,
" prefetch(url: string | URL): Promise<unknown>;"
,
" inspect(): AsyncRouterFacadeInspection;"
,
"}"
,
""
,
"export type LifecycleEventName = \"attach\" | \"visible\" | \"intersect\" | \"destroy\";"
,
""
,
"export interface IntersectionFallbackEntry {"
,
" target: Element;"
,
" isIntersecting: boolean;"
,
" intersectionRatio: number;"
,
" time: number;"
,
" rootBounds: DOMRectReadOnly | null;"
,
" boundingClientRect: DOMRect | DOMRectReadOnly | null;"
,
" intersectionRect: DOMRect | DOMRectReadOnly | null;"
,
"}"
,
""
,
"export interface IntersectionEvent {"
,
" target: Element;"
,
" element: Element;"
,
" el: Element;"
,
" root: Document | Element | DocumentFragment;"
,
" entry: IntersectionObserverEntry | IntersectionFallbackEntry;"
,
" entries: Array<IntersectionObserverEntry | IntersectionFallbackEntry>;"
,
" observer: IntersectionObserver | null;"
,
" isIntersecting: boolean;"
,
" intersectionRatio: number;"
,
" unsupported: boolean;"
,
"}"
,
""
,
"export interface IntersectionOptions {"
,
" root?: Element | Document | null;"
,
" rootMargin?: string;"
,
" threshold?: number | number[];"
,
" once?: boolean;"
,
" schedule?: \"lifecycle\" | \"sync\";"
,
" key?: string;"
,
"}"
,
""
,
"export type LoaderSwapStrategy = \"replace\" | \"morph\";"
,
"export type LoaderSwapAttach = \"preserve\" | \"rebind\";"
,
"export interface LoaderSwapOptions {"
,
" scan?: LoaderSwapScan;"
,
" strategy?: LoaderSwapStrategy;"
,
" attach?: LoaderSwapAttach;"
,
"}"
,
"export interface LoaderSwapManyOptions {"
,
" scan?: LoaderSwapManyScan;"
,
" strategy?: LoaderSwapStrategy;"
,
" ifChanged?: boolean;"
,
" attach?: LoaderSwapAttach;"
,
"}"
,
"export interface LoaderSwapManyEntry {"
,
" html: TemplateLike | LoaderSwapRenderFunction;"
,
" strategy?: LoaderSwapStrategy;"
,
" attach?: LoaderSwapAttach;"
,
"}"
,
"export type LoaderSwapManyUpdateValue = TemplateLike | LoaderSwapRenderFunction | LoaderSwapManyEntry;"
,
"export interface LoaderSwapBindOptions extends LoaderSwapOptions {"
,
" deps?: string[];"
,
"}"
,
View remainder of file in raw view
Back
|
FazBrowse Home
|
New Git URL