Skip to content

Commit e5398ab

Browse files
save file
1 parent 729c56f commit e5398ab

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

html-components/html-components.html

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ <h3>
352352
</div>
353353

354354

355-
<div>
355+
<section>
356356
<p>
357357
The code for a component, note :
358358
</p>
@@ -427,10 +427,10 @@ <h3>
427427

428428
<code-src src='ex/define-component.js'></code-src>
429429

430-
</div>
430+
</section>
431431

432432

433-
<div>
433+
<section>
434434
<p>
435435
A typical component / module lifecycle might have :
436436
</p>
@@ -468,10 +468,10 @@ <h3>
468468
Components are also effectively namespaced so they are free to load any other components that they may need without having to
469469
worry that there will ever be a clash of variables or tag names.
470470
</p>
471-
</div>
471+
</section>
472472

473473

474-
<div style='margin-top:50px;margin-bottom:50px'>
474+
<section style='margin-top:50px;margin-bottom:50px'>
475475

476476
<p>
477477
View the full list of components
@@ -493,10 +493,10 @@ <h3>
493493
</a>
494494
</p>
495495

496-
</div>
496+
</section>
497497

498498

499-
<div>
499+
<section>
500500
<p>
501501
Here is a very simple component
502502
</p>
@@ -505,7 +505,7 @@ <h3>
505505
and the code to include it
506506
</p>
507507
<snippet-html id=demo-example-1 component src='https://libs.ext-code.com/html/demo/demo-example/examples/demo-example-1.html'></snippet-html>
508-
</div>
508+
</section>
509509

510510

511511
<section>
@@ -518,8 +518,17 @@ <h3>
518518
</p>
519519
<snippet-html id=demo-example-2-sh component src='https://libs.ext-code.com/html/demo/demo-example-2/examples/demo-example.html'></snippet-html>
520520
<p>
521-
Here we have to give the component.js library a chance to load and build the component, mod.stack is a list of functions to
522-
when the component.js library has finished initialising.
521+
Here we have to give the component.js library a chance to load and build the component,
522+
<code>
523+
mod.stack[]
524+
</code>
525+
is an array of functions that get run when the component.js library has finished initialising.
526+
</p>
527+
<p>
528+
The trouble with this approach is that as web pages and components get more complex, they start relyng on co-depencies,
529+
or they require the same resources that can potentially be loaded multiple times. The standard lifecycle is a way out
530+
of that. Often the component itself needs to load resources to be able to run, the component.js library provides a
531+
mechanism to ensure that all components on the page are loaded and available.
523532
</p>
524533
</section>
525534

0 commit comments

Comments
 (0)