You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{%#%}<script>js_script_with_reactivity</script>{%#%} - This option is also more friendly to HTML IDEs.
The script is always executed after after (re)rendering event(i.e. in post_calc_script), and in the js environment of the current reactive context.
The script may also define JS definitions, and will be visible to all scripts which is defined after the script and under the same context.
The script should have a way to attach destructor javascript functions, which will be executed when the reactive context gets destructed(i.e. in destructor script of the context).
After doing so, we may allow in-place events registering in reactive HTML element tags, via on***={{js_script}}(legacy DOM event registration) or on:***={{js_script}}(modern DOM event registration, similar to svelte).
The implementation will register them (when using the expression {{...}} indicate JS script) inside JS script and not in the printed HTML tag, since they might(and should!) reference JS code in their current JS context(which is related to the current reactive context, as discussed earlier).
This way we may and need to change the main example code and put the script inside tags and inside for loops iterations.
After doing all this, we can and need to put all reactive definitions and variables encapsulated inside a self invoked function, in a single and long HTML script tag.
The text was updated successfully, but these errors were encountered:
We need to support in-place scripting, meaning to support the user to put a script anywhere he wants (in the reactive block context of course).
As reactive element tag, we should have two options (which are identical):
{% #script %}js_script_with_reactivity{% /script %}
{%#%}<script>js_script_with_reactivity</script>{%#%}
- This option is also more friendly to HTML IDEs.The script is always executed after after (re)rendering event(i.e. in post_calc_script), and in the js environment of the current reactive context.
The script may also define JS definitions, and will be visible to all scripts which is defined after the script and under the same context.
The script should have a way to attach destructor javascript functions, which will be executed when the reactive context gets destructed(i.e. in destructor script of the context).
After doing so, we may allow in-place events registering in reactive HTML element tags, via
on***={{js_script}}
(legacy DOM event registration) oron:***={{js_script}}
(modern DOM event registration, similar to svelte).The implementation will register them (when using the expression {{...}} indicate JS script) inside JS script and not in the printed HTML tag, since they might(and should!) reference JS code in their current JS context(which is related to the current reactive context, as discussed earlier).
This way we may and need to change the main example code and put the script inside tags and inside for loops iterations.
After doing all this, we can and need to put all reactive definitions and variables encapsulated inside a self invoked function, in a single and long HTML script tag.
The text was updated successfully, but these errors were encountered: