ViralJS icon indicating copy to clipboard operation
ViralJS copied to clipboard

Is it possible to have decentralized web components with ViralJS?

Open codehangen opened this issue 3 years ago • 0 comments

Hi all.

I'm studying ViralJS and it might be interesting for this use case that I'm studying for academic and non-commercial purposes. So... I would like to know if it is possible in addition to decentralizing cdn, it would be possible to decentralize the ui part as well. Is it possible to have decentralized web components with ViralJS?

For example, it's very common today to use things like block-protocol, web components to modulate the html parts. But until today I've never seen a cdn focused on block-protocol or web components. This would be interesting to provide a 100% decentralized application or program.

A good use case would be, an application that works on a blockchain, but the logic or modules part is stored on a decentralized cdn also decentralized. In this way, its interoperability is achieved from all sides from its internal and external functioning. In addition, its content is also decentralized. That is, in this hypothetical example we have 3 decentralizations: content(example:"IPFS"), internal modules(example:ViralJS), part of ui that I mentioned(example: ViralJS).

Example

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Concept</title>
    <!-- Imports polyfill with cdn external 1 -->
    <script src="https://cdn.sample1.com/ajax/libs/webcomponents/webcomponents-lite.min.js"></script>
    <!-- Imports custom element with cdn external 2 -->
    <link rel="import" href="https://cdn.sample2.com/ajax/libs/webcomponents/hello-world.html">
</head>
<body>
    <!-- Runs custom element from cdn1, cdn2 -->
    <hello-world who="Unicorn"></hello-world>
</body>
</html>

fork from source-code: webcomponents/hello-world-polymer

codehangen avatar Sep 23 '22 09:09 codehangen