Skip to content

Commit

Permalink
undo some babel hacks; fix some eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-laplante committed May 11, 2024
1 parent 2daabb9 commit dc24d7d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 69 deletions.
4 changes: 1 addition & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ module.exports = {
[
'@babel/preset-env',
{
useBuiltIns: 'entry',
corejs: 3, // or 2, but 3 is recommended
targets: "fully supports es6-module-dynamic-import", // Example: browsers with >0.25% market share and not end-of-life
},
],
["@babel/preset-react", {"runtime": "automatic"}],
"@babel/preset-typescript"
],
plugins: [
"@babel/plugin-syntax-dynamic-import"
]
};
60 changes: 0 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.24.4",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
Expand All @@ -33,7 +32,6 @@
"eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.6.0",
"isomorphic-fetch": "^3.0.0",
"mini-css-extract-plugin": "^2.8.1",
"postcss": "^8.4.38",
"postcss-loader": "^7.3.4",
Expand Down
4 changes: 2 additions & 2 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ sys.meta_path.append(BuiltinImporterShim())
print(sys.meta_path)
`)
let file = pyodideModule.FS.readdir("./bb");
const file = pyodideModule.FS.readdir("./bb");
console.log(file);

pyodideModule.runPython(`
Expand All @@ -158,7 +158,7 @@ print(sys.meta_path)
from bb.data_smart import DataSmart
`)

let DataSmart = pyodideModule.globals.get('DataSmart');
const DataSmart = pyodideModule.globals.get('DataSmart');
const d = DataSmart();

d.setVar("A", "B");
Expand Down
5 changes: 3 additions & 2 deletions src/components/PyodideLoader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect } from 'react';

import pyodide from "pyodide";

Expand All @@ -10,13 +10,14 @@ interface Props {
const PyodideLoader: React.FC<Props> = (props: Props) => {
useEffect(() => {
async function loadPyodide() {
// noinspection TypeScriptCheckImport
const { loadPyodide: loadPyodideModule } = await import("https://cdn.jsdelivr.net/pyodide/v0.25.1/full/pyodide.mjs");
const pyodideInstance: pyodide = await loadPyodideModule();
props.setPyodide(pyodideInstance);
}

loadPyodide();
}, []);
});

return (
<div>
Expand Down

0 comments on commit dc24d7d

Please sign in to comment.