ripple 0.3.16 → 0.3.18

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 (154) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/package.json +4 -4
  3. package/src/runtime/element.js +11 -11
  4. package/src/runtime/internal/client/composite.js +2 -2
  5. package/src/runtime/internal/client/expression.js +5 -5
  6. package/src/runtime/internal/client/index.js +1 -1
  7. package/src/runtime/internal/client/portal.js +4 -4
  8. package/src/runtime/internal/server/index.js +4 -4
  9. package/tests/client/__snapshots__/computed-properties.test.tsrx.snap +49 -0
  10. package/tests/client/__snapshots__/for.test.tsrx.snap +319 -0
  11. package/tests/client/__snapshots__/html.test.tsrx.snap +40 -0
  12. package/tests/client/basic/__snapshots__/basic.attributes.test.tsrx.snap +60 -0
  13. package/tests/client/basic/__snapshots__/basic.rendering.test.tsrx.snap +59 -0
  14. package/tests/client/basic/{basic.components.test.rsrx → basic.components.test.tsrx} +51 -1
  15. package/tests/client/basic/{basic.errors.test.rsrx → basic.errors.test.tsrx} +12 -12
  16. package/tests/client/basic/{basic.styling.test.rsrx → basic.styling.test.tsrx} +1 -1
  17. package/tests/client/compiler/__snapshots__/compiler.assignments.test.tsrx.snap +12 -0
  18. package/tests/client/compiler/__snapshots__/compiler.typescript.test.tsrx.snap +46 -0
  19. package/tests/client/compiler/{compiler.assignments.test.rsrx → compiler.assignments.test.tsrx} +2 -2
  20. package/tests/client/compiler/{compiler.attributes.test.rsrx → compiler.attributes.test.tsrx} +4 -4
  21. package/tests/client/compiler/{compiler.basic.test.rsrx → compiler.basic.test.tsrx} +44 -30
  22. package/tests/client/compiler/{compiler.tracked-access.test.rsrx → compiler.tracked-access.test.tsrx} +16 -16
  23. package/tests/client/compiler/{compiler.try-in-function.test.rsrx → compiler.try-in-function.test.tsrx} +8 -8
  24. package/tests/client/compiler/{compiler.typescript.test.rsrx → compiler.typescript.test.tsrx} +4 -4
  25. package/tests/client/composite/__snapshots__/composite.render.test.tsrx.snap +37 -0
  26. package/tests/client/css/{global-additional-cases.test.rsrx → global-additional-cases.test.tsrx} +27 -27
  27. package/tests/client/css/{global-advanced-selectors.test.rsrx → global-advanced-selectors.test.tsrx} +8 -8
  28. package/tests/client/css/{global-at-rules.test.rsrx → global-at-rules.test.tsrx} +5 -5
  29. package/tests/client/css/{global-basic.test.rsrx → global-basic.test.tsrx} +7 -7
  30. package/tests/client/css/{global-classes-ids.test.rsrx → global-classes-ids.test.tsrx} +7 -7
  31. package/tests/client/css/{global-combinators.test.rsrx → global-combinators.test.tsrx} +5 -5
  32. package/tests/client/css/{global-complex-nesting.test.rsrx → global-complex-nesting.test.tsrx} +7 -7
  33. package/tests/client/css/{global-edge-cases.test.rsrx → global-edge-cases.test.tsrx} +9 -9
  34. package/tests/client/css/{global-keyframes.test.rsrx → global-keyframes.test.tsrx} +5 -5
  35. package/tests/client/css/{global-nested.test.rsrx → global-nested.test.tsrx} +5 -5
  36. package/tests/client/css/{global-pseudo.test.rsrx → global-pseudo.test.tsrx} +6 -6
  37. package/tests/client/css/{global-scoping.test.rsrx → global-scoping.test.tsrx} +10 -10
  38. package/tests/client/css/{style-identifier.test.rsrx → style-identifier.test.tsrx} +12 -16
  39. package/tests/client/{function-overload.test.rsrx → function-overload.test.tsrx} +1 -1
  40. package/tests/client/{return.test.rsrx → return.test.tsrx} +16 -18
  41. package/tests/hydration/build-components.js +2 -4
  42. package/tests/hydration/compiled/client/basic.js +1 -1
  43. package/tests/hydration/compiled/client/composite.js +4 -4
  44. package/tests/hydration/compiled/client/head.js +11 -11
  45. package/tests/hydration/compiled/client/hmr.js +1 -1
  46. package/tests/hydration/compiled/client/html.js +19 -19
  47. package/tests/hydration/compiled/client/if-children.js +2 -2
  48. package/tests/hydration/compiled/client/portal.js +4 -4
  49. package/tests/hydration/compiled/server/basic.js +1 -1
  50. package/tests/hydration/compiled/server/composite.js +4 -4
  51. package/tests/hydration/compiled/server/head.js +11 -11
  52. package/tests/hydration/compiled/server/hmr.js +1 -1
  53. package/tests/hydration/compiled/server/html.js +19 -19
  54. package/tests/hydration/compiled/server/if-children.js +2 -2
  55. package/tests/hydration/compiled/server/portal.js +4 -4
  56. package/tests/hydration/components/{html-in-template.rsrx → html-in-template.tsrx} +1 -1
  57. package/tests/server/__snapshots__/compiler.test.tsrx.snap +95 -0
  58. package/tests/server/{basic.components.test.rsrx → basic.components.test.tsrx} +48 -0
  59. package/tests/server/{compiler.test.rsrx → compiler.test.tsrx} +17 -17
  60. package/tests/server/{html-nesting-validation.test.rsrx → html-nesting-validation.test.tsrx} +38 -38
  61. package/tests/server/{style-identifier.test.rsrx → style-identifier.test.tsrx} +1 -1
  62. package/tests/utils/compiler-compat-config.test.js +3 -3
  63. package/tests/utils/vite-plugin-config.test.js +1 -1
  64. package/tests/utils/vite-plugin-hmr.test.js +7 -7
  65. package/tsconfig.json +0 -4
  66. package/types/index.d.ts +6 -4
  67. /package/tests/client/{_etc.test.rsrx → _etc.test.tsrx} +0 -0
  68. /package/tests/client/array/{array.copy-within.test.rsrx → array.copy-within.test.tsrx} +0 -0
  69. /package/tests/client/array/{array.derived.test.rsrx → array.derived.test.tsrx} +0 -0
  70. /package/tests/client/array/{array.iteration.test.rsrx → array.iteration.test.tsrx} +0 -0
  71. /package/tests/client/array/{array.mutations.test.rsrx → array.mutations.test.tsrx} +0 -0
  72. /package/tests/client/array/{array.static.test.rsrx → array.static.test.tsrx} +0 -0
  73. /package/tests/client/array/{array.to-methods.test.rsrx → array.to-methods.test.tsrx} +0 -0
  74. /package/tests/client/{async-suspend.test.rsrx → async-suspend.test.tsrx} +0 -0
  75. /package/tests/client/basic/{basic.attributes.test.rsrx → basic.attributes.test.tsrx} +0 -0
  76. /package/tests/client/basic/{basic.collections.test.rsrx → basic.collections.test.tsrx} +0 -0
  77. /package/tests/client/basic/{basic.events.test.rsrx → basic.events.test.tsrx} +0 -0
  78. /package/tests/client/basic/{basic.get-set.test.rsrx → basic.get-set.test.tsrx} +0 -0
  79. /package/tests/client/basic/{basic.hmr.test.rsrx → basic.hmr.test.tsrx} +0 -0
  80. /package/tests/client/basic/{basic.reactivity.test.rsrx → basic.reactivity.test.tsrx} +0 -0
  81. /package/tests/client/basic/{basic.rendering.test.rsrx → basic.rendering.test.tsrx} +0 -0
  82. /package/tests/client/basic/{basic.utilities.test.rsrx → basic.utilities.test.tsrx} +0 -0
  83. /package/tests/client/{boundaries.test.rsrx → boundaries.test.tsrx} +0 -0
  84. /package/tests/client/compiler/{compiler.regex.test.rsrx → compiler.regex.test.tsrx} +0 -0
  85. /package/tests/client/composite/{composite.dynamic-components.test.rsrx → composite.dynamic-components.test.tsrx} +0 -0
  86. /package/tests/client/composite/{composite.generics.test.rsrx → composite.generics.test.tsrx} +0 -0
  87. /package/tests/client/composite/{composite.props.test.rsrx → composite.props.test.tsrx} +0 -0
  88. /package/tests/client/composite/{composite.reactivity.test.rsrx → composite.reactivity.test.tsrx} +0 -0
  89. /package/tests/client/composite/{composite.render.test.rsrx → composite.render.test.tsrx} +0 -0
  90. /package/tests/client/{computed-properties.test.rsrx → computed-properties.test.tsrx} +0 -0
  91. /package/tests/client/{context.test.rsrx → context.test.tsrx} +0 -0
  92. /package/tests/client/{date.test.rsrx → date.test.tsrx} +0 -0
  93. /package/tests/client/{dynamic-elements.test.rsrx → dynamic-elements.test.tsrx} +0 -0
  94. /package/tests/client/{events.test.rsrx → events.test.tsrx} +0 -0
  95. /package/tests/client/{for.test.rsrx → for.test.tsrx} +0 -0
  96. /package/tests/client/{function-overload-import.rsrx → function-overload-import.tsrx} +0 -0
  97. /package/tests/client/{head.test.rsrx → head.test.tsrx} +0 -0
  98. /package/tests/client/{html.test.rsrx → html.test.tsrx} +0 -0
  99. /package/tests/client/{input-value.test.rsrx → input-value.test.tsrx} +0 -0
  100. /package/tests/client/{lazy-destructuring.test.rsrx → lazy-destructuring.test.tsrx} +0 -0
  101. /package/tests/client/{map.test.rsrx → map.test.tsrx} +0 -0
  102. /package/tests/client/{media-query.test.rsrx → media-query.test.tsrx} +0 -0
  103. /package/tests/client/{object.test.rsrx → object.test.tsrx} +0 -0
  104. /package/tests/client/{portal.test.rsrx → portal.test.tsrx} +0 -0
  105. /package/tests/client/{ref.test.rsrx → ref.test.tsrx} +0 -0
  106. /package/tests/client/{set.test.rsrx → set.test.tsrx} +0 -0
  107. /package/tests/client/{svg.test.rsrx → svg.test.tsrx} +0 -0
  108. /package/tests/client/{switch.test.rsrx → switch.test.tsrx} +0 -0
  109. /package/tests/client/{try.test.rsrx → try.test.tsrx} +0 -0
  110. /package/tests/client/{tsx.test.rsrx → tsx.test.tsrx} +0 -0
  111. /package/tests/client/{typescript-generics.test.rsrx → typescript-generics.test.tsrx} +0 -0
  112. /package/tests/client/url/{url.derived.test.rsrx → url.derived.test.tsrx} +0 -0
  113. /package/tests/client/url/{url.parsing.test.rsrx → url.parsing.test.tsrx} +0 -0
  114. /package/tests/client/url/{url.partial-removal.test.rsrx → url.partial-removal.test.tsrx} +0 -0
  115. /package/tests/client/url/{url.reactivity.test.rsrx → url.reactivity.test.tsrx} +0 -0
  116. /package/tests/client/url/{url.serialization.test.rsrx → url.serialization.test.tsrx} +0 -0
  117. /package/tests/client/url-search-params/{url-search-params.derived.test.rsrx → url-search-params.derived.test.tsrx} +0 -0
  118. /package/tests/client/url-search-params/{url-search-params.initialization.test.rsrx → url-search-params.initialization.test.tsrx} +0 -0
  119. /package/tests/client/url-search-params/{url-search-params.iteration.test.rsrx → url-search-params.iteration.test.tsrx} +0 -0
  120. /package/tests/client/url-search-params/{url-search-params.mutation.test.rsrx → url-search-params.mutation.test.tsrx} +0 -0
  121. /package/tests/client/url-search-params/{url-search-params.retrieval.test.rsrx → url-search-params.retrieval.test.tsrx} +0 -0
  122. /package/tests/client/url-search-params/{url-search-params.serialization.test.rsrx → url-search-params.serialization.test.tsrx} +0 -0
  123. /package/tests/client/url-search-params/{url-search-params.tracked-url.test.rsrx → url-search-params.tracked-url.test.tsrx} +0 -0
  124. /package/tests/hydration/components/{basic.rsrx → basic.tsrx} +0 -0
  125. /package/tests/hydration/components/{composite.rsrx → composite.tsrx} +0 -0
  126. /package/tests/hydration/components/{events.rsrx → events.tsrx} +0 -0
  127. /package/tests/hydration/components/{for.rsrx → for.tsrx} +0 -0
  128. /package/tests/hydration/components/{head.rsrx → head.tsrx} +0 -0
  129. /package/tests/hydration/components/{hmr.rsrx → hmr.tsrx} +0 -0
  130. /package/tests/hydration/components/{html.rsrx → html.tsrx} +0 -0
  131. /package/tests/hydration/components/{if-children.rsrx → if-children.tsrx} +0 -0
  132. /package/tests/hydration/components/{if.rsrx → if.tsrx} +0 -0
  133. /package/tests/hydration/components/{mixed-control-flow.rsrx → mixed-control-flow.tsrx} +0 -0
  134. /package/tests/hydration/components/{nested-control-flow.rsrx → nested-control-flow.tsrx} +0 -0
  135. /package/tests/hydration/components/{portal.rsrx → portal.tsrx} +0 -0
  136. /package/tests/hydration/components/{reactivity.rsrx → reactivity.tsrx} +0 -0
  137. /package/tests/hydration/components/{return.rsrx → return.tsrx} +0 -0
  138. /package/tests/hydration/components/{switch.rsrx → switch.tsrx} +0 -0
  139. /package/tests/hydration/components/{try.rsrx → try.tsrx} +0 -0
  140. /package/tests/server/{await.test.rsrx → await.test.tsrx} +0 -0
  141. /package/tests/server/{basic.attributes.test.rsrx → basic.attributes.test.tsrx} +0 -0
  142. /package/tests/server/{basic.test.rsrx → basic.test.tsrx} +0 -0
  143. /package/tests/server/{composite.props.test.rsrx → composite.props.test.tsrx} +0 -0
  144. /package/tests/server/{composite.test.rsrx → composite.test.tsrx} +0 -0
  145. /package/tests/server/{context.test.rsrx → context.test.tsrx} +0 -0
  146. /package/tests/server/{dynamic-elements.test.rsrx → dynamic-elements.test.tsrx} +0 -0
  147. /package/tests/server/{for.test.rsrx → for.test.tsrx} +0 -0
  148. /package/tests/server/{head.test.rsrx → head.test.tsrx} +0 -0
  149. /package/tests/server/{if.test.rsrx → if.test.tsrx} +0 -0
  150. /package/tests/server/{lazy-destructuring.test.rsrx → lazy-destructuring.test.tsrx} +0 -0
  151. /package/tests/server/{return.test.rsrx → return.test.tsrx} +0 -0
  152. /package/tests/server/{streaming-ssr.test.rsrx → streaming-ssr.test.tsrx} +0 -0
  153. /package/tests/server/{switch.test.rsrx → switch.test.tsrx} +0 -0
  154. /package/tests/server/{try.test.rsrx → try.test.tsrx} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # ripple
