Skip to content

Commit 798c045

Browse files
save file
1 parent e39c304 commit 798c045

File tree

1 file changed

+73
-16
lines changed

1 file changed

+73
-16
lines changed

html-components/html-components.html

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@
1919

2020

2121
<style>
22-
/*
23-
@font-face {
24-
font-family: "street-eagle";
25-
src: url(/fonts/street-eagle.ttf) format('truetype');
26-
}
27-
*/
28-
29-
#links a {display:block}
30-
22+
23+
/*
24+
@font-face {
25+
font-family: "street-eagle";
26+
src: url(/fonts/street-eagle.ttf) format('truetype');
27+
}
28+
*/
29+
30+
#links a {display:block}
31+
32+
33+
.hr2
34+
{border-top:1px solid blue;margin:30px}
35+
3136
</style>
3237

3338

@@ -59,42 +64,94 @@
5964
</div>
6065

6166

67+
68+
69+
70+
6271
<div id="scroll">
6372
<div id="center" style="">
6473

6574
<!-- page html -->
6675

6776

6877
<div style="margin-bottom: 20px;">
69-
this is a work in progress, i intend to build up here a collection of reusable html components
78+
i include here a standard example of web components, which i feel went some way as to introducing the ability to include complex functionality
79+
into web pages, i feel however it fell short on a number of issues i have solved with my component.js library, these are
80+
<ul>
81+
<li>
82+
elements were scoped to the global namespace, always a problem when functionality gets ever more complex its only a matter
83+
of time before clashes occur
84+
</li>
85+
<li>
86+
methods and properties associated with the component were added to the host node of the element, again thats ok for simple
87+
components, but when components get ever more complex its going to be a problem
88+
</li>
89+
</ul>
7090
</div>
91+
92+
<div>
93+
<p>
94+
to me a component / module should have a standard lifecycle that is
95+
</p>
96+
<ul>
97+
<li>
98+
initmod, this is where local depencies are passed to the component, they fundamentally should not be relying on global
99+
state to receive their local depencies
100+
</li>
101+
<li>
102+
init, this is where the component first get executed, its an asynchronous function that allows the component to check
103+
that it has everything it needs to run, including access to the network to load resources it may need
104+
</li>
105+
<li>
106+
initdom, this is where the component is able to set up its ui, internally build the references it needs to run effeiciently
107+
in code
108+
</li>
109+
</ul>
110+
<p>
111+
components should also be effectively namespaced so they are free to load any other components that they may need without having to
112+
worry that there will ever be a clash
113+
</p>
114+
</div>
115+
<div>
116+
<p>
117+
my component library just needs to be included as a script tag, it runs on window.onload, it has a fundatmental loading stack that allows
118+
init runs to be delayed until the loading stack is complete
119+
</p>
120+
</div>
121+
122+
123+
124+
125+
<div class=hr2></div>
126+
127+
71128
<div style="margin-bottom: 20px;">
72-
users are able to supply their own components and therefore build up a rich selection of components
129+
users are able to supply their own components and therefore build up a rich selection of components
73130
</div>
74131
<div style="margin-bottom: 20px;">
75-
to get the whole thing started and supply and example, i have created the first, simple, example
132+
to get the whole thing started and supply and example, i have created the first, simple, example
76133
</div>
77134

78135
<div style="margin-bottom: 20px;">
79136
<a href="select/select.html">
80-
custom select
137+
custom select
81138
</a>
82139
</div>
83140

84141
<div style="margin-bottom: 20px;">
85142
<a href="checkbox-one/checkbox-one.html">
86-
checkbox-one
143+
checkbox-one
87144
</a>
88145
</div>
89146

90147
<div style="margin-bottom: 20px;">
91148
<a href="log/log.html">
92-
log
149+
log
93150
</a>
94151
</div>
95152

96153
<div style="margin-bottom: 20px;">
97-
keep checking back for more examples and an interface for user supplied examples
154+
keep checking back for more examples and an interface for user supplied examples
98155
</div>
99156

100157

0 commit comments

Comments
 (0)