File tree Expand file tree Collapse file tree 4 files changed +29
-15
lines changed Expand file tree Collapse file tree 4 files changed +29
-15
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,16 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
1919WebSockets = " 104b5d7c-a370-577a-8038-80a2059c5097"
2020Widgets = " cc8bc4a8-27d6-5769-a93b-9d913e69aa62"
2121
22+ [weakdeps ]
23+ IJulia = " 7073ff75-c697-5162-941a-fcdaad2a7d2a"
24+
25+ [extensions ]
26+ IJuliaExt = " IJulia"
27+
2228[compat ]
2329AssetRegistry = " 0.1.0"
2430FunctionalCollections = " 0.5.0"
31+ IJulia = " 1.13"
2532JSON = " 0.18, 0.19, 0.20, 0.21"
2633Observables = " 0.5"
2734Requires = " 0.4.4, 0.5, 1.0.0"
Original file line number Diff line number Diff line change 1- using . AssetRegistry
2- using . Sockets
3- using . WebIO
1+ module IJuliaExt
2+
3+ using WebIO
4+ using WebIO: WEBIO_NODE_MIME
5+ using IJulia, Sockets
46
57struct IJuliaConnection <: AbstractConnection
68 comm:: IJulia.CommManager.Comm
@@ -68,16 +70,18 @@ function main()
6870 return
6971 end
7072
71- # https://github.com/JuliaLang/IJulia.jl/pull/755
72- if isdefined (IJulia, :register_jsonmime )
73- IJulia. register_jsonmime (WEBIO_NODE_MIME ())
74- else
75- @warn " IJulia doesn't have register_mime; WebIO may not work as expected. Please upgrade to IJulia v1.13.0 or greater."
76- end
73+ IJulia. register_jsonmime (WEBIO_NODE_MIME ())
7774
7875 # See comment on _IJuliaInit for what this does
7976 display (_IJuliaInit ())
77+
78+ return nothing
8079end
8180
8281WebIO. setup_provider (:: Val{:ijulia} ) = main () # calling setup_provider(Val(:ijulia)) will display the setup javascript
83- WebIO. setup (:ijulia )
82+
83+ function __init__ ()
84+ WebIO. setup (:ijulia )
85+ end
86+
87+ end
Original file line number Diff line number Diff line change @@ -95,17 +95,13 @@ function prefetch_provider_file(basename)
9595end
9696
9797provider_mux = prefetch_provider_file (" mux.jl" )
98- provider_ijulia = prefetch_provider_file (" ijulia.jl" )
9998provider_generic_http = prefetch_provider_file (" generic_http.jl" )
10099
101100function __init__ ()
102101 push! (Observables. addhandler_callbacks, WebIO. setup_comm)
103102 @require Mux= " a975b10e-0019-58db-a62f-e48ff68538c9" begin
104103 include_string (@__MODULE__ , provider_mux. code, provider_mux. file)
105104 end
106- @require IJulia= " 7073ff75-c697-5162-941a-fcdaad2a7d2a" begin
107- include_string (@__MODULE__ , provider_ijulia. code, provider_ijulia. file)
108- end
109105 @require WebSockets= " 104b5d7c-a370-577a-8038-80a2059c5097" begin
110106 include_string (@__MODULE__ , provider_generic_http. code, provider_generic_http. file)
111107 end
Original file line number Diff line number Diff line change 11using Sockets
22
3- export AbstractConnection
3+ export AbstractConnection, Connection, connection
44
55abstract type AbstractConnection end
66
7+ struct Connection{C} <: AbstractConnection
8+ conn:: C
9+ end
10+
11+ function connection end
12+ connection (c:: Connection ) = c. conn
13+
714"""
815The maximum number of messages to allow into the outbox.
916"""
You can’t perform that action at this time.
0 commit comments