Genie Discord forum

Author Avatarbienpierre
12/30/2023, 12:26:32 PM

Hello Everyone,

Thanks for the amazing work on Genie!

introduce-yourself, I came here as from julia discourse forum, Pere advised to go to the discord forum, from the message → https://discourse.julialang.org/t/admin-panel-front-end-with-julia/106720/2

I am trying to reproduce the example from Genie documentation from here --> https://learn.genieframework.com/docs/guides/adding-reactive-pages and the Multiple app modules paragraph.

First, Julia returns some minor issues, there are ending ',' on the code ending and I had to modify the StatisticAnalysis with Statistics.

But major issues is that I did not succeed in adding reactive code on a sub-module as presented :

module App

using GenieFramework

module Index
using GenieFramework

@app begin
        @out name = "John"
end

function ui()
        h1("Welcome {{name}}!")
end

end

module Form
using GenieFramework
using Statistics

@app begin
        @in N = 0
        @out m = 0.0
        @onchange N begin
        m = mean(rand(N))
        end
   end

function ui()
        cell([
        textfield("How many numbers?", :N)
        p("The average of {{N}} random numbers is {{m}}")
        ])
end

end

using .Index using .Form

@page("/", Main.App.Index.ui, DEFAULT_LAYOUT(), Main.App.Index) @page("/form", Main.App.Form.ui, DEFAULT_LAYOUT(), Main.App.Form)

end

However, if reactive parts are adding on the App module rather than sub-module, it works.

Is there possibility to keep reactive part on the sub-module and working properly ?

Warmest Regards

Author AvatarPere
12/30/2023, 5:17:46 PM

Welcome to the server @bienpierre ! And thanks for reporting this. It seems that some of the recent changes to the @pagemacro broke this example. To fix it, you need to specify the modelkeyword like this

@page("/", Main.App.Index.ui, model= Main.App.Index)
@page("/form", Main.App.Form.ui, model= Main.App.Form)

Note that specifying the layout is no longer needed. I tried with the code you posted and it worked. I'll fix the docs right away!

Author AvatarPere
12/30/2023, 5:22:28 PM

Oh and the StatisticAnalysis module the example is referring to is this one https://learn.genieframework.com/docs/guides/first-dashboard I'll change it to just use Statistic

Author Avatarbienpierre
12/30/2023, 9:02:37 PM

Thanks for answering. I tested it with Julia 1.9.4 and it works but with Julia 1.10 it doesn't work and nothing is displayed.

Author Avatarmarius.drulea
1/7/2024, 6:11:17 PM

Same issue here. Nothing is displayed on the browser and also no error appear in the console. Using Ubuntu and Julia 1.10.

Author Avatarmarius.drulea
1/7/2024, 7:00:16 PM

I just tested with Julia 1.9.4 and it still does not work

Author Avatarmarius.drulea
1/7/2024, 11:23:56 PM

I did some tests, also the most recent updates of Genie are causing problems in Julia 1.9.4: https://github.com/GenieFramework/Genie.jl/issues/698

Author AvatarPere
1/8/2024, 8:53:17 AM

thanks for reporting @marius.drulea , I'll take a look and follow up