Skip to content

Commit

Permalink
Merge branch 'master' into hh-vue3
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Mar 19, 2024
2 parents 086c6e0 + 521e74c commit b9dcb47
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
continue-on-error: ${{ matrix.version == 'nightly'}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1.7'
- '1'
- 'nightly'
os:
- ubuntu-latest
Expand All @@ -33,7 +34,7 @@ jobs:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1.7'
version: '1'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ OffsetArrays = "1"
OrderedCollections = "1"
Parameters = "0.12"
Pkg = "1.6"
PrecompileTools = "1.2"
Random = "1.6"
Reexport = "1"
Requires = "1"
Expand Down
17 changes: 16 additions & 1 deletion assets/css/stipplecore.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@
border-radius: 5px;
box-shadow: 0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);
}
.stipple-core header {
padding-top:5px;
padding-left: 5px;
}

.stipple-core a {
color: steelblue;
}

.container { margin-bottom: 20px; }
.stipple-core .st-module > h1,
.stipple-core .st-module > h2,
Expand Down Expand Up @@ -87,7 +96,9 @@
.stipple-core .text-h1,
.stipple-core h1 {
line-height: 2.5rem;
font-size: 4rem;
}

.stipple-core .text-h2,
.stipple-core h2 {
line-height: 2rem;
Expand Down Expand Up @@ -265,6 +276,10 @@
.stipple-core .q-field--standout .text-white .q-field__native {
color: var(--q-color-white);
}
.stipple-core .q-field__control-container .material-icons {
margin-top: auto;
margin-bottom: auto;
}
.stipple-core .q-badge {
font-weight: 700;
padding: 4px 6px;
Expand Down Expand Up @@ -540,4 +555,4 @@ body > .q-loading-bar {
}
}

[v-cloak] { display: none; }
[v-cloak] { display: none; }
4 changes: 2 additions & 2 deletions src/Pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ function Page( route::Union{Route,String};
Core.eval(context, model)
elseif isa(model, Module)
context = model
@eval(context, Stipple.ReactiveTools.@init(debounce = $debounce, transport = $transport, core_theme = $core_theme))
() -> @eval(context, Stipple.ReactiveTools.@init(debounce = $debounce, transport = $transport, core_theme = $core_theme))
elseif model isa DataType
@eval(context, Stipple.ReactiveTools.@init($model; debounce = $debounce, transport = $transport, core_theme = $core_theme))
() -> @eval(context, Stipple.ReactiveTools.@init($model; debounce = $debounce, transport = $transport, core_theme = $core_theme))
else
model
end
Expand Down
18 changes: 11 additions & 7 deletions src/ReactiveTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ function DEFAULT_LAYOUT(; title::String = "Genie App",
<% end %>
<style>
._genie_logo {
background:url('https://genieframework.com/logos/genie/logo-simple-with-padding.svg') no-repeat;background-size:40px;
padding-top:22px;padding-right:10px;color:transparent;font-size:9pt;
background:url('https://genieframework.com/logos/genie/logo-simple-with-padding.svg') no-repeat;
background-size:40px;
padding-top:22px;
padding-right:10px;
color:transparent !important;
font-size:9pt;
}
._genie .row .col-12 { width:50%;margin:auto; }
._genie .row .col-12 { width:50%; margin:auto; }
</style>
$(join(head_content, "\n "))
</head>
Expand Down Expand Up @@ -339,12 +343,12 @@ macro debounce(fieldname, ms)
end

"""
@clear_debounce
@clear_debounce
@clear_debounce fieldname
@clear_debounce App
@clear_debounce App fieldname
Clear field-specific debounce time, for setting see `@debounce`.
Expand Down Expand Up @@ -1145,7 +1149,7 @@ Registers a new page with source in `view` to be rendered at the route `url`.
```julia
@page("/", "view.html")
@page("/", ui; model = MyApp) # for specifying an explicit app
@page("/", ui; model = MyApp) # for specifying an explicit app
```
"""
macro page(expressions...)
Expand Down
50 changes: 50 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,56 @@ end
@test model.s3[] == "20"
end

module App1

using Stipple, Stipple.ReactiveTools
@app begin
@in i1 = 101
end

@app MyApp begin
@in i1 = 101
end

end

module App2
using Stipple, Stipple.ReactiveTools

@app begin
@in i2 = 102
end

@app MyApp begin
@in i2 = 102
end

end

@testset "Multipage Reactive API (implicit)" begin
@eval p1 = @page("/app1", "hello", model = App1)
@eval p2 = @page("/app2", "world", model = App2)
channel1a = get_channel(String(p1.route.action().body))
channel1b = get_channel(String(p1.route.action().body))
channel2a = get_channel(String(p2.route.action().body))
channel2b = get_channel(String(p2.route.action().body))

# channels have to be different
@test channel1a != channel1b != channel2a != channel2b
end

@testset "Multipage Reactive API (explicit)" begin
@eval p1 = @page("/app1", "hello", model = App1.MyApp)
@eval p2 = @page("/app2", "world", model = App2.MyApp)
channel1a = get_channel(String(p1.route.action().body))
channel1b = get_channel(String(p1.route.action().body))
channel2a = get_channel(String(p2.route.action().body))
channel2b = get_channel(String(p2.route.action().body))

# channels have to be different
@test channel1a != channel1b != channel2a != channel2b
end

using DataFrames
@testset "Extensions" begin
d = Dict(:a => [1, 2, 3], :b => ["a", "b", "c"])
Expand Down

0 comments on commit b9dcb47

Please sign in to comment.