@microsoft/fast-element 2.0.0-beta.8 → 2.0.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.
Files changed (142) hide show
  1. package/.eslintrc.json +1 -1
  2. package/CHANGELOG.json +512 -0
  3. package/CHANGELOG.md +180 -1
  4. package/README.md +1 -9
  5. package/api-extractor.context.json +14 -0
  6. package/api-extractor.di.json +14 -0
  7. package/dist/context/context.api.json +1068 -0
  8. package/dist/di/di.api.json +4929 -0
  9. package/dist/dts/binding/binding.d.ts +49 -0
  10. package/dist/dts/binding/normalize.d.ts +9 -0
  11. package/dist/dts/binding/one-time.d.ts +11 -0
  12. package/dist/dts/binding/one-way.d.ts +20 -0
  13. package/dist/dts/{templating/binding-signal.d.ts → binding/signal.d.ts} +19 -4
  14. package/dist/dts/{templating/binding-two-way.d.ts → binding/two-way.d.ts} +9 -5
  15. package/dist/dts/components/attributes.d.ts +6 -0
  16. package/dist/dts/components/element-controller.d.ts +104 -8
  17. package/dist/dts/components/element-hydration.d.ts +2 -0
  18. package/dist/dts/components/fast-definitions.d.ts +6 -0
  19. package/dist/dts/components/hydration.d.ts +56 -0
  20. package/dist/dts/components/install-hydration.d.ts +1 -0
  21. package/dist/dts/context.d.ts +29 -15
  22. package/dist/dts/di/di.d.ts +0 -5
  23. package/dist/dts/dom-policy.d.ts +83 -0
  24. package/dist/dts/dom.d.ts +100 -0
  25. package/dist/dts/hydration/target-builder.d.ts +63 -0
  26. package/dist/dts/index.d.ts +33 -26
  27. package/dist/dts/index.rollup.d.ts +0 -1
  28. package/dist/dts/index.rollup.debug.d.ts +0 -1
  29. package/dist/dts/interfaces.d.ts +32 -82
  30. package/dist/dts/metadata.d.ts +6 -5
  31. package/dist/dts/observation/arrays.d.ts +1 -1
  32. package/dist/dts/observation/observable.bench.d.ts +18 -0
  33. package/dist/dts/observation/observable.d.ts +5 -5
  34. package/dist/dts/pending-task.d.ts +19 -7
  35. package/dist/dts/platform.d.ts +11 -2
  36. package/dist/dts/polyfills.d.ts +0 -8
  37. package/dist/dts/styles/css-binding-directive.d.ts +60 -0
  38. package/dist/dts/styles/css.d.ts +9 -7
  39. package/dist/dts/styles/element-styles.d.ts +1 -14
  40. package/dist/dts/styles/host.d.ts +2 -5
  41. package/dist/dts/styles/style-strategy.d.ts +42 -0
  42. package/dist/dts/templating/compiler.d.ts +11 -13
  43. package/dist/dts/templating/{binding.d.ts → html-binding-directive.d.ts} +22 -42
  44. package/dist/dts/templating/html-directive.d.ts +44 -140
  45. package/dist/dts/templating/install-hydratable-view-templates.d.ts +1 -0
  46. package/dist/dts/templating/node-observation.d.ts +11 -1
  47. package/dist/dts/templating/ref.d.ts +4 -0
  48. package/dist/dts/templating/render.bench.d.ts +3 -0
  49. package/dist/dts/templating/render.d.ts +49 -9
  50. package/dist/dts/templating/repeat-basic-reverse.bench.d.ts +3 -0
  51. package/dist/dts/templating/repeat-basic-shift.bench.d.ts +3 -0
  52. package/dist/dts/templating/repeat.d.ts +31 -9
  53. package/dist/dts/templating/template.d.ts +97 -12
  54. package/dist/dts/templating/view.d.ts +149 -26
  55. package/dist/dts/templating/when-basic.bench.d.ts +3 -0
  56. package/dist/dts/templating/when-conditional.bench.d.ts +3 -0
  57. package/dist/dts/templating/when-switch.bench.d.ts +3 -0
  58. package/dist/dts/templating/when.d.ts +3 -1
  59. package/dist/dts/testing/fakes.d.ts +12 -1
  60. package/dist/dts/tsdoc-metadata.json +1 -1
  61. package/dist/dts/utilities.d.ts +55 -1
  62. package/dist/esm/binding/binding.js +18 -0
  63. package/dist/esm/binding/normalize.js +17 -0
  64. package/dist/esm/binding/one-time.js +21 -0
  65. package/dist/esm/binding/one-way.js +30 -0
  66. package/dist/esm/{templating/binding-signal.js → binding/signal.js} +22 -6
  67. package/dist/esm/{templating/binding-two-way.js → binding/two-way.js} +18 -12
  68. package/dist/esm/components/attributes.js +16 -1
  69. package/dist/esm/components/element-controller.js +319 -49
  70. package/dist/esm/components/element-hydration.js +2 -0
  71. package/dist/esm/components/fast-definitions.js +12 -4
  72. package/dist/esm/components/fast-element.js +3 -1
  73. package/dist/esm/components/hydration.js +104 -0
  74. package/dist/esm/components/install-hydration.js +3 -0
  75. package/dist/esm/context.js +26 -4
  76. package/dist/esm/debug.js +8 -2
  77. package/dist/esm/di/di.js +9 -12
  78. package/dist/esm/dom-policy.js +345 -0
  79. package/dist/esm/dom.js +101 -0
  80. package/dist/esm/hydration/target-builder.js +175 -0
  81. package/dist/esm/index.js +34 -25
  82. package/dist/esm/index.rollup.debug.js +3 -1
  83. package/dist/esm/index.rollup.js +3 -1
  84. package/dist/esm/interfaces.js +51 -3
  85. package/dist/esm/metadata.js +11 -8
  86. package/dist/esm/observation/arrays.js +1 -1
  87. package/dist/esm/observation/observable.bench.js +79 -0
  88. package/dist/esm/observation/observable.js +20 -15
  89. package/dist/esm/observation/update-queue.js +2 -2
  90. package/dist/esm/pending-task.js +13 -1
  91. package/dist/esm/platform.js +12 -2
  92. package/dist/esm/polyfills.js +3 -61
  93. package/dist/esm/styles/css-binding-directive.js +76 -0
  94. package/dist/esm/styles/css.js +14 -7
  95. package/dist/esm/styles/element-styles.js +0 -33
  96. package/dist/esm/styles/style-strategy.js +1 -0
  97. package/dist/esm/templating/children.js +8 -4
  98. package/dist/esm/templating/compiler.js +37 -44
  99. package/dist/esm/templating/html-binding-directive.js +218 -0
  100. package/dist/esm/templating/html-directive.js +25 -152
  101. package/dist/esm/templating/install-hydratable-view-templates.js +17 -0
  102. package/dist/esm/templating/node-observation.js +14 -8
  103. package/dist/esm/templating/ref.js +1 -1
  104. package/dist/esm/templating/render.bench.js +56 -0
  105. package/dist/esm/templating/render.js +74 -30
  106. package/dist/esm/templating/repeat-basic-reverse.bench.js +43 -0
  107. package/dist/esm/templating/repeat-basic-shift.bench.js +43 -0
  108. package/dist/esm/templating/repeat.js +116 -17
  109. package/dist/esm/templating/template.js +135 -60
  110. package/dist/esm/templating/view.js +259 -32
  111. package/dist/esm/templating/when-basic.bench.js +36 -0
  112. package/dist/esm/templating/when-conditional.bench.js +39 -0
  113. package/dist/esm/templating/when-switch.bench.js +68 -0
  114. package/dist/esm/templating/when.js +12 -5
  115. package/dist/esm/testing/fakes.js +32 -1
  116. package/dist/esm/testing/fixture.js +1 -1
  117. package/dist/esm/utilities.js +97 -1
  118. package/dist/fast-element.api.json +9804 -5622
  119. package/dist/fast-element.d.ts +813 -2386
  120. package/dist/fast-element.debug.js +2797 -974
  121. package/dist/fast-element.debug.min.js +3 -1
  122. package/dist/fast-element.js +2642 -825
  123. package/dist/fast-element.min.js +3 -1
  124. package/dist/fast-element.untrimmed.d.ts +669 -315
  125. package/docs/{api-report.md → api-report.api.md} +243 -158
  126. package/docs/context/api-report.api.md +69 -0
  127. package/docs/di/api-report.api.md +315 -0
  128. package/karma.conf.cjs +2 -1
  129. package/package.json +59 -47
  130. package/scripts/run-api-extractor.js +51 -0
  131. package/scripts/run-benchmarks.js +46 -0
  132. package/tensile.config.js +12 -0
  133. package/dist/dts/templating/dom.d.ts +0 -41
  134. package/dist/esm/templating/binding.js +0 -282
  135. package/dist/esm/templating/dom.js +0 -49
  136. package/docs/guide/declaring-templates.md +0 -230
  137. package/docs/guide/defining-elements.md +0 -214
  138. package/docs/guide/leveraging-css.md +0 -253
  139. package/docs/guide/next-steps.md +0 -13
  140. package/docs/guide/observables-and-state.md +0 -213
  141. package/docs/guide/using-directives.md +0 -576
  142. package/docs/guide/working-with-shadow-dom.md +0 -296
package/CHANGELOG.md CHANGED
@@ -1,9 +1,188 @@
1
1
  # Change Log - @microsoft/fast-element
2
2
 
3
- This log was last generated on Tue, 27 Sep 2022 22:31:52 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 19 Aug 2024 22:04:19 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.0.0
8
+
9
+ Mon, 19 Aug 2024 22:04:19 GMT
10
+
11
+ ### Major changes
12
+
13
+ - Update @microsoft/fast-element to major version (13071055+chrisdholt@users.noreply.github.com)
14
+
15
+ ### Changes
16
+
17
+ - Fix CodeQL issues (7559015+janechu@users.noreply.github.com)
18
+ - Adds support for FASTElement hydration (171390049+prabhujayapal@users.noreply.github.com)
19
+
20
+ ## 2.0.0-beta.26
21
+
22
+ Fri, 18 Aug 2023 00:04:40 GMT
23
+
24
+ ### Changes
25
+
26
+ - BREAKING: update fast-element export paths to include extensions (chhol@microsoft.com)
27
+ - update fast-element exports to be explicit (chhol@microsoft.com)
28
+
29
+ ## 2.0.0-beta.25
30
+
31
+ Sat, 12 Aug 2023 00:26:36 GMT
32
+
33
+ ### Changes
34
+
35
+ - Prevent notification of array splices when operation does not mutate array values (nicholasrice@users.noreply.github.com)
36
+ - Adds volatile binding support for JavaScript optional chaining syntax (nicholasrice@users.noreply.github.com)
37
+
38
+ ## 2.0.0-beta.24
39
+
40
+ Fri, 16 Jun 2023 18:17:12 GMT
41
+
42
+ ### Changes
43
+
44
+ - fix: update compiler to ensure first and last child references are defined (chhol@microsoft.com)
45
+ - Adds 'else' template option to the when directive (nicholasrice@users.noreply.github.com)
46
+ - fixed a bug where re-binding a ChildrenDirective instance would throw a runtime exception from the mutation handler (nicholasrice@users.noreply.github.com)
47
+ - Update adoptedStyleSheets strategy to use push/splice when available to fix Safari 16.4 bug (nicholasrice@users.noreply.github.com)
48
+ - fixes a bug where ChildrenDirective could not be used multiple times for the same element (nicholasrice@users.noreply.github.com)
49
+ - fixed bug causing behaviors attached to stylesheets not to be removed when the stylesheet was removed (nicholasrice@users.noreply.github.com)
50
+
51
+ ## 2.0.0-beta.23
52
+
53
+ Tue, 28 Mar 2023 22:14:10 GMT
54
+
55
+ ### Changes
56
+
57
+ - docs: add missing API docs (rob@bluespire.com)
58
+ - fix: correct types for a break in TypeScript 5 legacy decorators (rob@bluespire.com)
59
+
60
+ ## 2.0.0-beta.22
61
+
62
+ Sat, 11 Mar 2023 00:09:48 GMT
63
+
64
+ ### Changes
65
+
66
+ - feat: add Context.for (rob@bluespire.com)
67
+ - feat: enable data binding in CSS (rob@bluespire.com)
68
+ - add directives support for createElementTemplate (32497422+KingOfTac@users.noreply.github.com)
69
+ - fix: clean up toJSON noop on core fast-element types (rob@bluespire.com)
70
+
71
+ ## 2.0.0-beta.21
72
+
73
+ Tue, 14 Feb 2023 04:02:35 GMT
74
+
75
+ ### Changes
76
+
77
+ - fix: cleanup types, docs, etc. in root source files of fast-element in preparation for release (rob@bluespire.com)
78
+ - Remove un-necessary expression from StyleElementStrategy (nicholasrice@users.noreply.github.com)
79
+
80
+ ## 2.0.0-beta.20
81
+
82
+ Wed, 11 Jan 2023 22:07:47 GMT
83
+
84
+ ### Changes
85
+
86
+ - add nullableBooleanConverter for attributes (863023+radium-v@users.noreply.github.com)
87
+ - update return type for dangerousHTML to DangerousHTMLDirective (chhol@microsoft.com)
88
+ - chore: remove deprecated APIs from fast-element (rob@bluespire.com)
89
+ - chore: cleanup fast-element interfaces (roeisenb@microsoft.com)
90
+ - refactor(fast-element): replace dangerousHTML with html.partial (roeisenb@microsoft.com)
91
+ - feat: add ability to inline templates (roeisenb@microsoft.com)
92
+
93
+ ## 2.0.0-beta.19
94
+
95
+ Fri, 02 Dec 2022 01:18:22 GMT
96
+
97
+ ### Changes
98
+
99
+ - feat: add kernel mode with isolation by default (roeisenb@microsoft.com)
100
+
101
+ ## 2.0.0-beta.18
102
+
103
+ Tue, 15 Nov 2022 02:40:34 GMT
104
+
105
+ ### Changes
106
+
107
+ - chore: move ViewBehaviorOrchestrator to utilities (roeisenb@microsoft.com)
108
+ - feat: add new DOM Policy protection throughout (roeisenb@microsoft.com)
109
+
110
+ ## 2.0.0-beta.17
111
+
112
+ Tue, 01 Nov 2022 23:26:26 GMT
113
+
114
+ ### Changes
115
+
116
+ - fix: prevent circular reference errors when stringifying DOM nodes controlled by FAST's rendering engine (roeisenb@microsoft.com)
117
+
118
+ ## 2.0.0-beta.16
119
+
120
+ Fri, 28 Oct 2022 20:44:44 GMT
121
+
122
+ ### Changes
123
+
124
+ - Fixed bug preventing main component stylesheet behaviors from being connected during connectedCallback (nicholasrice@users.noreply.github.com)
125
+
126
+ ## 2.0.0-beta.15
127
+
128
+ Tue, 25 Oct 2022 20:24:32 GMT
129
+
130
+ ### Changes
131
+
132
+ - Updated the ElementController to connect behaviors prior to rendering element templates (nicholasrice@users.noreply.github.com)
133
+ - Added support to fast-element to support element hydration and the `defer-hydration` attribute (nicholasrice@users.noreply.github.com)
134
+
135
+ ## 2.0.0-beta.14
136
+
137
+ Fri, 14 Oct 2022 18:26:11 GMT
138
+
139
+ ### Changes
140
+
141
+ - fix: tokenList bindings track adds and removes from multiple sources (roeisenb@microsoft.com)
142
+ - refactor: remove duplication and re-organize binding behavior logic (roeisenb@microsoft.com)
143
+
144
+ ## 2.0.0-beta.13
145
+
146
+ Mon, 10 Oct 2022 20:28:02 GMT
147
+
148
+ ### Changes
149
+
150
+ - fix: prevent event callbacks when controller is not bound (roeisenb@microsoft.com)
151
+
152
+ ## 2.0.0-beta.12
153
+
154
+ Thu, 06 Oct 2022 23:21:20 GMT
155
+
156
+ ### Changes
157
+
158
+ - fix: repeat update view context positioning (roeisenb@microsoft.com)
159
+
160
+ ## 2.0.0-beta.11
161
+
162
+ Wed, 05 Oct 2022 23:26:01 GMT
163
+
164
+ ### Changes
165
+
166
+ - fix: removed a shadowRoot leak from ElementController (nicholasrice@users.noreply.github.com)
167
+
168
+ ## 2.0.0-beta.10
169
+
170
+ Mon, 03 Oct 2022 23:44:38 GMT
171
+
172
+ ### Changes
173
+
174
+ - fix: observation kernel missing binding observer disconnect method (roeisenb@microsoft.com)
175
+ - feat: less surprising class bindings w/ more flexibility for developers (roeisenb@microsoft.com)
176
+ - fix: don't allow registering FASTElement itself as a web component (roeisenb@microsoft.com)
177
+
178
+ ## 2.0.0-beta.9
179
+
180
+ Wed, 28 Sep 2022 20:45:51 GMT
181
+
182
+ ### Changes
183
+
184
+ - fix: ensure composed templates receive the existing execution context (roeisenb@microsoft.com)
185
+
7
186
  ## 2.0.0-beta.8
