michael-s-molina commented on code in PR #38603:
URL: https://github.com/apache/superset/pull/38603#discussion_r2926646291


##########
superset-frontend/src/core/editors/AceEditorProvider.tsx:
##########
@@ -186,6 +190,19 @@ const createAceEditorHandle = (
   resize: () => {
     aceEditorRef.current?.editor?.resize();
   },
+
+  onDidChangeContent: (listener, thisArgs?) => {
+    const editor = aceEditorRef.current?.editor;
+    if (!editor) return new Disposable(() => {});
+    const bound = (thisArgs ? listener.bind(thisArgs) : listener) as (
+      value: string,
+    ) => void;
+    const handler = () => bound(editor.getValue());

Review Comment:
   Great observation @villebro.
   
   The `onDidChangeContent` event has been updated to deliver a 
`ContentChangeEvent` instead of a raw string —  providing a lazy `getValue()` 
to avoid unnecessary work on every keystroke, alongside a changes array 
describing the individual edits. Debouncing is left to consumers rather than 
built in, since different subscribers have different latency requirements and 
no single delay can satisfy all of them — following the convention of VS Code, 
Monaco, and CodeMirror. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to