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
Currently the script tag always expects scripts to be structured as a effect hook...
// this is run on every render()=>{// this is run once the script is loaded and each time its content changesreturn()=>{// this is run when the script is unloaded (i.e. it's removed from the tree) or just before its content changes}}
Proposed Actions
The script tag should behave as a normal script by default
Utilize one of the following designs
A parameter to utilize a destructor.
It could possibly be a kwarg called destructor="...", which is the name of a JavaScript function within this script's scope that will be called on unload
Alternatively, could be a boolean flag such as returns_destructor to denote the script is a singleton function with a destructor
Instead of assuming the script is like an effect, we should be able to check if the script evals to a function, and if it does, we'll call it like an effect
Work Items
Develop a method to create normal scripts
Consider adding support for a src=... tag, if it does not exist
The text was updated successfully, but these errors were encountered:
Current Situation
Currently the script tag always expects scripts to be structured as a effect hook...
Proposed Actions
The script tag should behave as a normal script by default
Utilize one of the following designs
destructor="..."
, which is the name of a JavaScript function within this script's scope that will be called on unloadreturns_destructor
to denote the script is a singleton function with a destructorWork Items
src=...
tag, if it does not existThe text was updated successfully, but these errors were encountered: