You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Many improvements to devtools, including dark-mode logo, tabs, and
embedded gitter chat
- Added componentWillMount callback
- Make createTree([]) be treated as fragment with children
Copy file name to clipboardexpand all lines: docs/api.html
+67-46
Original file line number
Diff line number
Diff line change
@@ -300,19 +300,45 @@ <h1>
300
300
301
301
<hr></hr>
302
302
303
-
<sectionid="content"><h1id="core-api-a-classgithub-hrefhttpsgithubcomtbranyendiffhtmltreemasterpackagesdiffhtmli-classfa-fa-githubia">Core API <aclass="github" href="https://github.com/tbranyen/diffhtml/tree/master/packages/diffhtml"><iclass="fa fa-github"></i></a></h1>
304
-
<p>This reference contains all stable API documentation which is up-to-date with
305
-
the latest release. The core was designed to be minimal and familiar if you've
306
-
used browser DOM APIs such as <code>innerHTML</code> and <code>addEventListener</code>.</p>
<td>The root DOM Node to change the child contents of, but not the element itself.</td>
351
+
<td><strong>mount</strong></td>
352
+
<td>The root DOM node to update children in, but not the node itself.</td>
327
353
</tr>
328
354
<tr>
329
355
<td><strong>input</strong></td>
330
-
<td>New markup to replace into <strong>domNode</strong>.</td>
356
+
<td>New markup to replace into <strong>mount</strong>.</td>
331
357
</tr>
332
358
<tr>
333
359
<td><strong>options</strong></td>
334
-
<td><ul><li><strong>tasks:</strong> An array of tasks to run. Can swap these out completely to run custom logic instead.</li><li><strong>parser:</strong> Settings which influence the HTML parser. No parser settings available in the runtime build.</li></ul></td>
360
+
<td><ul><li><strong>tasks:</strong> An array of tasks to run. Can swap these out to modify the render flow.</li><li><strong>parser:</strong> Settings which influence the HTML parser.</li></ul></td>
335
361
</tr>
336
362
</tbody></table>
337
-
<h3id="example">Example</h3>
363
+
<h3id="examples">Examples</h3>
338
364
<pre><codeclass="language-js">import { innerHTML } from 'diffhtml';
<td>The root DOM node to update including attributes and children.</td>
363
389
</tr>
364
390
<tr>
365
-
<td><strong>markup</strong></td>
366
-
<td>New markup to replace the entire <code>domNode</code> with.</td>
391
+
<td><strong>input</strong></td>
392
+
<td>New markup to replace into <strong>mount</strong>.</td>
367
393
</tr>
368
394
<tr>
369
395
<td><strong>options</strong></td>
370
-
<td><ul><li><strong>tasks:</strong> An array of tasks to run. Can swap these out completely to run custom logic instead.</li><li><strong>parser:</strong> Settings which influence the HTML parser, not available with the runtime build.</li></ul></td>
396
+
<td><ul><li><strong>tasks:</strong> An array of tasks to run. Can swap these out to modify the render flow.</li><li><strong>parser:</strong> Settings which influence the HTML parser.</li></ul></td>
<h2id="a-hrefuseusea-middlewarefunction-or-middlewareobject"><ahref="#use">use</a><strong><code>(middlewareFunction or middlewareObject)</code></strong></h2>
409
-
<p>Can be used to mount pre-existing middleware or you can write your own.
410
-
Middleware are effectively hooks that execute in various areas of the
411
-
reconciler during a render call such as <code>innerHTML</code> or <code>outerHTML</code>.</p>
412
-
<p>A function is useful when you want to follow the transactions (which are
413
-
started and run a series of tasks), and passing an object can be cleaner when
414
-
you want to modify the Virtual Tree or automatically add properties.</p>
435
+
<p>This function is used to hook plugins into your render pipeline. These plugins
436
+
are referred to as middleware. They are meant for advanced use cases such as
437
+
observing the render flow, modifying attributes or elements, and more.</p>
438
+
<p>Middleware can be enabled and disabled via code or the browser DevTools.</p>
415
439
<p>
416
-
<ahref="/middleware.html#writing-middleware" title="null"><strong>Refer to the Middleware documentation for more in-depth
417
-
information.</strong></a>
440
+
<ahref="/middleware.html" title="null"><strong>Refer to the Middleware documentation for documentation on writing your own
<td>Use this when you don't care about the transaction start/stop, and want a cleaner way to monitor the VTree lifecycle. <p><b>- createTreeHook</b></p><p><b>- syncTreeHook</b></p><p><b>- releaseHook</b></p><p><b>- subscribe</b></p><p><b>- unsubscribe</b></p></td>
457
+
<td>Use this when you don't care about the transaction start/stop, and want a cleaner way to monitor the VTree lifecycle. <ul><li>displayName</li><li>createNodeHook</li><li>createTreeHook</li><li>syncTreeHook</li><li>releaseHook</li><li>subscribe</li><li>unsubscribe</li></ul></td>
434
458
</tr>
435
459
</tbody></table>
436
-
<h3id="examples">Examples</h3>
460
+
<h3id="examples-1">Examples</h3>
437
461
<h4id="logging-the-start-of-a-render-transaction">Logging the start of a render transaction</h4>
0 commit comments