@genesislcap/foundation-utils 14.387.0 → 14.387.1-alpha-8fa3775.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +211 -135
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/noop.d.ts +23 -0
- package/dist/dts/utils/noop.d.ts.map +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/noop.js +31 -0
- package/dist/foundation-utils.api.json +82 -0
- package/dist/foundation-utils.d.ts +24 -0
- package/docs/api/foundation-utils.avoidtreeshaking.md +56 -0
- package/docs/api/foundation-utils.md +26 -0
- package/docs/api/foundation-utils.noop.md +56 -0
- package/docs/api-report.md.api.md +6 -0
- package/package.json +11 -11
|
@@ -391,6 +391,126 @@
|
|
|
391
391
|
}
|
|
392
392
|
]
|
|
393
393
|
},
|
|
394
|
+
{
|
|
395
|
+
"kind": "javascript-module",
|
|
396
|
+
"path": "src/design-system/design-system.ts",
|
|
397
|
+
"declarations": [
|
|
398
|
+
{
|
|
399
|
+
"kind": "function",
|
|
400
|
+
"name": "assureDesignSystem",
|
|
401
|
+
"return": {
|
|
402
|
+
"type": {
|
|
403
|
+
"text": "DesignSystemModule"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
"parameters": [
|
|
407
|
+
{
|
|
408
|
+
"name": "module",
|
|
409
|
+
"type": {
|
|
410
|
+
"text": "DesignSystemModule"
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"description": "assureDesignSystem.",
|
|
415
|
+
"privacy": "public"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"kind": "function",
|
|
419
|
+
"name": "getCurrentDesignSystem",
|
|
420
|
+
"return": {
|
|
421
|
+
"type": {
|
|
422
|
+
"text": ""
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"parameters": [
|
|
426
|
+
{
|
|
427
|
+
"name": "element",
|
|
428
|
+
"type": {
|
|
429
|
+
"text": "HTMLElement"
|
|
430
|
+
},
|
|
431
|
+
"description": "The starting HTML element"
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"name": "fallbackPrefix",
|
|
435
|
+
"type": {
|
|
436
|
+
"text": "string"
|
|
437
|
+
},
|
|
438
|
+
"description": "The prefix to fallback to if the provider is not available"
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
"description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
442
|
+
"privacy": "public"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"kind": "function",
|
|
446
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
447
|
+
"return": {
|
|
448
|
+
"type": {
|
|
449
|
+
"text": ""
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"parameters": [
|
|
453
|
+
{
|
|
454
|
+
"name": "element",
|
|
455
|
+
"type": {
|
|
456
|
+
"text": "HTMLElement"
|
|
457
|
+
},
|
|
458
|
+
"description": "The starting HTML element"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
"name": "fallbackPrefix",
|
|
462
|
+
"type": {
|
|
463
|
+
"text": "string"
|
|
464
|
+
},
|
|
465
|
+
"description": "The prefix to fallback to if the provider is not available"
|
|
466
|
+
}
|
|
467
|
+
],
|
|
468
|
+
"description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
469
|
+
"privacy": "public"
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"exports": [
|
|
473
|
+
{
|
|
474
|
+
"kind": "js",
|
|
475
|
+
"name": "assureDesignSystem",
|
|
476
|
+
"declaration": {
|
|
477
|
+
"name": "assureDesignSystem",
|
|
478
|
+
"module": "src/design-system/design-system.ts"
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"kind": "js",
|
|
483
|
+
"name": "getCurrentDesignSystem",
|
|
484
|
+
"declaration": {
|
|
485
|
+
"name": "getCurrentDesignSystem",
|
|
486
|
+
"module": "src/design-system/design-system.ts"
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"kind": "js",
|
|
491
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
492
|
+
"declaration": {
|
|
493
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
494
|
+
"module": "src/design-system/design-system.ts"
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
]
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"kind": "javascript-module",
|
|
501
|
+
"path": "src/design-system/index.ts",
|
|
502
|
+
"declarations": [],
|
|
503
|
+
"exports": [
|
|
504
|
+
{
|
|
505
|
+
"kind": "js",
|
|
506
|
+
"name": "*",
|
|
507
|
+
"declaration": {
|
|
508
|
+
"name": "*",
|
|
509
|
+
"package": "./design-system"
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
]
|
|
513
|
+
},
|
|
394
514
|
{
|
|
395
515
|
"kind": "javascript-module",
|
|
396
516
|
"path": "src/decorators/index.ts",
|
|
@@ -467,21 +587,6 @@
|
|
|
467
587
|
}
|
|
468
588
|
]
|
|
469
589
|
},
|
|
470
|
-
{
|
|
471
|
-
"kind": "javascript-module",
|
|
472
|
-
"path": "src/encoding/index.ts",
|
|
473
|
-
"declarations": [],
|
|
474
|
-
"exports": [
|
|
475
|
-
{
|
|
476
|
-
"kind": "js",
|
|
477
|
-
"name": "*",
|
|
478
|
-
"declaration": {
|
|
479
|
-
"name": "*",
|
|
480
|
-
"package": "./base64"
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
]
|
|
484
|
-
},
|
|
485
590
|
{
|
|
486
591
|
"kind": "javascript-module",
|
|
487
592
|
"path": "src/env/index.ts",
|
|
@@ -957,126 +1062,6 @@
|
|
|
957
1062
|
}
|
|
958
1063
|
]
|
|
959
1064
|
},
|
|
960
|
-
{
|
|
961
|
-
"kind": "javascript-module",
|
|
962
|
-
"path": "src/design-system/design-system.ts",
|
|
963
|
-
"declarations": [
|
|
964
|
-
{
|
|
965
|
-
"kind": "function",
|
|
966
|
-
"name": "assureDesignSystem",
|
|
967
|
-
"return": {
|
|
968
|
-
"type": {
|
|
969
|
-
"text": "DesignSystemModule"
|
|
970
|
-
}
|
|
971
|
-
},
|
|
972
|
-
"parameters": [
|
|
973
|
-
{
|
|
974
|
-
"name": "module",
|
|
975
|
-
"type": {
|
|
976
|
-
"text": "DesignSystemModule"
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
],
|
|
980
|
-
"description": "assureDesignSystem.",
|
|
981
|
-
"privacy": "public"
|
|
982
|
-
},
|
|
983
|
-
{
|
|
984
|
-
"kind": "function",
|
|
985
|
-
"name": "getCurrentDesignSystem",
|
|
986
|
-
"return": {
|
|
987
|
-
"type": {
|
|
988
|
-
"text": ""
|
|
989
|
-
}
|
|
990
|
-
},
|
|
991
|
-
"parameters": [
|
|
992
|
-
{
|
|
993
|
-
"name": "element",
|
|
994
|
-
"type": {
|
|
995
|
-
"text": "HTMLElement"
|
|
996
|
-
},
|
|
997
|
-
"description": "The starting HTML element"
|
|
998
|
-
},
|
|
999
|
-
{
|
|
1000
|
-
"name": "fallbackPrefix",
|
|
1001
|
-
"type": {
|
|
1002
|
-
"text": "string"
|
|
1003
|
-
},
|
|
1004
|
-
"description": "The prefix to fallback to if the provider is not available"
|
|
1005
|
-
}
|
|
1006
|
-
],
|
|
1007
|
-
"description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
1008
|
-
"privacy": "public"
|
|
1009
|
-
},
|
|
1010
|
-
{
|
|
1011
|
-
"kind": "function",
|
|
1012
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
1013
|
-
"return": {
|
|
1014
|
-
"type": {
|
|
1015
|
-
"text": ""
|
|
1016
|
-
}
|
|
1017
|
-
},
|
|
1018
|
-
"parameters": [
|
|
1019
|
-
{
|
|
1020
|
-
"name": "element",
|
|
1021
|
-
"type": {
|
|
1022
|
-
"text": "HTMLElement"
|
|
1023
|
-
},
|
|
1024
|
-
"description": "The starting HTML element"
|
|
1025
|
-
},
|
|
1026
|
-
{
|
|
1027
|
-
"name": "fallbackPrefix",
|
|
1028
|
-
"type": {
|
|
1029
|
-
"text": "string"
|
|
1030
|
-
},
|
|
1031
|
-
"description": "The prefix to fallback to if the provider is not available"
|
|
1032
|
-
}
|
|
1033
|
-
],
|
|
1034
|
-
"description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
|
|
1035
|
-
"privacy": "public"
|
|
1036
|
-
}
|
|
1037
|
-
],
|
|
1038
|
-
"exports": [
|
|
1039
|
-
{
|
|
1040
|
-
"kind": "js",
|
|
1041
|
-
"name": "assureDesignSystem",
|
|
1042
|
-
"declaration": {
|
|
1043
|
-
"name": "assureDesignSystem",
|
|
1044
|
-
"module": "src/design-system/design-system.ts"
|
|
1045
|
-
}
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
"kind": "js",
|
|
1049
|
-
"name": "getCurrentDesignSystem",
|
|
1050
|
-
"declaration": {
|
|
1051
|
-
"name": "getCurrentDesignSystem",
|
|
1052
|
-
"module": "src/design-system/design-system.ts"
|
|
1053
|
-
}
|
|
1054
|
-
},
|
|
1055
|
-
{
|
|
1056
|
-
"kind": "js",
|
|
1057
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
1058
|
-
"declaration": {
|
|
1059
|
-
"name": "getCurrentDesignSystemPrefix",
|
|
1060
|
-
"module": "src/design-system/design-system.ts"
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
]
|
|
1064
|
-
},
|
|
1065
|
-
{
|
|
1066
|
-
"kind": "javascript-module",
|
|
1067
|
-
"path": "src/design-system/index.ts",
|
|
1068
|
-
"declarations": [],
|
|
1069
|
-
"exports": [
|
|
1070
|
-
{
|
|
1071
|
-
"kind": "js",
|
|
1072
|
-
"name": "*",
|
|
1073
|
-
"declaration": {
|
|
1074
|
-
"name": "*",
|
|
1075
|
-
"package": "./design-system"
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
]
|
|
1079
|
-
},
|
|
1080
1065
|
{
|
|
1081
1066
|
"kind": "javascript-module",
|
|
1082
1067
|
"path": "src/error/errorMap.ts",
|
|
@@ -1276,6 +1261,21 @@
|
|
|
1276
1261
|
}
|
|
1277
1262
|
]
|
|
1278
1263
|
},
|
|
1264
|
+
{
|
|
1265
|
+
"kind": "javascript-module",
|
|
1266
|
+
"path": "src/encoding/index.ts",
|
|
1267
|
+
"declarations": [],
|
|
1268
|
+
"exports": [
|
|
1269
|
+
{
|
|
1270
|
+
"kind": "js",
|
|
1271
|
+
"name": "*",
|
|
1272
|
+
"declaration": {
|
|
1273
|
+
"name": "*",
|
|
1274
|
+
"package": "./base64"
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
]
|
|
1278
|
+
},
|
|
1279
1279
|
{
|
|
1280
1280
|
"kind": "javascript-module",
|
|
1281
1281
|
"path": "src/feature-flags/featureFlags.ts",
|
|
@@ -3753,6 +3753,14 @@
|
|
|
3753
3753
|
"name": "*",
|
|
3754
3754
|
"package": "./logger"
|
|
3755
3755
|
}
|
|
3756
|
+
},
|
|
3757
|
+
{
|
|
3758
|
+
"kind": "js",
|
|
3759
|
+
"name": "*",
|
|
3760
|
+
"declaration": {
|
|
3761
|
+
"name": "*",
|
|
3762
|
+
"package": "./noop"
|
|
3763
|
+
}
|
|
3756
3764
|
}
|
|
3757
3765
|
]
|
|
3758
3766
|
},
|
|
@@ -3778,6 +3786,74 @@
|
|
|
3778
3786
|
}
|
|
3779
3787
|
]
|
|
3780
3788
|
},
|
|
3789
|
+
{
|
|
3790
|
+
"kind": "javascript-module",
|
|
3791
|
+
"path": "src/utils/noop.ts",
|
|
3792
|
+
"declarations": [
|
|
3793
|
+
{
|
|
3794
|
+
"kind": "function",
|
|
3795
|
+
"name": "noop",
|
|
3796
|
+
"return": {
|
|
3797
|
+
"type": {
|
|
3798
|
+
"text": "void"
|
|
3799
|
+
}
|
|
3800
|
+
},
|
|
3801
|
+
"parameters": [
|
|
3802
|
+
{
|
|
3803
|
+
"name": "fn",
|
|
3804
|
+
"optional": true,
|
|
3805
|
+
"type": {
|
|
3806
|
+
"text": "() => void"
|
|
3807
|
+
}
|
|
3808
|
+
},
|
|
3809
|
+
{
|
|
3810
|
+
"description": "An optional function to execute for its side effects.",
|
|
3811
|
+
"name": "callback"
|
|
3812
|
+
}
|
|
3813
|
+
],
|
|
3814
|
+
"description": "A no-operation function that executes an optional callback.\n\nThis is a lower-level utility function. For preventing tree-shaking of custom elements,\nprefer using avoidTreeShaking which provides a more explicit API.",
|
|
3815
|
+
"privacy": "public"
|
|
3816
|
+
},
|
|
3817
|
+
{
|
|
3818
|
+
"kind": "function",
|
|
3819
|
+
"name": "avoidTreeShaking",
|
|
3820
|
+
"return": {
|
|
3821
|
+
"type": {
|
|
3822
|
+
"text": "void"
|
|
3823
|
+
}
|
|
3824
|
+
},
|
|
3825
|
+
"parameters": [
|
|
3826
|
+
{
|
|
3827
|
+
"name": "classes",
|
|
3828
|
+
"type": {
|
|
3829
|
+
"text": "unknown[]"
|
|
3830
|
+
},
|
|
3831
|
+
"description": "One or more custom element classes that should not be tree-shaken."
|
|
3832
|
+
}
|
|
3833
|
+
],
|
|
3834
|
+
"description": "Explicitly prevents tree-shaking of custom element classes by referencing them.\n\nBundlers may incorrectly remove code that it thinks has no side effects,\nsuch as custom element definitions that are only referenced in templates.\nBy passing these classes to `avoidTreeShaking`, we create a side effect\nthat signals to the bundler to preserve the code.",
|
|
3835
|
+
"privacy": "public"
|
|
3836
|
+
}
|
|
3837
|
+
],
|
|
3838
|
+
"exports": [
|
|
3839
|
+
{
|
|
3840
|
+
"kind": "js",
|
|
3841
|
+
"name": "noop",
|
|
3842
|
+
"declaration": {
|
|
3843
|
+
"name": "noop",
|
|
3844
|
+
"module": "src/utils/noop.ts"
|
|
3845
|
+
}
|
|
3846
|
+
},
|
|
3847
|
+
{
|
|
3848
|
+
"kind": "js",
|
|
3849
|
+
"name": "avoidTreeShaking",
|
|
3850
|
+
"declaration": {
|
|
3851
|
+
"name": "avoidTreeShaking",
|
|
3852
|
+
"module": "src/utils/noop.ts"
|
|
3853
|
+
}
|
|
3854
|
+
}
|
|
3855
|
+
]
|
|
3856
|
+
},
|
|
3781
3857
|
{
|
|
3782
3858
|
"kind": "javascript-module",
|
|
3783
3859
|
"path": "src/utils/os-platform.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A no-operation function that executes an optional callback.
|
|
3
|
+
*
|
|
4
|
+
* This is a lower-level utility function. For preventing tree-shaking of custom elements,
|
|
5
|
+
* prefer using {@link avoidTreeShaking} which provides a more explicit API.
|
|
6
|
+
*
|
|
7
|
+
* @param callback - An optional function to execute for its side effects.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare const noop: (fn?: () => void) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Explicitly prevents tree-shaking of custom element classes by referencing them.
|
|
13
|
+
*
|
|
14
|
+
* Bundlers may incorrectly remove code that it thinks has no side effects,
|
|
15
|
+
* such as custom element definitions that are only referenced in templates.
|
|
16
|
+
* By passing these classes to `avoidTreeShaking`, we create a side effect
|
|
17
|
+
* that signals to the bundler to preserve the code.
|
|
18
|
+
*
|
|
19
|
+
* @param classes - One or more custom element classes that should not be tree-shaken.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare const avoidTreeShaking: (...classes: unknown[]) => void;
|
|
23
|
+
//# sourceMappingURL=noop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../src/utils/noop.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GAAI,KAAK,MAAM,IAAI,KAAG,IAEtC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAAI,GAAG,SAAS,OAAO,EAAE,KAAG,IAOxD,CAAC"}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A no-operation function that executes an optional callback.
|
|
3
|
+
*
|
|
4
|
+
* This is a lower-level utility function. For preventing tree-shaking of custom elements,
|
|
5
|
+
* prefer using {@link avoidTreeShaking} which provides a more explicit API.
|
|
6
|
+
*
|
|
7
|
+
* @param callback - An optional function to execute for its side effects.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export const noop = (fn) => {
|
|
11
|
+
fn === null || fn === void 0 ? void 0 : fn();
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Explicitly prevents tree-shaking of custom element classes by referencing them.
|
|
15
|
+
*
|
|
16
|
+
* Bundlers may incorrectly remove code that it thinks has no side effects,
|
|
17
|
+
* such as custom element definitions that are only referenced in templates.
|
|
18
|
+
* By passing these classes to `avoidTreeShaking`, we create a side effect
|
|
19
|
+
* that signals to the bundler to preserve the code.
|
|
20
|
+
*
|
|
21
|
+
* @param classes - One or more custom element classes that should not be tree-shaken.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export const avoidTreeShaking = (...classes) => {
|
|
25
|
+
noop(() => {
|
|
26
|
+
// Reference each class to prevent tree-shaking
|
|
27
|
+
classes.forEach((cls) => {
|
|
28
|
+
void cls;
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -297,6 +297,47 @@
|
|
|
297
297
|
],
|
|
298
298
|
"name": "assureDesignSystem"
|
|
299
299
|
},
|
|
300
|
+
{
|
|
301
|
+
"kind": "Function",
|
|
302
|
+
"canonicalReference": "@genesislcap/foundation-utils!avoidTreeShaking:function(1)",
|
|
303
|
+
"docComment": "/**\n * Explicitly prevents tree-shaking of custom element classes by referencing them.\n *\n * Bundlers may incorrectly remove code that it thinks has no side effects, such as custom element definitions that are only referenced in templates. By passing these classes to `avoidTreeShaking`, we create a side effect that signals to the bundler to preserve the code.\n *\n * @param classes - One or more custom element classes that should not be tree-shaken.\n *\n * @public\n */\n",
|
|
304
|
+
"excerptTokens": [
|
|
305
|
+
{
|
|
306
|
+
"kind": "Content",
|
|
307
|
+
"text": "avoidTreeShaking: (...classes: "
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"kind": "Content",
|
|
311
|
+
"text": "unknown[]"
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"kind": "Content",
|
|
315
|
+
"text": ") => "
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"kind": "Content",
|
|
319
|
+
"text": "void"
|
|
320
|
+
}
|
|
321
|
+
],
|
|
322
|
+
"fileUrlPath": "src/utils/noop.ts",
|
|
323
|
+
"returnTypeTokenRange": {
|
|
324
|
+
"startIndex": 3,
|
|
325
|
+
"endIndex": 4
|
|
326
|
+
},
|
|
327
|
+
"releaseTag": "Public",
|
|
328
|
+
"overloadIndex": 1,
|
|
329
|
+
"parameters": [
|
|
330
|
+
{
|
|
331
|
+
"parameterName": "classes",
|
|
332
|
+
"parameterTypeTokenRange": {
|
|
333
|
+
"startIndex": 1,
|
|
334
|
+
"endIndex": 2
|
|
335
|
+
},
|
|
336
|
+
"isOptional": false
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
"name": "avoidTreeShaking"
|
|
340
|
+
},
|
|
300
341
|
{
|
|
301
342
|
"kind": "Variable",
|
|
302
343
|
"canonicalReference": "@genesislcap/foundation-utils!BUILDER:var",
|
|
@@ -12257,6 +12298,47 @@
|
|
|
12257
12298
|
],
|
|
12258
12299
|
"name": "mapJsonSchemaFieldToExprBuilderField"
|
|
12259
12300
|
},
|
|
12301
|
+
{
|
|
12302
|
+
"kind": "Function",
|
|
12303
|
+
"canonicalReference": "@genesislcap/foundation-utils!noop:function(1)",
|
|
12304
|
+
"docComment": "/**\n * A no-operation function that executes an optional callback.\n *\n * This is a lower-level utility function. For preventing tree-shaking of custom elements, prefer using {@link avoidTreeShaking} which provides a more explicit API.\n *\n * @param callback - An optional function to execute for its side effects.\n *\n * @public\n */\n",
|
|
12305
|
+
"excerptTokens": [
|
|
12306
|
+
{
|
|
12307
|
+
"kind": "Content",
|
|
12308
|
+
"text": "noop: (fn?: "
|
|
12309
|
+
},
|
|
12310
|
+
{
|
|
12311
|
+
"kind": "Content",
|
|
12312
|
+
"text": "() => void"
|
|
12313
|
+
},
|
|
12314
|
+
{
|
|
12315
|
+
"kind": "Content",
|
|
12316
|
+
"text": ") => "
|
|
12317
|
+
},
|
|
12318
|
+
{
|
|
12319
|
+
"kind": "Content",
|
|
12320
|
+
"text": "void"
|
|
12321
|
+
}
|
|
12322
|
+
],
|
|
12323
|
+
"fileUrlPath": "src/utils/noop.ts",
|
|
12324
|
+
"returnTypeTokenRange": {
|
|
12325
|
+
"startIndex": 3,
|
|
12326
|
+
"endIndex": 4
|
|
12327
|
+
},
|
|
12328
|
+
"releaseTag": "Public",
|
|
12329
|
+
"overloadIndex": 1,
|
|
12330
|
+
"parameters": [
|
|
12331
|
+
{
|
|
12332
|
+
"parameterName": "fn",
|
|
12333
|
+
"parameterTypeTokenRange": {
|
|
12334
|
+
"startIndex": 1,
|
|
12335
|
+
"endIndex": 2
|
|
12336
|
+
},
|
|
12337
|
+
"isOptional": true
|
|
12338
|
+
}
|
|
12339
|
+
],
|
|
12340
|
+
"name": "noop"
|
|
12341
|
+
},
|
|
12260
12342
|
{
|
|
12261
12343
|
"kind": "Class",
|
|
12262
12344
|
"canonicalReference": "@genesislcap/foundation-utils!NumberParser:class",
|
|
@@ -77,6 +77,19 @@ export declare let API_HOST: string;
|
|
|
77
77
|
*/
|
|
78
78
|
export declare function assureDesignSystem(module: DesignSystemModule): DesignSystemModule;
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Explicitly prevents tree-shaking of custom element classes by referencing them.
|
|
82
|
+
*
|
|
83
|
+
* Bundlers may incorrectly remove code that it thinks has no side effects,
|
|
84
|
+
* such as custom element definitions that are only referenced in templates.
|
|
85
|
+
* By passing these classes to `avoidTreeShaking`, we create a side effect
|
|
86
|
+
* that signals to the bundler to preserve the code.
|
|
87
|
+
*
|
|
88
|
+
* @param classes - One or more custom element classes that should not be tree-shaken.
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export declare const avoidTreeShaking: (...classes: unknown[]) => void;
|
|
92
|
+
|
|
80
93
|
/**
|
|
81
94
|
* @internal
|
|
82
95
|
*/
|
|
@@ -1479,6 +1492,17 @@ string,
|
|
|
1479
1492
|
Genesis.FieldJsonSchema
|
|
1480
1493
|
]): Types.Field | null;
|
|
1481
1494
|
|
|
1495
|
+
/**
|
|
1496
|
+
* A no-operation function that executes an optional callback.
|
|
1497
|
+
*
|
|
1498
|
+
* This is a lower-level utility function. For preventing tree-shaking of custom elements,
|
|
1499
|
+
* prefer using {@link avoidTreeShaking} which provides a more explicit API.
|
|
1500
|
+
*
|
|
1501
|
+
* @param callback - An optional function to execute for its side effects.
|
|
1502
|
+
* @public
|
|
1503
|
+
*/
|
|
1504
|
+
export declare const noop: (fn?: () => void) => void;
|
|
1505
|
+
|
|
1482
1506
|
/**
|
|
1483
1507
|
* @public
|
|
1484
1508
|
*/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [avoidTreeShaking](./foundation-utils.avoidtreeshaking.md)
|
|
4
|
+
|
|
5
|
+
## avoidTreeShaking() function
|
|
6
|
+
|
|
7
|
+
Explicitly prevents tree-shaking of custom element classes by referencing them.
|
|
8
|
+
|
|
9
|
+
Bundlers may incorrectly remove code that it thinks has no side effects, such as custom element definitions that are only referenced in templates. By passing these classes to `avoidTreeShaking`<!-- -->, we create a side effect that signals to the bundler to preserve the code.
|
|
10
|
+
|
|
11
|
+
**Signature:**
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
avoidTreeShaking: (...classes: unknown[]) => void
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
<table><thead><tr><th>
|
|
20
|
+
|
|
21
|
+
Parameter
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
</th><th>
|
|
25
|
+
|
|
26
|
+
Type
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</th><th>
|
|
30
|
+
|
|
31
|
+
Description
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
</th></tr></thead>
|
|
35
|
+
<tbody><tr><td>
|
|
36
|
+
|
|
37
|
+
classes
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
</td><td>
|
|
41
|
+
|
|
42
|
+
unknown\[\]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
</td><td>
|
|
46
|
+
|
|
47
|
+
One or more custom element classes that should not be tree-shaken.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
</td></tr>
|
|
51
|
+
</tbody></table>
|
|
52
|
+
|
|
53
|
+
**Returns:**
|
|
54
|
+
|
|
55
|
+
void
|
|
56
|
+
|
|
@@ -192,6 +192,19 @@ Description
|
|
|
192
192
|
assureDesignSystem.
|
|
193
193
|
|
|
194
194
|
|
|
195
|
+
</td></tr>
|
|
196
|
+
<tr><td>
|
|
197
|
+
|
|
198
|
+
[avoidTreeShaking(classes)](./foundation-utils.avoidtreeshaking.md)
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
</td><td>
|
|
202
|
+
|
|
203
|
+
Explicitly prevents tree-shaking of custom element classes by referencing them.
|
|
204
|
+
|
|
205
|
+
Bundlers may incorrectly remove code that it thinks has no side effects, such as custom element definitions that are only referenced in templates. By passing these classes to `avoidTreeShaking`<!-- -->, we create a side effect that signals to the bundler to preserve the code.
|
|
206
|
+
|
|
207
|
+
|
|
195
208
|
</td></tr>
|
|
196
209
|
<tr><td>
|
|
197
210
|
|
|
@@ -542,6 +555,19 @@ Maps fields contained in a JSON schema block enhanced with genesisType metadata
|
|
|
542
555
|
Only sets the properties that are \*required\*. Optional properties, such as `defaultValue`<!-- -->, must be explicitly set by the user separately.
|
|
543
556
|
|
|
544
557
|
|
|
558
|
+
</td></tr>
|
|
559
|
+
<tr><td>
|
|
560
|
+
|
|
561
|
+
[noop(fn)](./foundation-utils.noop.md)
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
</td><td>
|
|
565
|
+
|
|
566
|
+
A no-operation function that executes an optional callback.
|
|
567
|
+
|
|
568
|
+
This is a lower-level utility function. For preventing tree-shaking of custom elements, prefer using [avoidTreeShaking()](./foundation-utils.avoidtreeshaking.md) which provides a more explicit API.
|
|
569
|
+
|
|
570
|
+
|
|
545
571
|
</td></tr>
|
|
546
572
|
<tr><td>
|
|
547
573
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [noop](./foundation-utils.noop.md)
|
|
4
|
+
|
|
5
|
+
## noop() function
|
|
6
|
+
|
|
7
|
+
A no-operation function that executes an optional callback.
|
|
8
|
+
|
|
9
|
+
This is a lower-level utility function. For preventing tree-shaking of custom elements, prefer using [avoidTreeShaking()](./foundation-utils.avoidtreeshaking.md) which provides a more explicit API.
|
|
10
|
+
|
|
11
|
+
**Signature:**
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
noop: (fn?: () => void) => void
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
<table><thead><tr><th>
|
|
20
|
+
|
|
21
|
+
Parameter
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
</th><th>
|
|
25
|
+
|
|
26
|
+
Type
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</th><th>
|
|
30
|
+
|
|
31
|
+
Description
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
</th></tr></thead>
|
|
35
|
+
<tbody><tr><td>
|
|
36
|
+
|
|
37
|
+
fn
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
</td><td>
|
|
41
|
+
|
|
42
|
+
() => void
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
</td><td>
|
|
46
|
+
|
|
47
|
+
_(Optional)_
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
</td></tr>
|
|
51
|
+
</tbody></table>
|
|
52
|
+
|
|
53
|
+
**Returns:**
|
|
54
|
+
|
|
55
|
+
void
|
|
56
|
+
|
|
@@ -35,6 +35,9 @@ export let API_HOST: string;
|
|
|
35
35
|
// @public
|
|
36
36
|
export function assureDesignSystem(module: DesignSystemModule): DesignSystemModule;
|
|
37
37
|
|
|
38
|
+
// @public
|
|
39
|
+
export const avoidTreeShaking: (...classes: unknown[]) => void;
|
|
40
|
+
|
|
38
41
|
// Warning: (ae-internal-missing-underscore) The name "BIG_INT_64_BITS" should be prefixed with an underscore because the declaration is marked as @internal
|
|
39
42
|
//
|
|
40
43
|
// @internal (undocumented)
|
|
@@ -973,6 +976,9 @@ string,
|
|
|
973
976
|
Genesis.FieldJsonSchema
|
|
974
977
|
]): Types.Field | null;
|
|
975
978
|
|
|
979
|
+
// @public
|
|
980
|
+
export const noop: (fn?: () => void) => void;
|
|
981
|
+
|
|
976
982
|
// @public (undocumented)
|
|
977
983
|
export class NumberParser {
|
|
978
984
|
constructor(locale: string);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-utils",
|
|
3
3
|
"description": "Genesis Foundation Utils",
|
|
4
|
-
"version": "14.387.0",
|
|
4
|
+
"version": "14.387.1-alpha-8fa3775.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@genesislcap/foundation-testing": "14.387.0",
|
|
31
|
-
"@genesislcap/genx": "14.387.0",
|
|
32
|
-
"@genesislcap/rollup-builder": "14.387.0",
|
|
33
|
-
"@genesislcap/ts-builder": "14.387.0",
|
|
34
|
-
"@genesislcap/uvu-playwright-builder": "14.387.0",
|
|
35
|
-
"@genesislcap/vite-builder": "14.387.0",
|
|
36
|
-
"@genesislcap/webpack-builder": "14.387.0",
|
|
30
|
+
"@genesislcap/foundation-testing": "14.387.1-alpha-8fa3775.0",
|
|
31
|
+
"@genesislcap/genx": "14.387.1-alpha-8fa3775.0",
|
|
32
|
+
"@genesislcap/rollup-builder": "14.387.1-alpha-8fa3775.0",
|
|
33
|
+
"@genesislcap/ts-builder": "14.387.1-alpha-8fa3775.0",
|
|
34
|
+
"@genesislcap/uvu-playwright-builder": "14.387.1-alpha-8fa3775.0",
|
|
35
|
+
"@genesislcap/vite-builder": "14.387.1-alpha-8fa3775.0",
|
|
36
|
+
"@genesislcap/webpack-builder": "14.387.1-alpha-8fa3775.0",
|
|
37
37
|
"@types/json-schema": "^7.0.11"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@genesislcap/expression-builder": "14.387.0",
|
|
41
|
-
"@genesislcap/foundation-logger": "14.387.0",
|
|
40
|
+
"@genesislcap/expression-builder": "14.387.1-alpha-8fa3775.0",
|
|
41
|
+
"@genesislcap/foundation-logger": "14.387.1-alpha-8fa3775.0",
|
|
42
42
|
"@microsoft/fast-components": "2.30.6",
|
|
43
43
|
"@microsoft/fast-element": "1.14.0",
|
|
44
44
|
"@microsoft/fast-foundation": "2.49.6",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"customElements": "dist/custom-elements.json",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "307a3526456233d9c9d1a4c034701b5e45233bb2"
|
|
60
60
|
}
|