Open
Description
Is your feature request related to a problem? Please describe.
It would be nice if actions could output attributes in SSR context.
Describe the solution you'd like
<script>
function myAction(node, params) {
// the normal action stuff for client side
}
myAction.SSR = function (params) {
return {
'data-some-key': params.someKey,
};
}
export let someKey = 'someValue';
</script>
<div use:myAction={{ someKey }}>
<!-- would render <div data-some-key="someValue"></div> -->
How important is this feature to you?
Somewhat. It's just an idea i had, that could play well with something like svelte-css-vars. Imagine that svelte-css-vars could return { style: '--color: red' }
when rendered on the server.