ripple 0.2.21 → 0.2.22

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ripple is a TypeScript UI framework for the web",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.2.21",
6
+ "version": "0.2.22",
7
7
  "type": "module",
8
8
  "module": "src/runtime/index.js",
9
9
  "main": "src/runtime/index.js",
@@ -787,8 +787,8 @@ const visitors = {
787
787
 
788
788
  if (
789
789
  left.type === 'MemberExpression' &&
790
- ((left.property.type === 'Identifier' && is_tracked_name(left.property.name)) ||
791
- left.computed)
790
+ left.property.type === 'Identifier' &&
791
+ is_tracked_name(left.property.name)
792
792
  ) {
793
793
  return b.call(
794
794
  '$.set_property',
@@ -30,3 +30,15 @@ exports[`basic > render static text 1`] = `
30
30
 
31
31
  </div>
32
32
  `;
33
+
34
+ exports[`basic > renders simple JS expression logic correctly 1`] = `
35
+ <div>
36
+ <div>
37
+ {"0":"Test"}
38
+ </div>
39
+ <div>
40
+ 1
41
+ </div>
42
+
43
+ </div>
44
+ `;
@@ -510,6 +510,20 @@ describe('basic', () => {
510
510
  expect(evenDiv.textContent).toBe('Even');
511
511
  });
512
512
 
513
+ it('renders simple JS expression logic correctly', () => {
514
+ component Example() {
515
+ let test = {}
516
+ let counter = 0;
517
+ test[counter++] = 'Test';
518
+
519
+ <div>{JSON.stringify(test)}</div>
520
+ <div>{JSON.stringify(counter)}</div>
521
+ }
522
+ render(Example);
523
+
524
+ expect(container).toMatchSnapshot();
525
+ });
526
+
513
527
  it('renders with simple reactive objects', () => {
514
528
  component Basic() {
515
529
  let $user = {