babel-plugin-jsx-dom-expressions 0.35.2 → 0.35.3

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 (3) hide show
  1. package/README.md +46 -3
  2. package/index.js +1 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -39,7 +39,7 @@ Compiles to:
39
39
 
40
40
  ```jsx
41
41
  import { insert as _$insert } from "dom";
42
- import { wrap as _$wrap } from "dom";
42
+ import { effect as _$effect } from "dom";
43
43
 
44
44
  const _tmpl$ = document.createElement("template");
45
45
  _tmpl$.innerHTML = `<tr><td class="col-md-1"></td><td class="col-md-4"><a></a></td><td class="col-md-1"><a><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></td><td class="col-md-6"></td></tr>`;
@@ -53,7 +53,7 @@ const view = ({ item }) => {
53
53
  _el$4 = _el$3.firstChild,
54
54
  _el$5 = _el$3.nextSibling,
55
55
  _el$6 = _el$5.firstChild;
56
- _$wrap(() => (_el$.className = itemId === selected() ? "danger" : ""));
56
+ _$effect(() => (_el$.className = itemId === selected() ? "danger" : ""));
57
57
  _$insert(_el$2, itemId);
58
58
  _el$4.onclick = e => select(item, e);
59
59
  _$insert(_el$4, () => item.label);
@@ -73,34 +73,77 @@ The use of cloneNode improves repeat insert performance and precompilation reduc
73
73
 
74
74
  ## Plugin Options
75
75
 
76
- ### moduleName (required)
76
+ ### moduleName
77
+
78
+ - Type: `string`
79
+ - Required: Yes
77
80
 
78
81
  The name of the runtime module to import the methods from.
79
82
 
80
83
  ### generate
81
84
 
85
+ - Type: `'dom' | 'ssr'`
86
+ - Default: `'dom'`
87
+
82
88
  The output mode of the compiler. Can be "dom"(default), "ssr". "dom" is standard output. "ssr" is for server side rendering of strings.
83
89
 
84
90
  ### hydratable
85
91
 
92
+ - Type: `boolean`
93
+ - Default: `false`
94
+
86
95
  Indicate whether the output should contain hydratable markers.
87
96
 
88
97
  ### delegateEvents
89
98
 
99
+ - Type: `boolean`
100
+ - Default: `true`
101
+
90
102
  Boolean to indicate whether to enable automatic event delegation on camelCase.
91
103
 
92
104
  ### wrapConditionals
93
105
 
106
+ - Type: `boolean`
107
+ - Default: `true`
108
+
94
109
  Boolean indicates whether smart conditional detection should be used. This optimizes simple boolean expressions and ternaries in JSX.
95
110
 
96
111
  ### contextToCustomElements
97
112
 
113
+ - Type: `boolean`
114
+ - Default: `false`
115
+
98
116
  Boolean indicates whether to set current render context on Custom Elements and slots. Useful for seemless Context API with Web Components.
99
117
 
100
118
  ### builtIns
101
119
 
120
+ - Type: `boolean`
121
+ - Default: `string[]`
122
+
102
123
  Array of Component exports from module, that aren't included by default with the library. This plugin will automatically import them if it comes across them in the JSX.
103
124
 
125
+ ### effectWrapper
126
+
127
+ - Type: `string`
128
+ - Default: `effect`
129
+
130
+ This plugin leverages a heuristic for reactive wrapping and lazy evaluation of JSX expressions. This option indicates the reactive wrapper function name (`effect`), defaults to `effect`.
131
+
132
+ ### staticMarker
133
+
134
+ - Type: `string`
135
+ - Default: `@once`
136
+
137
+ Comment decorator string indicates the static expression, used to tell the compiler not to wrap them by `effect` function, defaults to `@once`.
138
+
139
+ ### memoWrapper
140
+
141
+ - Type: `string`
142
+ - Default: `memo`
143
+
144
+ Memos let you efficiently use a derived value in many reactive computations. This option indicates the memo function name, defaults to `memo`.
145
+
146
+
104
147
  ## Special Binding
105
148
 
106
149
  ### ref
package/index.js CHANGED
@@ -1476,7 +1476,7 @@ function processSpreads$1(path, attributes, { elem, isSVG, hasChildren, wrapCond
1476
1476
  runningObject.push(
1477
1477
  t__namespace.objectProperty(
1478
1478
  t__namespace.stringLiteral(key),
1479
- isContainer ? node.value.expression : node.value || Properties.has(key) ? t__namespace.booleanLiteral(true) : t__namespace.stringLiteral("")
1479
+ isContainer ? node.value.expression : node.value || (Properties.has(key) ? t__namespace.booleanLiteral(true) : t__namespace.stringLiteral(""))
1480
1480
  )
1481
1481
  );
1482
1482
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "babel-plugin-jsx-dom-expressions",
3
3
  "description": "A JSX to DOM plugin that wraps expressions for fine grained change detection",
4
- "version": "0.35.2",
4
+ "version": "0.35.3",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "peerDependencies": {
28
28
  "@babel/core": "^7.0.0"
29
29
  },
30
- "gitHead": "e0300cedae86061bcbde47e80a8007fdf28facd4"
30
+ "gitHead": "264fdaf1327aef901de0a35768d5d7e0ad44f6e3"
31
31
  }