From b05fd00a1e7da5499390902c1be00a05cac34857 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Sun, 21 Jan 2024 11:45:25 +0100 Subject: [PATCH 1/6] remove "helvetica, arial" from font stack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so that the ☺️ emoji works --- frontend/editor.css | 10 +++++----- frontend/error.css | 4 ++-- frontend/welcome.css | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/editor.css b/frontend/editor.css index f97b297873..d8bc4ee8d0 100644 --- a/frontend/editor.css +++ b/frontend/editor.css @@ -34,10 +34,10 @@ --pluto-operator-ligatures: none; --julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace; --sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; - --system-ui-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; color-scheme: light dark; } @@ -2410,7 +2410,7 @@ pluto-helpbox.hidden > section { /* see https://github.com/JuliaDocs/Documenter.jl for author information */ .helpbox-docs { - font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Helvetica", "Arial", sans-serif; + font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; line-height: 1.5; font-size: 0.9rem; } diff --git a/frontend/error.css b/frontend/error.css index 26b5fee8c6..defc7c1282 100644 --- a/frontend/error.css +++ b/frontend/error.css @@ -3,8 +3,8 @@ } :root { - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; --system-fonts-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; color-scheme: light dark; diff --git a/frontend/welcome.css b/frontend/welcome.css index c1e76db4f2..48de994018 100644 --- a/frontend/welcome.css +++ b/frontend/welcome.css @@ -7,10 +7,10 @@ --pluto-operator-ligatures: none; --julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace; --sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; color-scheme: light dark; } From 7b6348ebbf4aa66f1657017bce39dcb036c41f42 Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Sun, 21 Jan 2024 16:59:48 +0100 Subject: [PATCH 2/6] fix tests on nightly (#2786) * fix tests on nightly * Update helpers.jl --- .github/workflows/Test.yml | 2 +- test/helpers.jl | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index ba4243ef08..359a6a6149 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -34,7 +34,7 @@ jobs: fail-fast: false matrix: # We test quite a lot of versions because we do some OS and version specific things unfortunately - julia-version: ["1.6", "1.8", "1.10"] #, "nightly"] # "~1.11.0-0"] + julia-version: ["1.6", "1.8", "1.10", "nightly"] # "~1.11.0-0"] os: [ubuntu-latest, macOS-latest, windows-latest] steps: diff --git a/test/helpers.jl b/test/helpers.jl index ff7406b42d..a436f87fc7 100644 --- a/test/helpers.jl +++ b/test/helpers.jl @@ -48,9 +48,14 @@ end function expecterror(err, cell; strict=true) cell.errored || return false - io = IOBuffer() - showerror(io, err) - msg = String(take!(io)) + msg = sprint(showerror, err) + + # UndefVarError(:x, #undef) + if err isa UndefVarError && !isdefined(err, :scope) && VERSION > v"1.10" + strict = false + msg = first(split(msg, '\n'; limit=2)) + end + if strict return cell.output.body[:msg] == msg else From 2908512153e1b9afc9c58d57167328e64363f6f1 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Mon, 22 Jan 2024 09:39:30 +0100 Subject: [PATCH 3/6] Revert "remove "helvetica, arial" from font stack" This reverts commit b05fd00a1e7da5499390902c1be00a05cac34857. --- frontend/editor.css | 10 +++++----- frontend/error.css | 4 ++-- frontend/welcome.css | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/editor.css b/frontend/editor.css index d8bc4ee8d0..f97b297873 100644 --- a/frontend/editor.css +++ b/frontend/editor.css @@ -34,10 +34,10 @@ --pluto-operator-ligatures: none; --julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace; --sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol", system-ui, sans-serif; - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol", system-ui, sans-serif; + --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --system-ui-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; color-scheme: light dark; } @@ -2410,7 +2410,7 @@ pluto-helpbox.hidden > section { /* see https://github.com/JuliaDocs/Documenter.jl for author information */ .helpbox-docs { - font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Helvetica", "Arial", sans-serif; line-height: 1.5; font-size: 0.9rem; } diff --git a/frontend/error.css b/frontend/error.css index defc7c1282..26b5fee8c6 100644 --- a/frontend/error.css +++ b/frontend/error.css @@ -3,8 +3,8 @@ } :root { - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; --system-fonts-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; color-scheme: light dark; diff --git a/frontend/welcome.css b/frontend/welcome.css index 48de994018..c1e76db4f2 100644 --- a/frontend/welcome.css +++ b/frontend/welcome.css @@ -7,10 +7,10 @@ --pluto-operator-ligatures: none; --julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace; --sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol", system-ui, sans-serif; - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", - "Segoe UI Symbol", system-ui, sans-serif; + --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; color-scheme: light dark; } From 4ef3c4fabcfecd1a32895761ec13388c1b22d9d0 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Mon, 22 Jan 2024 09:45:10 +0100 Subject: [PATCH 4/6] try again to remove Helvetica Arial from font stacks --- frontend/editor.css | 10 +++++----- frontend/error.css | 4 ++-- frontend/welcome.css | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/editor.css b/frontend/editor.css index f97b297873..49998a2c8c 100644 --- a/frontend/editor.css +++ b/frontend/editor.css @@ -34,10 +34,10 @@ --pluto-operator-ligatures: none; --julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace; --sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; - --system-ui-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; + --system-ui-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; color-scheme: light dark; } @@ -2410,7 +2410,7 @@ pluto-helpbox.hidden > section { /* see https://github.com/JuliaDocs/Documenter.jl for author information */ .helpbox-docs { - font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Helvetica", "Arial", sans-serif; + font-family: var(--lato-ui-font-stack); line-height: 1.5; font-size: 0.9rem; } diff --git a/frontend/error.css b/frontend/error.css index 26b5fee8c6..defc7c1282 100644 --- a/frontend/error.css +++ b/frontend/error.css @@ -3,8 +3,8 @@ } :root { - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; --system-fonts-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; color-scheme: light dark; diff --git a/frontend/welcome.css b/frontend/welcome.css index c1e76db4f2..48de994018 100644 --- a/frontend/welcome.css +++ b/frontend/welcome.css @@ -7,10 +7,10 @@ --pluto-operator-ligatures: none; --julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace; --sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; color-scheme: light dark; } From b46dd6ab85674372cce0b08cfc05fe2ec730098c Mon Sep 17 00:00:00 2001 From: Paul Berg Date: Mon, 22 Jan 2024 10:16:26 +0100 Subject: [PATCH 5/6] Move precompile statements to PlutoRunner (#2778) --- .gitignore | 1 - src/precompile.jl | 12 ------------ src/runner/PlutoRunner/Project.toml | 2 ++ src/runner/PlutoRunner/src/PlutoRunner.jl | 2 ++ src/runner/PlutoRunner/src/precompile.jl | 20 ++++++++++++++++++++ 5 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 src/runner/PlutoRunner/src/precompile.jl 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 2a6bb6381f..466a7c2de1 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 From 46d1030c2f860196deaa16d35a4e1c482e7998b0 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Mon, 22 Jan 2024 10:47:33 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A6=8E=20Fix=20#2785?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl b/src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl index bc0c9ddca1..25f3fd9f6e 100644 --- a/src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl +++ b/src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl @@ -136,7 +136,12 @@ function maybe_macroexpand_pluto(ex::Expr; recursive::Bool=false, expand_bind::B funcname = ExpressionExplorer.split_funcname(ex.args[1]) if funcname.joined ∈ (expand_bind ? can_macroexpand : can_macroexpand_no_bind) - macroexpand(get_plutorunner(), ex; recursive=false)::Expr + try + macroexpand(get_plutorunner(), ex; recursive=false)::Expr + catch e + @debug "Could not macroexpand" ex exception=(e, catch_backtrace()) + ex + end else ex end