clean up python-wasm script#889
Conversation
✅ Deploy Preview for livecodes ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughRemoved FontAwesome vendor import and DOM stylesheet injection; simplified micropip and runtime error handling to console logging and removed historical Pyodide diagnostic comments. No exported APIs or control-flow behavior were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Size Change: -31 B (0%) Total Size: 956 kB ℹ️ View Unchanged
|
Deploying livecodes with
|
| Latest commit: |
c8dec77
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d159f02a.livecodes.pages.dev |
| Branch Preview URL: | https://cleanup-python-wasm.livecodes.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/livecodes/languages/python-wasm/lang-python-wasm-script.ts (1)
88-94: Propagate Python execution errors to the UIIn src/livecodes/languages/python-wasm/lang-python-wasm-script.ts (lines 91–94), replace the console.log(err) in the catch block with a postMessage call (e.g. postMessage({ error: err.message || String(err) })) so Python exceptions are surfaced to the user interface.
🧹 Nitpick comments (1)
src/livecodes/languages/python-wasm/lang-python-wasm-script.ts (1)
77-78: Consider improving error handling for failed package installations.While logging to the console is better than silently ignoring errors, users may not notice when a required package fails to install. This could lead to confusing runtime errors when the code tries to use the missing package.
Consider one of these improvements:
- Add the failed package to
excludedPackagesto avoid retry attempts:} catch (err) { // eslint-disable-next-line no-console console.log(err); + livecodes.excludedPackages.push(p); }
- Or collect and report installation failures to the user:
+ const failedPackages: string[] = []; for (const p of newPackages) { const pkg = (pkgMap as any)[p] ?? p; try { await livecodes.micropip.install(pkg); } catch (err) { // eslint-disable-next-line no-console console.log(err); + failedPackages.push(pkg); } } + if (failedPackages.length > 0) { + parent.postMessage({ + type: 'console', + method: 'warn', + args: [`Failed to install packages: ${failedPackages.join(', ')}`] + }, '*'); + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/livecodes/languages/python-wasm/lang-python-wasm-script.ts(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Redirect rules - livecodes
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Header rules - livecodes
- GitHub Check: Pages changed - livecodes
- GitHub Check: tests (18.x, 1)
- GitHub Check: tests (18.x, 3)
- GitHub Check: tests (18.x, 4)
- GitHub Check: tests (18.x, 2)
- GitHub Check: tests (18.x, 5)
- GitHub Check: build
- GitHub Check: build (18.x)
- GitHub Check: build (18.x)
🔇 Additional comments (1)
src/livecodes/languages/python-wasm/lang-python-wasm-script.ts (1)
2-2: LGTM! Clean removal of FontAwesome dependency.The FontAwesome import has been successfully removed, aligning with the PR objectives stating that matplotlib no longer requires FontAwesome icons.
|




Summary by CodeRabbit
Refactor
Chores