Re: [w3c/webcomponents] HTML Modules (#645)

Hi,
Please do not scrap the html imports idea, it seems very logical and easy to use. Please accelerate its standardization. Please provide information in this thread as to the cdn of the polyfill and a link to a detailed description of how to use the polyfill. 

I've had on-and-off contact with web development (so far) starting from 1999, so I am someone who is not too biased by deep experience in React or Angular. Here's what appears logical to me:
1. The web page is an .html file (html document).
2. Html forms the base, not javascript. We want things to be as **declarative** as possible, right?
3. An html document can import html files that are sub-pages (sub-documents), or html fragments.
If html fragments, they could be one or more component templates, or a collection of scripts and css files to include etc.
4. The import link can be given an ID.
5. A declarative html syntax should exist for the developer to automatically plop in at that location, the cloned content or sub-content of the link specified by its ID. Maybe the tag syntax could be:
```
<clone linkid="xxxxx" queryselector="yyyyy" >
```
...where xxxx is the id of the link (or leave this attribute out to select the current html doc/fragment), and:  
yyyy is the same string you would pass to document.querySelector().
6. Coming to the questions asked in the opening post in this thread, my vote is that:
```
import * as foo from "foo.html";
```` 
...looks logical, but:
```
<script type="module" url="foo.html">
```
...looks illogical and should be supported only as a quirk (if at all), because "an html file is supposed to be far more than just a script". For the second case we already have:
 ```
<link rel="import" href="foo.html" id="foo">
```
..., isn't it?
7. By default functions and variables in the script tag of an html document or in a .js file should have private scope. Same is the case with html tags in an html file. A keyword should exist like 'public' or 'protected' to control the scope/visibility of the function, variable or html tag. If this understanding is not backward compatible, an option similar to the "use strict"  option, such as "use default private" should be provided. In html the syntax could be:
```
<use default="private">
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/645#issuecomment-411130817

Received on Tuesday, 7 August 2018 17:08:06 UTC