I'm using Svelte as a part of Elderjs framework which generates static pages using Svelte templates in SSR mode.
Very often it is needed to have some js code on the static page without hydrating the whole component.
<script>
// This is executed when generating the SSR component
let something = "TESTING";
</script>
<div>
<!-- Below 'something' is evaluated both for the attribute and inside the tag -->
<div someattr={something }>This string should read {something}></div>
<!-- But here 'something' is not evaluated inside the tag -->
<!-- This code is executed in browser when the page is loaded, so it has no access to vars in <script> above -->
<script someattr={something }>console.log({something})</script>
<div>
Describe the proposed solution
The text inside nested Githubissues.
Githubissues is a development platform for aggregating issues.
Describe the problem
I'm using Svelte as a part of Elderjs framework which generates static pages using Svelte templates in SSR mode. Very often it is needed to have some js code on the static page without hydrating the whole component.
Describe the proposed solution
The text inside nested Githubissues.