2 ms·
Actually, this "JS based on a small number of vetted packages" is similar to my <widget> idea, so that could be how it is implemented. However, another feature
by zzo38computer 7y ago
Actually, this "JS based on a small number of vetted packages" is similar to my <widget> idea, so that could be how it is implemented. However, another feature I want (which you did not mention) is better user customization, and it would allow that, too.
As an example:
<script widgettype="http://example.org/ns/widget/unitconv" src="unitconv.js"></script>
...more stuff in between...
<li><widget widgettype="http://example.org/ns/widget/unitconv" a-unit="cups:236.5882365mL">4 cups</widget> of water
(Although not used above (due to being unneeded in this case), the widgettype attribute is also allowed for <noscript>.)
It has the following benefits:
- You can host all of the files yourself if you want to; no need for a separate package manager.
- Full backward compatibility.
- Works with browsers that don't implement <script> or <widget>, as well as browsers that implement one or the other, or both. (However, it needs to implement either <script> or the "unitconv" widget, and one or the other has to be enabled, in order for automatic unit conversion to work.)
- The user can disable features they don't want, or customize them.
- If <widget> is implemented and enabled, then the script need not be downloaded, even if <script> is implemented and enabled.
There are other possibilities too. For example, autocomplete could use wrapping a <input> inside of a <widget>.