Stipple.jl
Stipple.jl copied to clipboard
Stipple.init: vue_app_name does not affect HTML root element name
If I choose a custom name for my vue app via supplying the vue_app_name kwarg to Stipple.init, the Genie app doesn't work, because the generated HTML root element (as created by the page() function) still has the standard name. This results in a javascript error (#xyz not found)
I believe the problem lies with the vm() = root() function in Elements.jl, which does not refer to what was previously supplied to Stipple.init:
function root(app::M)::String where {M<:ReactiveModel}
Genie.Generator.validname(typeof(app) |> string)
end
That sounds like the root() cause, indeed! Have you tried overwriting root(), e.g.
Stipple.root(::MyModel) = "my_highly_desired_alternative_name"
Please let me know if that helps.
close enough :)! This helped:
function root(app::Type{M})::String where {M<:ReactiveModel}
"I_am_so_happy_I_can_use_this_name"
end
(needed to overwrite the Type{M} function)
If it only always was that easy to get to the root of the problem 👀