<p dir="auto">Firstly, thanks for such an awesome project!</p>
<p dir="auto">When trying to add Javascript to customise onClick, Tooltips, etc. in the deck.gl visualisations, the text box in which you enter the code text behaves erratically. It is also unclear what is actually persisted onto the visualisation, it doesn't appear to be the code as entered.</p>
<h4 dir="auto">How to reproduce the bug</h4>
<p dir="auto">(I've given instructions for the deck.gl Scatterplot, but seems to apply to all deck.gl visualisations)</p>
<ol dir="auto">
<li>Go to Charts, Add new chart</li>
<li>Select a dataset with spatial attributes, choose deck.gl Scatterplot, click on Create New Chart</li>
<li>Configure Chart to display some data (i.e. configure the Lat-Long values)</li>
<li>Under Data configuration pane on left of screen, expand the "Advanced" collapse. Attempt to enter text in the "Javascript Tooltip Generator". It should enter duplicate values.</li>
<li>In the browser console, there should be <code class="notranslate">Uncaught TypeError: (validationErrors || []).forEach is not a function</code></li>
</ol>
<h3 dir="auto">Expected results</h3>
<p dir="auto">Text typed in the Javascipt fields in deck.gl visualisations to appear as typed. For the code entered to be executed in the context of the visualisation.</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">Text appearing in field does not match what was typed. Custom JS code doesn't appear to be executed in map.</p>
<p dir="auto">Following error appearing in browser console per character typing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="explore.fd9dbc001a8d2b732fc9.entry.js:624 Uncaught TypeError: (validationErrors || []).forEach is not a function
    at Object.SET_FIELD_VALUE (explore.fd9dbc001a8d2b732fc9.entry.js:624:32)
    at exploreReducer (explore.fd9dbc001a8d2b732fc9.entry.js:694:39)
    at combination (vendors.866d9853ec9ca701f3b8.entry.js:198222:29)
    at dispatch (vendors.866d9853ec9ca701f3b8.entry.js:197988:22)
    at 3236.54993c7b99382ace8b98.entry.js:242:12
    at 1844.8922f8dcb86356245bf9.entry.js:1075:16
    at vendors.866d9853ec9ca701f3b8.entry.js:198240:12
    at Object.onChange (7173.0ceb268407a17642e1ec.entry.js:12551:61)
    at ReactAce.push.93946.ReactAce.onChange (437abb94798b28dd8787.chunk.js:25959:24)
    at Editor.EventEmitter._signal (600b0291f89941e46ffa.chunk.js:3870:21)"><pre class="notranslate"><code class="notranslate">explore.fd9dbc001a8d2b732fc9.entry.js:624 Uncaught TypeError: (validationErrors || []).forEach is not a function
    at Object.SET_FIELD_VALUE (explore.fd9dbc001a8d2b732fc9.entry.js:624:32)
    at exploreReducer (explore.fd9dbc001a8d2b732fc9.entry.js:694:39)
    at combination (vendors.866d9853ec9ca701f3b8.entry.js:198222:29)
    at dispatch (vendors.866d9853ec9ca701f3b8.entry.js:197988:22)
    at 3236.54993c7b99382ace8b98.entry.js:242:12
    at 1844.8922f8dcb86356245bf9.entry.js:1075:16
    at vendors.866d9853ec9ca701f3b8.entry.js:198240:12
    at Object.onChange (7173.0ceb268407a17642e1ec.entry.js:12551:61)
    at ReactAce.push.93946.ReactAce.onChange (437abb94798b28dd8787.chunk.js:25959:24)
    at Editor.EventEmitter._signal (600b0291f89941e46ffa.chunk.js:3870:21)
</code></pre></div>
<h4 dir="auto">Screenshots</h4>
<p dir="auto">This is what appeared after typing a single <code class="notranslate">d</code> character:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1272984/159888427-0441936c-0b60-4e2a-910b-cf177a508bb7.png"><img src="https://user-images.githubusercontent.com/1272984/159888427-0441936c-0b60-4e2a-910b-cf177a508bb7.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">This is after typing <code class="notranslate">d =&gt;</code>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1272984/159888547-dc49cfcf-441e-45ea-8d81-9679dae7be89.png"><img src="https://user-images.githubusercontent.com/1272984/159888547-dc49cfcf-441e-45ea-8d81-9679dae7be89.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>browser type and version:
<ul dir="auto">
<li>Mozilla Firefox 98.0 (64-bit)</li>
<li>Google Chrome Version 99.0.4844.51 (Official Build) (64-bit)</li>
</ul>
</li>
</ul>
<p dir="auto">(built off <code class="notranslate">apache/superset:1.4.0</code> Docker image tag)</p>
<ul dir="auto">
<li>superset version: <code class="notranslate">1.4.0</code></li>
<li>python version: <code class="notranslate">python 3.8.12</code></li>
<li>node.js version: <em>sorry, not sure how to get the node version inside the running docker container</em>?</li>
<li>any feature flags active:
<ul dir="auto">
<li><code class="notranslate">ENABLE_TEMPLATE_PROCESSING</code></li>
<li><code class="notranslate">ALERT_REPORTS</code></li>
<li><code class="notranslate">THUMBNAILS</code></li>
<li><code class="notranslate">LISTVIEWS_DEFAULT_CARD_VIEW</code></li>
<li><code class="notranslate">DASHBOARD_NATIVE_FILTERS</code></li>
<li><code class="notranslate">ENABLE_JAVASCRIPT_CONTROLS</code> (in <code class="notranslate">tooltips</code> config section)</li>
</ul>
</li>
</ul>
<h3 dir="auto">Checklist</h3>
<p dir="auto">Make sure to follow these steps before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if there are any.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar.</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto">I'm aware this functionality is fairly old (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="286867552" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/4173" data-hovercard-type="pull_request" data-hovercard-url="/apache/superset/pull/4173/hovercard" href="https://github.com/apache/superset/pull/4173">#4173</a>), so I wonder if maybe a subsequent change has broken the in-browser JS parsing?</p>
<p dir="auto">Current size of dashboard.entry.js is aroung 7+ MB which causes slight sluggishness in rendering.<br>
Are there any optimizations that I can do to reduce its size and improve overall rendering speed?</p>