Skip to content

Commit

Permalink
Merge branch 'main' into don't-rerender-when-only-persist_js_state-ch…
Browse files Browse the repository at this point in the history
…anged
  • Loading branch information
fonsp committed Oct 31, 2023
2 parents 816b3e1 + 513f28d commit 0f5f709
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
14 changes: 14 additions & 0 deletions frontend/components/CellOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,21 @@ export let PlutoImage = ({ body, mime }) => {
return html`<img ref=${imgref} type=${mime} src=${""} />`
}

/**
* @param {{
* mime: string,
* body: any,
* cell_id: string,
* persist_js_state: boolean | string,
* last_run_timestamp: number,
* sanitize_html?: boolean | string,
* }} args
*/
export const OutputBody = ({ mime, body, cell_id, persist_js_state = false, last_run_timestamp, sanitize_html = true }) => {
// These two arguments might have been passed as strings if OutputBody was used as the custom HTML element <pluto-display>, with string attributes as arguments.
sanitize_html = sanitize_html !== "false" && sanitize_html !== false
persist_js_state = persist_js_state === "true" || persist_js_state === true

switch (mime) {
case "image/png":
case "image/jpg":
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ These options are not intended to be changed during normal use.
- `run_notebook_on_load::Bool = $RUN_NOTEBOOK_ON_LOAD_DEFAULT` When running a notebook (not in Safe mode), should all cells evaluate immediately? Warning: this is only for internal testing, and using it will lead to unexpected behaviour and hard-to-reproduce notebooks. It's not the Pluto way!
- `workspace_use_distributed::Bool = $WORKSPACE_USE_DISTRIBUTED_DEFAULT` Whether to start notebooks in a separate process.
- `workspace_use_distributed_stdlib::Bool? = $WORKSPACE_USE_DISTRIBUTED_STDLIB_DEFAULT` Should we use the Distributed stdlib to run processes? Distributed will be replaced by Malt.jl, you can use this option to already get the old behaviour. `nothing` means: determine automatically (which is currently the same as `true`).
- `workspace_use_distributed_stdlib::Bool? = $WORKSPACE_USE_DISTRIBUTED_STDLIB_DEFAULT` Should we use the Distributed stdlib to run processes? Distributed will be replaced by Malt.jl, you can use this option to already get the old behaviour. `nothing` means: determine automatically (which is currently `false` on Windows, `true` otherwise).
- `lazy_workspace_creation::Bool = $LAZY_WORKSPACE_CREATION_DEFAULT`
- `capture_stdout::Bool = $CAPTURE_STDOUT_DEFAULT`
- `workspace_custom_startup_expr::Union{Nothing,String} = $WORKSPACE_CUSTOM_STARTUP_EXPR_DEFAULT` An expression to be evaluated in the workspace process before running notebook code.
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/ExpressionExplorer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function macro_has_special_heuristic_inside(; symstate::SymbolsState, expr::Expr
cell_order = Pluto.ImmutableVector([fake_cell]),
)

return Pluto.cell_precedence_heuristic(fake_topology, fake_cell) < 9
return Pluto.cell_precedence_heuristic(fake_topology, fake_cell) < Pluto.DEFAULT_PRECEDENCE_HEURISTIC
end
# Having written this... I know I said I was lazy... I was wrong
end
Expand Down
3 changes: 1 addition & 2 deletions src/evaluation/WorkspaceManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ function make_workspace((session, notebook)::SN; is_offline_renderer::Bool=false
Malt.InProcessWorker
elseif something(
session.options.evaluation.workspace_use_distributed_stdlib,
true
# VERSION < v"1.8.0-0"
Sys.iswindows() ? false : true
)
Malt.DistributedStdlibWorker
else
Expand Down

0 comments on commit 0f5f709

Please sign in to comment.