2
2
 
3
+ ## 0.3.18
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - ripple@0.3.18
9
+
10
+ ## 0.3.17
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies []:
15
+ - ripple@0.3.17
16
+
3
17
  ## 0.3.16
4
18
 
5
19
  ### Patch Changes
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ripple is an elegant TypeScript UI framework",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.3.16",
6
+ "version": "0.3.18",
7
7
  "type": "module",
8
8
  "module": "src/runtime/index-client.js",
9
9
  "main": "src/runtime/index-client.js",
@@ -82,10 +82,10 @@
82
82
  "typescript": "^5.9.3",
83
83
  "@volar/language-core": "~2.4.28",
84
84
  "vscode-languageserver-types": "^3.17.5",
85
- "@tsrx/core": "0.0.3",
86
- "@tsrx/ripple": "0.0.4"
85
+ "@tsrx/core": "0.0.4",
86
+ "@tsrx/ripple": "0.0.5"
87
87
  },
88
88
  "peerDependencies": {
89
- "ripple": "0.3.16"
89
+ "ripple": "0.3.18"
90
90
  }
91
91
  }
@@ -1,29 +1,29 @@
1
- const RIPPLE_ELEMENT = Symbol.for('ripple.element');
1
+ const TSRX_ELEMENT = Symbol.for('ripple.element');
2
2
 
