ripple 0.3.88 → 0.3.90

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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # ripple
2
2
 
3
+ ## 0.3.90
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1324](https://github.com/Ripple-TS/ripple/pull/1324)
8
+ [`1925074`](https://github.com/Ripple-TS/ripple/commit/1925074254de0e61c8578cba136c50ea8f89cd35)
9
+ Thanks [@leonidaz](https://github.com/leonidaz)! - Minor adjustments from
10
+ @tsrx/ripple moving to the parser ast vs its own version
11
+
12
+ - Updated dependencies
13
+ [[`1925074`](https://github.com/Ripple-TS/ripple/commit/1925074254de0e61c8578cba136c50ea8f89cd35),
14
+ [`1925074`](https://github.com/Ripple-TS/ripple/commit/1925074254de0e61c8578cba136c50ea8f89cd35)]:
15
+ - @tsrx/core@0.1.36
16
+ - @tsrx/ripple@0.1.37
17
+
18
+ ## 0.3.89
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ [[`51eed86`](https://github.com/Ripple-TS/ripple/commit/51eed869b7ea26b5554893c9f8dd363f2d2121bc)]:
24
+ - @tsrx/core@0.1.35
25
+ - @tsrx/ripple@0.1.36
26
+
3
27
  ## 0.3.88
4
28
 
5
29
  ## 0.3.87
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.88",
6
+ "version": "0.3.90",
7
7
  "type": "module",
8
8
  "module": "src/runtime/index-client.js",
9
9
  "main": "src/runtime/index-client.js",
@@ -73,8 +73,8 @@
73
73
  "clsx": "^2.1.1",
74
74
  "devalue": "^5.8.1",
75
75
  "esm-env": "^1.2.2",
76
- "@tsrx/core": "0.1.34",
77
- "@tsrx/ripple": "0.1.35"
76
+ "@tsrx/core": "0.1.36",
77
+ "@tsrx/ripple": "0.1.37"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/estree": "^1.0.8",
@@ -69,15 +69,15 @@ describe('compiler > basics', () => {
69
69
 
70
70
  const ast = parse(source, 'App.tsrx');
71
71
  const elements = get_returned_tsrx(ast.body[0]).children.filter(
72
- (node: AST.Node) => node.type === 'Element',
73
- ) as AST.Element[];
72
+ (node: AST.Node) => node.type === 'JSXElement',
73
+ ) as ESTreeJSX.JSXElement[];
74
74
  const expression = elements[0].children[0] as AST.Node & { expression: AST.Expression };
75
75
  const text_expression = elements[1].children[0] as AST.Node & { expression: AST.Expression };
76
76
 
77
77
  expect(elements).toHaveLength(2);
78
- expect(expression.type).toBe('TSRXExpression');
78
+ expect(expression.type).toBe('JSXExpressionContainer');
79
79
  expect((expression.expression as AST.Identifier).name).toBe('markup');
80
- expect(text_expression.type).toBe('TSRXExpression');
80
+ expect(text_expression.type).toBe('JSXExpressionContainer');
81
81
  expect((text_expression.expression as AST.Identifier).name).toBe('text');
82
82
 
83
83
  const { code } = compile(source, 'text-directive.tsrx', { mode: 'client' });
@@ -196,8 +196,8 @@ export function App() @{
196
196
  const declaration = (ast.body[0] as AST.VariableDeclaration).declarations[0];
197
197
  const fragment = get_returned_tsrx(declaration) as any;
198
198
 
199
- expect(fragment.type).toBe('TsrxFragment');
200
- expect(fragment.children[0].type).toBe('TSRXExpression');
199
+ expect(fragment.type).toBe('JSXFragment');
200
+ expect(fragment.children[0].type).toBe('JSXExpressionContainer');
201
201
  expect(fragment.children[0].expression.type).toBe('TemplateLiteral');
202
202
  expect(fragment.children[0].expression.quasis[0].value.raw).toBe('333');
203
203
  });
@@ -215,9 +215,9 @@ export function App() @{
215
215
  const declaration = (ast.body[0] as AST.VariableDeclaration).declarations[0];
216
216
  const fragment = get_returned_tsrx(declaration) as any;
217
217
 
218
- expect(fragment.type).toBe('TsrxFragment');
218
+ expect(fragment.type).toBe('JSXFragment');
219
219
  expect(fragment.children.map((child: any) => child.type)).toEqual([
220
- 'TSRXExpression',
220
+ 'JSXExpressionContainer',
221
221
  ]);
222
222
  expect(fragment.children[0].expression.type).toBe('TemplateLiteral');
223
223
  expect(fragment.children[0].expression.quasis[0].value.raw).toContain('<b></b>');
@@ -1229,14 +1229,16 @@ export function App() @{
1229
1229
  const ast = parse(source, 'App.tsrx');
1230
1230
  const returned = get_returned_tsrx(ast.body[0]);
1231
1231
  const ul =
1232
- returned.type === 'Element'
1232
+ returned.type === 'JSXElement'
1233
1233
  ? returned
1234
- : returned.children.find((n: AST.Node) => n.type === 'Element') as AST.Element;
1235
- expect((ul.id as AST.Identifier).name).toBe('ul');
1234
+ : returned.children.find(
1235
+ (n: AST.Node) => n.type === 'JSXElement',
1236
+ ) as ESTreeJSX.JSXElement;
1237
+ expect((ul.openingElement.name as ESTreeJSX.JSXIdentifier).name).toBe('ul');
1236
1238
  expect(ul.children).toHaveLength(1);
1237
- const text = ul.children[0] as unknown as { type: string; expression: AST.Literal };
1238
- expect(text.type).toBe('Text');
1239
- expect(text.expression.value).toBe('var a = "123"');
1239
+ const text = ul.children[0] as unknown as { type: string; value: string };
1240
+ expect(text.type).toBe('JSXText');
1241
+ expect(text.value).toBe('var a = "123"');
1240
1242
  expect((ul.closingElement?.name as ESTreeJSX.JSXIdentifier)?.name).toBe('ul');
1241
1243
  },
1242
1244
  );