8
187
 
9
188
  Tue, 27 Sep 2022 22:31:52 GMT
package/README.md CHANGED
@@ -9,26 +9,18 @@ The `fast-element` library is a lightweight means to easily build performant, me
9
9
 
10
10
  ### From NPM
11
11
 
12
- To install the `fast-element` library, use either `npm` or `yarn` as follows:
12
+ To install the latest `fast-element` library using `npm`:
13
13
 
14
14
  ```shell
15
15
  npm install --save @microsoft/fast-element
16
16
  ```
17
17
 
18
- ```shell
19
- yarn add @microsoft/fast-element
20
- ```
21
-
22
18
  Within your JavaScript or TypeScript code, you can then import library APIs like this:
23
19
 
24
20
  ```ts
25
21
  import { FASTElement } from '@microsoft/fast-element';
26
22
  ```
27
23
 
28
- :::tip
29
- Looking for a setup that integrates with a particular front-end framework or bundler? Check out [our integration docs](../integrations/introduction.md).
30
- :::
31
-
32
24
  ### From CDN
33
25
 
34
26
  A pre-bundled script that contains all APIs needed to build web components with FAST Element is available on CDN. You can use this script by adding [`type="module"`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) to the script element and then importing from the CDN.
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../api-extractor.json",
4
+ "mainEntryPointFilePath": "./dist/dts/context.d.ts",
5
+ "apiReport": {
6
+ "enabled": true,
7
+ "reportFolder": "<projectFolder>/docs/context",
8
+ "reportFileName": "api-report"
9
+ },
10
+ "docModel": {
11
+ "enabled": true,
12
+ "apiJsonFilePath": "<projectFolder>/dist/context/context.api.json"
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../api-extractor.json",
4
+ "mainEntryPointFilePath": "./dist/dts/di/di.d.ts",
5
+ "apiReport": {
6
+ "enabled": true,
7
+ "reportFolder": "<projectFolder>/docs/di",
8
+ "reportFileName": "api-report"
9
+ },
10
+ "docModel": {
11
+ "enabled": true,
12
+ "apiJsonFilePath": "<projectFolder>/dist/di/di.api.json"
13
+ }
14
+ }