diff --git a/.gitignore b/.gitignore index a2b07a1d8d..4f073338b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.jl.cov *.jl.*.cov *.jl.mem -precompile.jl build Manifest.toml diff --git a/src/precompile.jl b/src/precompile.jl index 69ad276bf9..d7bbb8bd6b 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -1,18 +1,6 @@ using PrecompileTools: PrecompileTools -const __TEST_NOTEBOOK_ID = uuid1() - PrecompileTools.@compile_workload begin - let - channel = Channel{Any}(10) - Pluto.PlutoRunner.setup_plutologger( - __TEST_NOTEBOOK_ID, - channel, - ) - end - expr = Expr(:toplevel, :(1 + 1)) - Pluto.PlutoRunner.run_expression(Module(), expr, __TEST_NOTEBOOK_ID, uuid1(), nothing); - nb = Pluto.Notebook([ Pluto.Cell("""md"Hello *world*" """) Pluto.Cell("""[f(x)]""") diff --git a/src/runner/PlutoRunner/Project.toml b/src/runner/PlutoRunner/Project.toml index 191b55efc1..58ac9e3d71 100644 --- a/src/runner/PlutoRunner/Project.toml +++ b/src/runner/PlutoRunner/Project.toml @@ -12,9 +12,11 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [compat] FuzzyCompletions = "0.3,0.4,0.5" +PrecompileTools = "1" diff --git a/src/runner/PlutoRunner/src/PlutoRunner.jl b/src/runner/PlutoRunner/src/PlutoRunner.jl index f9f4f7b915..28045def8b 100644 --- a/src/runner/PlutoRunner/src/PlutoRunner.jl +++ b/src/runner/PlutoRunner/src/PlutoRunner.jl @@ -2699,4 +2699,6 @@ function setup_plutologger(notebook_id::UUID, log_channel::Channel{Any}) pluto_log_channels[notebook_id] = log_channel end +include("./precompile.jl") + end diff --git a/src/runner/PlutoRunner/src/precompile.jl b/src/runner/PlutoRunner/src/precompile.jl new file mode 100644 index 0000000000..16bd57b9b1 --- /dev/null +++ b/src/runner/PlutoRunner/src/precompile.jl @@ -0,0 +1,20 @@ +using PrecompileTools: PrecompileTools +using UUIDs: uuid1 + +const __TEST_NOTEBOOK_ID = uuid1() + +PrecompileTools.@compile_workload begin + let + channel = Channel{Any}(10) + PlutoRunner.setup_plutologger( + __TEST_NOTEBOOK_ID, + channel, + ) + end + expr = Expr(:toplevel, :(1 + 1)) + cell_id = uuid1() + workspace = Module() + PlutoRunner.run_expression(workspace, expr, __TEST_NOTEBOOK_ID, cell_id, nothing); + PlutoRunner.formatted_result_of(__TEST_NOTEBOOK_ID, cell_id, + false, String[], nothing, workspace; capture_stdout=true) +end