Repository navigation
Add static engine declarations for Quarto 2 engine resolution - #15
Closed
gordonwoodhull wants to merge 1 commit into
Closed
gordonwoodhull wants to merge 1 commit into
gordonwoodhull wants to merge 1 commit into
Conversation
Adds name/claims/file-extensions to the engine's _extension.yml entry.
Quarto 2 resolves engines in two passes: pass 1 uses these static
declarations to resolve {julia} cells and .jl files to this engine
WITHOUT loading the engine module (Deno startup) just to ask whether it
claims the language. The values mirror what the engine answers
dynamically: claimsLanguage('julia') at primary priority 1, and .jl
input (file-extensions is a per-engine declaration in Quarto 2, not a
transcription of Q1's global validExtensions gate — julia's
validExtensions is empty there because jupyter's .jl entry already
passes the gate).
claims-files is deliberately omitted: julia's claimsFile is a content
sniff (percent-script detection), and Quarto 2's static content-pattern
claims are not implemented yet, so .jl input still loads the engine to
answer the file claim.
CANNOT MERGE AS-IS: Quarto 1's external-engine schema is closed
(src/resources/schema/definitions.yml) and hard-rejects these keys at
extension load — verified with a quarto-cli dev build: 'YAML Validation
Failed ... property name "name" is invalid'. Shipping this on main
would break the extension for every Quarto 1 user. The path to main is
a quarto-cli schema change that accepts (and ignores) these keys,
shipped in a stable Quarto 1 release, at which point quarto-required
should be bumped to that release. Until then, the proposal is to carry
this on a q2 branch so Quarto 2 can bundle and track it.
Author
|
The Quarto 1 forward-compat schema change this PR depends on is now filed: quarto-dev/quarto-cli#14936 (accepts and ignores |
Author
|
You know, this is more complicated than just using my fork of this repo as the upstream until Quarto 1 allows the Quarto 2 I'll close this and open a PR at that time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ask: a
q2branch on this repoThis PR can't merge to
main(explained below) — but the change is ready and tested, so what we'd actually like is for you to carry it on aq2branch here. We can't propose that directly: GitHub PRs need the target branch to exist, and only you can create it. The branch would be exactly this one commit; keeping it current is an occasional merge frommain, and I'm happy to maintain it.That gives Quarto 2 a stable, upstream-hosted target to bundle the engine from (we'd track the branch with
git subtree, the same mechanism quarto-cli uses to vendor this repo), and early adopters a real path to Julia in Quarto 2 with no fork of record — whilemainstays clean and Q1-only until the schema change below ships.What
Adds three static declarations to the engine's
_extension.ymlentry:Quarto 2 resolves engines in two passes: pass 1 uses these declarations to resolve
{julia}cells (and.jlfiles) to this engine without loading the engine module. Pass 1 is meant to be pure Rust — it shouldn't need to spawn anything as heavy as a Deno process just to ask "do you claimjulia?", but without static declarations that's exactly what happens on every render:The values mirror what the engine already answers dynamically, and these exact declarations have been exercised for months in Quarto 2's test suite, which carries a copy of this engine as a fixture (quarto-dev/q2#655).
Why it can't merge to
maintodayQuarto 1's
external-engineschema is closed (src/resources/schema/definitions.yml: onlypathis allowed), so these keys are hard-rejected at extension load — verified against this branch with a quarto-cli dev build:YAML Validation Failed ... property name "name" is invalid. This PR's CI will fail the same way; that failure is the demonstration of the blocker.The path to
main:external-engineschema to accept-and-ignore these keys — explicitly not new Quarto 1 behavior: if Quarto 1 ever honoredclaims:, it would flip its deliberate jupyter-over-julia default. I'll file that PR and link it here.mainwithquarto-requiredbumped to that release, so older Quarto 1 gets a clean "please upgrade" at install instead of schema errors.Semantics notes
file-extensionsis not a transcription ofvalidExtensions(). That's empty here — correct in Quarto 1, where it's a global admission gate jupyter's.jlentry already passes. In Quarto 2 it's a per-engine declaration, so.jlmust be listed or the engine is never asked about.jlfiles.claims-filesis deliberately omitted:claimsFileis a percent-script content sniff and Quarto 2's static content-pattern claims aren't implemented yet, so.jlinput still loads the engine. The zero-load win here covers{julia}cells in.qmdfiles.{Julia}) — a bug on our side, being fixed independently; nothing needed from you.