3
3
  /**
4
4
  * @typedef {{
5
5
  * render: Function;
6
- * [RIPPLE_ELEMENT]: true;
7
- * }} RippleElement
6
+ * [TSRX_ELEMENT]: true;
7
+ * }} TSRXElement
8
8
  */
9
9
 
10
10
  /**
11
11
  * @param {Function} render
12
- * @returns {RippleElement}
12
+ * @returns {TSRXElement}
13
13
  */
14
- export function ripple_element(render) {
14
+ export function tsrx_element(render) {
15
15
  return {
16
16
  render,
17
- [RIPPLE_ELEMENT]: true,
17
+ [TSRX_ELEMENT]: true,
18
18
  };
19
19
  }
20
20
 
21
21
  /**
22
22
  * @param {any} value
23
- * @returns {value is RippleElement}
23
+ * @returns {value is TSRXElement}
24
24
  */
25
- export function is_ripple_element(value) {
26
- return value != null && value[RIPPLE_ELEMENT] === true;
25
+ export function is_tsrx_element(value) {
26
+ return value != null && value[TSRX_ELEMENT] === true;
27
27
  }
28
28
 
29
29
  /**
@@ -31,9 +31,9 @@ export function is_ripple_element(value) {
31
31
  * @returns {any}
32
32
  */
33
33
  export function normalize_children(value) {
34
- if (value == null || is_ripple_element(value) || typeof value !== 'function') {
34
+ if (value == null || is_tsrx_element(value) || typeof value !== 'function') {
35
35
  return value;
36
36
  }
37
37
 
38
- return ripple_element(value);
38
+ return tsrx_element(value);
39
39
  }
@@ -5,7 +5,7 @@ import { COMPOSITE_BLOCK, DEFAULT_NAMESPACE, NAMESPACE_URI } from './constants.j
5
5
  import { hydrate_next, hydrating } from './hydration.js';
6
6
  import { active_block, active_namespace, get, with_ns } from './runtime.js';
7
7
  import { top_element_to_ns } from './utils.js';
8
- import { is_ripple_element } from '../../element.js';
8
+ import { is_tsrx_element } from '../../element.js';
9
9
 
10
10
  /**
11
11
  * @typedef {((anchor: Node, props: Record<string, any>, block: Block | null) => void)} ComponentFunction
@@ -69,7 +69,7 @@ export function composite(get_component, node, props) {
69
69
 
70
70
  render_spread(element, () => props || {});
71
71
 
72
- if (is_ripple_element(props?.children)) {
72
+ if (is_tsrx_element(props?.children)) {
73
73
  var child_anchor = document.createComment('');
74
74
  element.appendChild(child_anchor);
75
75
 
@@ -6,7 +6,7 @@ import { create_text, get_next_sibling } from './operations.js';
6
6
  import { active_block } from './runtime.js';
7
7
  import { hydrating, set_hydrate_node } from './hydration.js';
8
8
  import { COMMENT_NODE, HYDRATION_END, HYDRATION_START, TEXT_NODE } from '../../../constants.js';
9
- import { is_ripple_element } from '../../element.js';
9
+ import { is_tsrx_element } from '../../element.js';
10
10
 
11
11
  /**
12
12
  * Finds the nearest enclosing BRANCH_BLOCK in the block hierarchy.
@@ -36,7 +36,7 @@ export function expression(node, get_value) {
36
36
  var end = null;
37
37
  /** @type {Text | null} */
38
38
  var text = null;
39
- /** @type {string | import('../../element.js').RippleElement | typeof UNINITIALIZED} */
39
+ /** @type {string | import('../../element.js').TSRXElement | typeof UNINITIALIZED} */
40
40
  var value = UNINITIALIZED;
41
41
  var is_element = false;
42
42
  var initialized = false;
@@ -47,7 +47,7 @@ export function expression(node, get_value) {
47
47
 
48
48
  render(() => {
49
49
  var next_value = get_value();
50
- var next_is_element = is_ripple_element(next_value);
50
+ var next_is_element = is_tsrx_element(next_value);
51
51
  var is_hydration_marker = hydrating && anchor.nodeType === COMMENT_NODE;
52
52
 
53
53
  if (is_hydration_marker) {
@@ -99,7 +99,7 @@ export function expression(node, get_value) {
99
99
 
100
100
  // Update parent branch's s.start to include content inserted before anchor.
101
101
  // This ensures that when the parent branch is destroyed, the full DOM range
102
- // (including RippleElement content) is removed.
102
+ // (including TSRXElement content) is removed.
103
103
  if (
104
104
  parent_branch !== null &&
105
105
  parent_branch.s !== null &&
@@ -114,7 +114,7 @@ export function expression(node, get_value) {
114
114
  // If parent's start is the anchor (or comes after child's start),
115
115
  // update it to include the child's content
116
116
  if (parent_start === anchor || parent_start === end) {
117
- // Save original so we can restore it when switching to non-RippleElement
117
+ // Save original so we can restore it when switching to non-TSRXElement
118
118
  if (modified_parent_branch === null) {
119
119
  modified_parent_branch = parent_branch;
120
120
  original_parent_start = parent_start;
@@ -127,4 +127,4 @@ export { hmr } from './hmr.js';
127
127
 
128
128
  export { pop, next } from './hydration.js';
129
129
 
130
- export { ripple_element, normalize_children } from '../../element.js';
130
+ export { tsrx_element, normalize_children } from '../../element.js';
@@ -12,11 +12,11 @@ import {
12
12
  set_hydrating,
13
13
  set_hydrate_node,
14
14
  } from './hydration.js';
15
- import { is_ripple_element } from '../../element.js';
15
+ import { is_tsrx_element } from '../../element.js';
16
16
 
17
17
  /**
18
18
  * @param {any} _
19
- * @param {{ target: Element, children: import('../../element.js').RippleElement }} props
19
+ * @param {{ target: Element, children: import('../../element.js').TSRXElement }} props
20
20
  * @returns {void}
21
21
  */
22
22
  export function Portal(_, props) {
@@ -27,7 +27,7 @@ export function Portal(_, props) {
27
27
 
28
28
  /** @type {Element | symbol} */
29
29
  let target = UNINITIALIZED;
30
- /** @type {import('../../element.js').RippleElement | symbol} */
30
+ /** @type {import('../../element.js').TSRXElement | symbol} */
31
31
  let children = UNINITIALIZED;
32
32
  /** @type {Block | null} */
33
33
  var b = null;
@@ -71,7 +71,7 @@ export function Portal(_, props) {
71
71
  var block = /** @type {Block} */ (active_block);
72
72
 
73
73
  b = branch(() => {
74
- if (is_ripple_element(children)) {
74
+ if (is_tsrx_element(children)) {
75
75
  children.render(/** @type {Text} */ (anchor), block);
76
76
  }
77
77
  });
@@ -28,7 +28,7 @@ import { is_boolean_attribute } from '../../../utils/attributes.js';
28
28
  import { clsx } from 'clsx';
29
29
  import { normalize_css_property_name } from '../../../utils/normalize_css_property_name.js';
30
30
  import { BLOCK_CLOSE, BLOCK_OPEN } from '../../../constants.js';
31
- import { is_ripple_element, normalize_children, ripple_element } from '../../element.js';
31
+ import { is_tsrx_element, normalize_children, tsrx_element } from '../../element.js';
32
32
  import {
33
33
  is_tag_valid_with_parent,
34
34
  is_tag_valid_with_ancestor,
@@ -48,7 +48,7 @@ export { hash } from '../../../utils/hashing.js';
48
48
  export { context } from './context.js';
49
49
  export { try_block, component_block, regular_block } from './blocks.js';
50
50
  export { array_slice };
51
- export { ripple_element, normalize_children };
51
+ export { tsrx_element, normalize_children };
52
52
 
53
53
  export function noop() {}
54
54
 
@@ -59,7 +59,7 @@ export function noop() {}
59
59
  export function render_expression(value) {
60
60
  output_push(BLOCK_OPEN);
61
61
 
62
- if (is_ripple_element(value)) {
62
+ if (is_tsrx_element(value)) {
63
63
  value.render({});
64
64
  } else {
65
65
  output_push(escape(value ?? ''));
@@ -940,7 +940,7 @@ export function spread_attrs(attrs, css_hash) {
940
940
  for (name in attrs) {
941
941
  var value = attrs[name];
942
942
 
943
- if (name === 'children' || typeof value === 'function' || is_ripple_element(value)) continue;
943
+ if (name === 'children' || typeof value === 'function' || is_tsrx_element(value)) continue;
944
944
 
945
945
  if (is_ripple_object(value)) {
946
946
  value = get(value);
@@ -0,0 +1,49 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`computed tracked properties > should update a property using assignment 1`] = `
4
+ <div>
5
+ <div>
6
+ 0
7
+ </div>
8
+ <button>
9
+ Increment
10
+ </button>
11
+
12
+ </div>
13
+ `;
14
+
15
+ exports[`computed tracked properties > should update a property using assignment 2`] = `
16
+ <div>
17
+ <div>
18
+ 1
19
+ </div>
20
+ <button>
21
+ Increment
22
+ </button>
23
+
24
+ </div>
25
+ `;
26
+
27
+ exports[`computed tracked properties > should update a property using update expressions 1`] = `
28
+ <div>
29
+ <div>
30
+ 0
31
+ </div>
32
+ <button>
33
+ Increment
34
+ </button>
35
+
36
+ </div>
37
+ `;
38
+
39
+ exports[`computed tracked properties > should update a property using update expressions 2`] = `
40
+ <div>
41
+ <div>
42
+ 1
43
+ </div>
44
+ <button>
45
+ Increment
46
+ </button>
47
+
48
+ </div>
49
+ `;
@@ -0,0 +1,319 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`for statements > correctly handles intermediate statements in for block 1`] = `
4
+ <div>
5
+ <div>
6
+ <div>
7
+ <div>
8
+ 1
9
+ </div>
10
+ <div>
11
+ 1
12
+ </div>
13
+ </div>
14
+ <div>
15
+ <div>
16
+ 2
17
+ </div>
18
+ <div>
19
+ 2
20
+ </div>
21
+ </div>
22
+ <div>
23
+ <div>
24
+ 3
25
+ </div>
26
+ <div>
27
+ 3
28
+ </div>
29
+ </div>
30
+
31
+ </div>
32
+ <button>
33
+ Add Item
34
+ </button>
35
+
36
+ </div>
37
+ `;
38
+
39
+ exports[`for statements > correctly handles intermediate statements in for block 2`] = `
40
+ <div>
41
+ <div>
42
+ <div>
43
+ <div>
44
+ 1
45
+ </div>
46
+ <div>
47
+ 1
48
+ </div>
49
+ </div>
50
+ <div>
51
+ <div>
52
+ 2
53
+ </div>
54
+ <div>
55
+ 2
56
+ </div>
57
+ </div>
58
+ <div>
59
+ <div>
60
+ 3
61
+ </div>
62
+ <div>
63
+ 3
64
+ </div>
65
+ </div>
66
+ <div>
67
+ <div>
68
+ 4
69
+ </div>
70
+ <div>
71
+ 4
72
+ </div>
73
+ </div>
74
+
75
+ </div>
76
+ <button>
77
+ Add Item
78
+ </button>
79
+
80
+ </div>
81
+ `;
82
+
83
+ exports[`for statements > correctly handles keyed for...of loops 1`] = `
84
+ <div>
85
+ <!---->
86
+ <div>
87
+ 0:Item 1
88
+ </div>
89
+ <div>
90
+ 1:Item 2
91
+ </div>
92
+ <div>
93
+ 2:Item 3
94
+ </div>
95
+ <!---->
96
+ <button>
97
+ Reverse
98
+ </button>
99
+
100
+ </div>
101
+ `;
102
+
103
+ exports[`for statements > correctly handles keyed for...of loops 2`] = `
104
+ <div>
105
+ <!---->
106
+ <div>
107
+ 0:Item 3
108
+ </div>
109
+ <div>
110
+ 1:Item 2
111
+ </div>
112
+ <div>
113
+ 2:Item 1
114
+ </div>
115
+ <!---->
116
+ <button>
117
+ Reverse
118
+ </button>
119
+
120
+ </div>
121
+ `;
122
+
123
+ exports[`for statements > correctly handles the index in a for...of loop 1`] = `
124
+ <div>
125
+ <div>
126
+ <div>
127
+ 0 : a
128
+ </div>
129
+ <div>
130
+ 1 : b
131
+ </div>
132
+ <div>
133
+ 2 : c
134
+ </div>
135
+
136
+ </div>
137
+ <button>
138
+ Add Item
139
+ </button>
140
+ <button>
141
+ Reverse
142
+ </button>
143
+
144
+ </div>
145
+ `;
146
+
147
+ exports[`for statements > correctly handles the index in a for...of loop 2`] = `
148
+ <div>
149
+ <div>
150
+ <div>
151
+ 0 : a
152
+ </div>
153
+ <div>
154
+ 1 : b
155
+ </div>
156
+ <div>
157
+ 2 : c
158
+ </div>
159
+ <div>
160
+ 3 : d
161
+ </div>
162
+
163
+ </div>
164
+ <button>
165
+ Add Item
166
+ </button>
167
+ <button>
168
+ Reverse
169
+ </button>
170
+
171
+ </div>
172
+ `;
173
+
174
+ exports[`for statements > correctly handles the index in a for...of loop 3`] = `
175
+ <div>
176
+ <div>
177
+ <div>
178
+ 0 : d
179
+ </div>
180
+ <div>
181
+ 1 : c
182
+ </div>
183
+ <div>
184
+ 2 : b
185
+ </div>
186
+ <div>
187
+ 3 : a
188
+ </div>
189
+
190
+ </div>
191
+ <button>
192
+ Add Item
193
+ </button>
194
+ <button>
195
+ Reverse
196
+ </button>
197
+
198
+ </div>
199
+ `;
200
+
201
+ exports[`for statements > handles updating with new objects with same key 1`] = `
202
+ <div>
203
+ <!---->
204
+ <div>
205
+ 0:Item 1
206
+ </div>
207
+ <div>
208
+ 1:Item 2
209
+ </div>
210
+ <div>
211
+ 2:Item 3
212
+ </div>
213
+ <!---->
214
+ <button>
215
+ Reverse
216
+ </button>
217
+
218
+ </div>
219
+ `;
220
+
221
+ exports[`for statements > handles updating with new objects with same key 2`] = `
222
+ <div>
223
+ <!---->
224
+ <div>
225
+ 0:Item 1!
226
+ </div>
227
+ <div>
228
+ 1:Item 2!
229
+ </div>
230
+ <div>
231
+ 2:Item 3!
232
+ </div>
233
+ <!---->
234
+ <button>
235
+ Reverse
236
+ </button>
237
+
238
+ </div>
239
+ `;
240
+
241
+ exports[`for statements > renders a simple dynamic array 1`] = `
242
+ <div>
243
+ <!---->
244
+ <div
245
+ class="Item 1"
246
+ >
247
+ Item 1
248
+ </div>
249
+ <div
250
+ class="Item 2"
251
+ >
252
+ Item 2
253
+ </div>
254
+ <div
255
+ class="Item 3"
256
+ >
257
+ Item 3
258
+ </div>
259
+ <!---->
260
+ <button>
261
+ Add Item
262
+ </button>
263
+
264
+ </div>
265
+ `;
266
+
267
+ exports[`for statements > renders a simple dynamic array 2`] = `
268
+ <div>
269
+ <!---->
270
+ <div
271
+ class="Item 1"
272
+ >
273
+ Item 1
274
+ </div>
275
+ <div
276
+ class="Item 2"
277
+ >
278
+ Item 2
279
+ </div>
280
+ <div
281
+ class="Item 3"
282
+ >
283
+ Item 3
284
+ </div>
285
+ <div
286
+ class="Item 4"
287
+ >
288
+ Item 4
289
+ </div>
290
+ <!---->
291
+ <button>
292
+ Add Item
293
+ </button>
294
+
295
+ </div>
296
+ `;
297
+
298
+ exports[`for statements > renders a simple static array 1`] = `
299
+ <div>
300
+ <!---->
301
+ <div
302
+ class="Item 1"
303
+ >
304
+ Item 1
305
+ </div>
306
+ <div
307
+ class="Item 2"
308
+ >
309
+ Item 2
310
+ </div>
311
+ <div
312
+ class="Item 3"
313
+ >
314
+ Item 3
315
+ </div>
316
+ <!---->
317
+
318
+ </div>
319
+ `;
@@ -0,0 +1,40 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`html directive > renders dynamic html 1`] = `
4
+ <div>
5
+ <!---->
6
+ <div>
7
+ Test
8
+ </div>
9
+ <!---->
10
+ <button>
11
+ Update
12
+ </button>
13
+
14
+ </div>
15
+ `;
16
+
17
+ exports[`html directive > renders dynamic html 2`] = `
18
+ <div>
19
+ <!---->
20
+ <div>
21
+ Updated
22
+ </div>
23
+ <!---->
24
+ <button>
25
+ Update
26
+ </button>
27
+
28
+ </div>
29
+ `;
30
+
31
+ exports[`html directive > renders static html 1`] = `
32
+ <div>
33
+ <!---->
34
+ <div>
35
+ Test
36
+ </div>
37
+ <!---->
38
+
39
+ </div>
40
+ `;
@@ -0,0 +1,60 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`basic client > attribute rendering > handles boolean attributes with no prop value provides 1`] = `
4
+ <div>
5
+ <div
6
+ class="container"
7
+ >
8
+ <button
9
+ disabled=""
10
+ >
11
+ Button
12
+ </button>
13
+ <input
14
+ checked=""
15
+ type="checkbox"
16
+ />
17
+ </div>
18
+
19
+ </div>
20
+ `;
21
+
22
+ exports[`basic client > attribute rendering > handles boolean props correctly 1`] = `
23
+ <div>
24
+ <div
25
+ data-disabled=""
26
+ />
27
+ <input
28
+ disabled=""
29
+ />
30
+ <!---->
31
+
32
+ </div>
33
+ `;
34
+
35
+ exports[`basic client > attribute rendering > render spread props without duplication 1`] = `
36
+ <div>
37
+ <div>
38
+ <input
39
+ id="vehicle1"
40
+ name="car"
41
+ type="checkbox"
42
+ value="Bike"
43
+ />
44
+ </div>
45
+
46
+ </div>
47
+ `;
48
+
49
+ exports[`basic client > attribute rendering > render static attributes 1`] = `
50
+ <div>
51
+ <div
52
+ class="foo"
53
+ id="bar"
54
+ style="color: red;"
55
+ >
56
+ Hello World
57
+ </div>
58
+
59
+ </div>
60
+ `;