DrSensor / nusa

incremental runtime that bring both simplicity and power into webdev (buildless, cross-language, data-driven)
MIT License
4 stars 0 forks source link

Support linking module to body and single element #64

Open DrSensor opened 1 year ago

DrSensor commented 1 year ago

link module to <body>

<head>
  <script src=//esm.run/nusa/link/root></script>
</head>

<link let=root href=module.js>
<link target="input[type=button]" href=counter.js>

<body>
  <input :=root.Log type=text :: value:=root.msg placeholder:=root.default>
  <input :=root.Log type=button :: value:=count on:click=increment>
</body>

link module to specific element

<script src=//esm.run/nusa/link/element></script>

<input :=io.Log
 type=text
 ::="<link scope=self let=io href=module.js>"
 value:=io.msg
 placeholder:=io.default
>

🤔 Question: should the default (when no scope attribute) binding pass to children too like in render-scope > template[shadowrootmode] *

Possible value for scope attribute: