Consolidate JSON editors to Monaco - #62708
Merged
guan404ming merged 2 commits intoMar 7, 2026
Merged
Conversation
guan404ming
force-pushed
the
consolidate-editors-to-monaco
branch
4 times, most recently
from
March 5, 2026 04:28
f14d880 to
a631974
Compare
guan404ming
marked this pull request as ready for review
March 5, 2026 06:05
guan404ming
requested review from
bbovenzi,
choo121600,
pierrejeambrun,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
March 5, 2026 06:05
guan404ming
force-pushed
the
consolidate-editors-to-monaco
branch
2 times, most recently
from
March 6, 2026 11:08
66efec8 to
13a99fb
Compare
Contributor
|
But we need to fix tests and static checks |
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
guan404ming
force-pushed
the
consolidate-editors-to-monaco
branch
from
March 6, 2026 16:45
13a99fb to
0bba12f
Compare
7 tasks
Member
Author
|
Thanks for the review. Just fixed and ci looks happy. |
1 task
dominikhei
pushed a commit
to dominikhei/airflow
that referenced
this pull request
Mar 11, 2026
* Consolidate JSON editors to Monaco Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> * Fix e2e test Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com> --------- Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
1 task
1 task
isshishi
added a commit
to aws/amazon-mwaa-docker-images
that referenced
this pull request
Jul 8, 2026
…ch (#540) *Issue #, if available:* [Asana Task](https://app.asana.com/1/8442528107068/project/1213144794262738/task/1215792656662185) [Service Team accessible design doc](https://amazon.sharepoint.com/:fl:/r/contentstorage/CSP_e71a9f97-c26e-4ab3-aae0-958e776f08b7/Document%20Library/LoopAppData/3.2.1%20UI%20loads%20Monaco%20editor%20from%20public%20CDN.loop?d=w7e9f3a5b54eb4656bedea3d0e68b6417&csf=1&web=1&e=xAuOTr&nav=cz0lMkZjb250ZW50c3RvcmFnZSUyRkNTUF9lNzFhOWY5Ny1jMjZlLTRhYjMtYWFlMC05NThlNzc2ZjA4YjcmZD1iJTIxbDU4YTUyN0NzMHFxNEpXT2QyOEl0eURsbVhyZ1lOeFBtblh0X2w0dEVNMnBQMnA3S21CalFJY2dnN1QtYTRQaCZmPTAxS1gySkxWQzNIS1BYNTIyVUtaREw1WFZEMkRUSVdaQVgmYz0lMkYmYT1Mb29wQXBwJnA9JTQwZmx1aWR4JTJGbG9vcC1wYWdlLWNvbnRhaW5lciZ4PSU3QiUyMnclMjIlM0ElMjJUMFJUVUh4aGJXRjZiMjR1YzJoaGNtVndiMmx1ZEM1amIyMThZaUZzTlRoaE5USTNRM013Y1hFMFNsZFBaREk0U1hSNVJHeHRXSEpuV1U1NFVHMXVXSFJmYkRSMFJVMHljRkF5Y0RkTGJVSnFVVWxqWjJjM1ZDMWhORkJvZkRBeFMxZ3lTa3hXUmtVek0wNUtRelZCVVVOT1JVazFTVkpPUlVSV00wNWFXbGslM0QlMjIlMkMlMjJpJTIyJTNBJTIyOWVjMWUzMWItNDNkMS00MGQ3LTkxODEtNWE4NzQwMzQ5NjI0JTIyJTdE) *Description of changes:* Airflow 3.2.0/3.2.1 ship a UI that lazy-loads the Monaco code editor from the public CDN `cdn.jsdelivr.net` at runtime, in the end user's browser. This breaks the JSON/code editor surfaces (DAG Code, XComs, Rendered Templates, Connection Edit "extra", Trigger DAG with config, Audit Log JSON) for air-gapped or restricted-egress environments whose browsers cannot reach the CDN, and loads unverified third-party JS into authenticated sessions for everyone else. Upstream introduced this in 3.2.0 (apache/airflow#62708) and reverted it in 3.2.2 (apache/airflow#66647). This change backports the effect onto 3.2.1 by vendoring Monaco into the image and serving it same-origin from the Airflow webserver, so the browser makes zero external requests for the editor. ## What this changes Adds one build-time bootstrap step: `images/airflow/3.2.1/bootstrap/02-airflow/002-vendor-monaco-editor.sh`. At image-build time it: 1. Downloads `monaco-editor` 0.52.2 from the npm registry and verifies a pinned sha512. 2. Extracts `min/vs` and the MIT LICENSE into the Airflow UI dist at `ui/dist/assets/monaco/0.52.2/` 3. Rewrites the one bundled jsDelivr base URL to the same-origin path `/static/assets/monaco/0.52.2/min/vs`. 4. Installs a small `MonacoEnvironment.getWorkerUrl` shim (referenced from `index.html`) so Monaco's language Web Workers boot from an absolute same-origin base at runtime. 5. Fails loud on pre/post-flight checks (the CDN literal must exist before the rewrite; zero `cdn.jsdelivr.net` references and the vendored assets must exist after) and is idempotent (an already-rewritten bundle is a no-op). ## Testing Local build: `./build.sh docker` builds the 3.2.1 image pass along with the with in-image checks added; Runtime: Deployed the patched image and exercised the Monaco surfaces with `*cdn.jsdelivr.net*` **blocked** in the browser to simulate a restricted-egress client (PRIVATE_ONLY environments). All pass with zero `cdn.jsdelivr.net` requests and zero console errors: - Monaco assets load same-origin from `/static/assets/monaco/0.52.2/min/vs/...` (HTTP 200). - Audit Log renders. - Connection Edit "extra" (JSON): editor renders; invalid JSON shows live validation squiggles (the language Web Worker loads and runs same-origin). - DAG Code: renders with Python syntax highlighting. - Trigger DAG with config: the JSON editor renders and functions. Blocking the CDN in the browser reproduces the exact failure condition for restricted-egress clients (PRIVATE_ONLY environment): the defect and the fix are entirely browser-side (an external CDN fetch) and image-side (Monaco vendored at build time and served same-origin from disk), so this exercises the same code paths a fully air-gapped environment would, without depending on any particular network topology. ## References - apache/airflow#66647 (upstream fix / revert in 3.2.2) - apache/airflow#66020 (upstream bug report) - apache/airflow#62708 (upstream introduction in 3.2.0) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
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.
Related Issue
#61834
Why
The UI bundled three separate editor libraries (CodeMirror, react-json-view, Monaco) for JSON editing and display, adding unnecessary dependency weight.
How
Screen.Recording.2026-03-03.at.8.51.41.PM.mov
Was generative AI tooling used to co-author this PR?
Claude Code with Opus 4.6
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.