Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.

Commit 801fc07

Browse files
author
Oxford
committed
Introducing the CHTML explainer
2 parents 22c600a + 9ececae commit 801fc07

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

chtml/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CHTML is a suite of short specifications and technologies that **bring a compone
88
[Check this project out on GitHub](https://github.com/web-native/chtml).
99

1010
## Getting Started
11-
[Start here](/chtml/v060/specs/) for a brief overview of CHTML, then follow each topic to learn more. You may also dive straight into a subject:
11+
[Start here](/chtml/v060/specs/) for a brief overview of CHTML and follow each topic to learn more. You may also dive straight into a subject:
1212
+ [Scoped HTML](/chtml/v060/specs/scoped-html/README.md)
1313
+ [Scoped CSS](/chtml/v060/specs/scoped-css/README.md)
1414
+ [Scoped JS](/chtml/v060/specs/scoped-js/README.md)
@@ -20,7 +20,7 @@ Next, follow the [installation guide](/chtml/v060/guide/installation.md) to add
2020
+ [Installation Guide](/chtml/v060/guide/installation.md)
2121
+ [Server-Side Rendering](/chtml/v060/guide/server-side-rendering.md)
2222

23-
## Issues
23+
## Issues?
2424
We're sure there will be errors around here - typos on our docs, clever bugs in code. Feel free to bring these to our notice by filing a GitHub issue.
2525

26-
It's also important to note that CHTML is a bleeding edge technology and may change quickly. Please do thread safely! But as much as we know today, stability is just a few iterations away.
26+
It's also important to note that CHTML is a bleeding edge technology and may change quickly. Please do thread safely! But as much as we know today, stability is just a few iterations away.

chtml/v060/specs/README.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ let authorName = article.scopeTree.author.scopeTree.name;
7373

7474
Now, much structural guesswork and inefficient DOM queries have been avoided with a simple semantic markup pattern.
7575

76-
Visit the [Scoped HTML Specs](/chtml/v060/specs/scoped-html/) to learn more.
76+
Visit the [Scoped HTML docs](/chtml/v060/specs/scoped-html/) to learn more.
7777

7878
### Scoped CSS
7979
Scoped CSS is a styling approach that lets us couple smaller-sized stylesheets with elements in an HTML document. Defined rules now get scoped to these containing elements.
@@ -115,7 +115,7 @@ Scoped CSS fits right in with Scoped HTML. If we designated the `#article` eleme
115115
</div>
116116
```
117117

118-
If we wanted to style the structural parts of deeply nested scopes, a path-based ID could be used.
118+
If we wanted to style the structural parts of deeply nested scopes, a path notation would be used.
119119

120120
```html
121121
<div root id="article">
@@ -147,12 +147,12 @@ If we wanted to style the structural parts of deeply nested scopes, a path-based
147147
</div>
148148
```
149149

150-
Scoped styles save us the specificity wars that comes with document-level stylesheets. We also gain the ease of maintenace and progressive development.
150+
Scoped styles save us the specificity wars that come with document-level stylesheets. We also gain the ease of maintenace and progressive development.
151151

152-
Visit the [Scoped CSS Specs](/chtml/v060/specs/scoped-css/) to learn more.
152+
Visit the [Scoped CSS docs](/chtml/v060/specs/scoped-css) to learn more.
153153

154154
### Scoped JS
155-
Scoped JS is a special technology that lets us couple JavaScript functionality with any element in a page. Instead of the traditional way of retrieving elements into scripts, Scoped JS lets us place functionality just right where they are needed.
155+
Scoped JS is a special technology that lets us couple JavaScript functionality with any element in a page. While we traditionally maintain elements and their presentational logic separately, Scoped JS lets us place functionality just right where they are needed.
156156

157157
We define a *scoped script* with the special `text/scoped-js` MIME type.
158158

@@ -205,7 +205,7 @@ If we employed Scoped HTML in our markup, we could simply traverse the *scope tr
205205

206206
A scope may also receive application data, and further distribute received data to child scopes. Automatic *observability* steps in to do the dirty work of keeping the UI in sync with application state.
207207

208-
Visit the [Scoped JS Specs](/chtml/v060/specs/scoped-js/) to learn more.
208+
Visit the [Scoped JS docs](/chtml/v060/specs/scoped-js/) to learn more.
209209

210210
### HTML Transport
211211
HTML Transport is an export/import system for HTML. Here, reusable HTML fragments are defined as *exports* within a `<template>` element.
@@ -219,7 +219,7 @@ HTML Transport is an export/import system for HTML. Here, reusable HTML fragment
219219
</template>
220220
```
221221

222-
*Exports* can be easily placed anywhere in the main document.
222+
These *exports* could be easily placed anywhere in the main document.
223223

224224
```html
225225
<body>
@@ -228,21 +228,23 @@ HTML Transport is an export/import system for HTML. Here, reusable HTML fragment
228228
</body>
229229
```
230230

231-
In a script, we could programmatically import an *export*.
231+
And in a script, we could programmatically import an *export*.
232232

233233
```js
234234
let import1 = HTMLTransport.import('export/one');
235235
```
236236

237-
Now, while we have statically defined exports in a `<template>` element above, we could also define them as standalone HTML files on the server to dynamically bundle them together as a remote *HTML bundle*.
237+
Now, while we have statically defined exports in a `<template>` element above, we could also have defined them as standalone HTML files on the server with a view to dynamically bundling them together as a remote *HTML bundle*.
238238

239239
Here is how a remote *HTML bundle* file on the server could look:
240240

241241
**file://bundle.html**
242242

243243
```html
244-
<!-- file content -->
244+
<!-- the file at some-path/export/one.html -->
245245
<div namespace="export/one"></div>
246+
247+
<!-- the file at some-path/export/two.html -->
246248
<div namespace="export/two"></div>
247249
```
248250

@@ -261,4 +263,4 @@ This remote bundle is easily connected to a page by using the `src` attribute on
261263

262264
Code organization, extensibility and composability are HTML Transport's distinguishing features that let us build an entire app with much fewer components.
263265

264-
Visit the [HTML Transport Specs](/chtml/v060/specs/html-transport/) to learn more.
266+
Visit the [HTML Transport docs](/chtml/v060/specs/html-transport/) to learn more.

chtml/v060/specs/html-transport/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Below, we're importing a component to take on additional classes.
201201

202202
```html
203203
<template is="html-bundle">
204-
<div namespace="html/badge/user" root>...</div>
204+
<div namespace="html/badge/user" class="class0">...</div>
205205
</template>
206206
```
207207

@@ -853,4 +853,4 @@ Here are the configuration options.
853853

854854
+ `ENV.params.listAttributes` - (Array): Attributes to be treated as *list-type* attributes, in addtion to the `class`, `role` attributes (and the `scope`, `parts-hints` attributes in a ScopedHTML-based document). This is empty by default.
855855

856-
+ `ENV.params.norecomposeAttributes` - (Array): Attributes to be excluded during recomposition. This is the `nocompose` attribute itself and the `shadow` attribute, by default.
856+
+ `ENV.params.norecomposeAttributes` - (Array): Attributes to be excluded during recomposition. This is the `nocompose` attribute itself and the `shadow` attribute, by default.

0 commit comments

Comments
 (0)