Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of Lazy.jl #324

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSExpr = "97c1335a-c9c5-57fe-bc5d-ec35cebe8660"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Lazy = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Mustache = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70"
Expand All @@ -23,7 +22,6 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29"
HTTP = "1.5.0"
JSExpr = "0.5"
JSON = "0.21, 1.0"
Lazy = "0.13, 0.14, 0.15"
MacroTools = "0.4, 0.5"
Mustache = "0.5, 1.0"
Mux = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/AtomShell/AtomShell.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module AtomShell

using ..Blink: resource
using ..Blink: resource, @init, @errs
using Sockets
using WebIO

Expand Down
2 changes: 1 addition & 1 deletion src/AtomShell/process.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Lazy, JSON, MacroTools, Pkg.Artifacts
using JSON, MacroTools, Pkg.Artifacts

hascommand(c) =
try read(`which $c`, String); true catch e false end
Expand Down
1 change: 1 addition & 0 deletions src/Blink.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ using Logging
using Base64: stringmime
using WebIO

include("lazy/lazy.jl")
include("rpc/rpc.jl")
include("content/content.jl")

Expand Down
2 changes: 1 addition & 1 deletion src/content/content.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Mux, JSON, Lazy, Mustache
using Mux, JSON, Mustache
import HTTP: WebSocket
import HTTP.WebSockets: isclosed

Expand Down
33 changes: 33 additions & 0 deletions src/lazy/lazy.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Stuff to replace Lazy.jl with
function initm(ex)
quote
if !isdefined(@__MODULE__, :__inits__)
const $(esc(:__inits__)) = Function[]
end
if !isdefined(@__MODULE__, :__init__)
function $(esc(:__init__))()
for f in $(esc(:__inits__))
f()
end
end
end

push!($(esc(:__inits__)), () -> $(esc(ex)))
nothing
end
end

macro init(args...)
initm(args...)
end

macro errs(ex)
:(
try
$(esc(ex))
catch e
showerror(stderr, e, catch_backtrace())
println(stderr)
end
)
end
1 change: 0 additions & 1 deletion src/rpc/rpc.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import JSExpr: @js, @js_str, JSString, jsstring, jsexpr, @var, @new
using Lazy

export js, @js, @js_, @var, @new

Expand Down
Loading