Fix #1429 - Use basic-devtools module (#1430)

This MR brings in `$`, `$$`, and `$x` browsers devtools' utilities to our code so we can use these whenever we find it convenient.
This commit is contained in:
Andrea Giammarchi
2023-05-02 15:12:28 +02:00
committed by GitHub
parent 3a66be585f
commit 82613d016a
11 changed files with 47 additions and 27 deletions

View File

@@ -1,3 +1,5 @@
import { $$ } from 'basic-devtools';
import './styles/pyscript_base.css';
import { loadConfigFromElement } from './pyconfig';
@@ -150,7 +152,7 @@ export class PyScriptApp {
// XXX: we should actively complain if there are multiple <py-config>
// and show a big error. PRs welcome :)
logger.info('searching for <py-config>');
const elements = document.getElementsByTagName('py-config');
const elements = $$('py-config', document);
let el: Element | null = null;
if (elements.length > 0) el = elements[0];
if (elements.length >= 2) {