Conversation
🦋 Changeset detectedLatest commit: 860d332 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe PR exposes two internal properties as unstable APIs to enable advanced users to communicate between JavaScript and Python code: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Package Stats on
|
There was a problem hiding this comment.
Pull request overview
This PR exposes internal worker and kernel instances as unstable public APIs to support advanced use cases, addressing issue #1662. The changes maintain backward compatibility while providing access to lower-level functionality with clear warnings about stability.
- Exposes
_workerproperty inStliteKernelclass by changing visibility from private to public - Exposes
_kernelproperty in the object returned frommount()function - Both exposed APIs use underscore prefix convention and include documentation noting they are unstable
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/kernel/src/kernel.ts | Changed _worker field from private to public readonly with inline documentation about unstable API status |
| packages/browser/src/mount.tsx | Added _kernel property to mount function's return object with inline documentation about unstable API status |
| .changeset/young-mails-cry.md | Changeset documenting the exposure of controller._kernel as a minor version bump |
| .changeset/olive-sites-look.md | Changeset documenting the exposure of kernel._worker as a minor version bump |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Bundle visualizer reports for
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Deployment completed successfully (log). Importable URLs:
import { StliteApp, createKernel } from "https://fa399b47.stlite-react-preview.pages.dev/stlite.js";
import "https://fa399b47.stlite-react-preview.pages.dev/stlite.css"; |
|
Deployment completed successfully (log).
|
Package Stats on
|
|
Deployment completed successfully (log).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Stlite Browser preview</title>
<link rel="stylesheet" href="https://388f0c46.stlite-browser-preview.pages.dev/stlite.css" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module">
import { mount } from "https://388f0c46.stlite-browser-preview.pages.dev/stlite.js"
mount(
{
entrypoint: "streamlit_app.py",
files: {
"streamlit_app.py": `
import streamlit as st
st.write("Hello world")
`,
},
requirements: [],
},
document.getElementById("root"),
);
</script>
</body>
</html> |
Package Stats on
|
Bundle visualizer reports for
|
|
Deployment completed successfully (log). Importable URLs:
import { StliteApp, createKernel } from "https://c04461b7.stlite-react-preview.pages.dev/stlite.js";
import "https://c04461b7.stlite-react-preview.pages.dev/stlite.css"; |
|
Deployment completed successfully (log).
|
|
Deployment completed successfully (log).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Stlite Browser preview</title>
<link rel="stylesheet" href="https://46e92992.stlite-browser-preview.pages.dev/stlite.css" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module">
import { mount } from "https://46e92992.stlite-browser-preview.pages.dev/stlite.js"
mount(
{
entrypoint: "streamlit_app.py",
files: {
"streamlit_app.py": `
import streamlit as st
st.write("Hello world")
`,
},
requirements: [],
},
document.getElementById("root"),
);
</script>
</body>
</html> |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Package Stats on
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/olive-sites-look.md(1 hunks).changeset/young-mails-cry.md(1 hunks)packages/browser/src/mount.tsx(1 hunks)packages/kernel/src/kernel.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx,json,css,scss}
📄 CodeRabbit inference engine (AGENTS.md)
Follow Prettier formatting (2 spaces, trailing commas, semicolons by default) as enforced by the project's configuration
Files:
packages/browser/src/mount.tsxpackages/kernel/src/kernel.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use workspace ESLint configs for linting
Files:
packages/browser/src/mount.tsxpackages/kernel/src/kernel.ts
🧠 Learnings (1)
📚 Learning: 2025-12-03T02:33:22.608Z
Learnt from: CR
Repo: whitphx/stlite PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T02:33:22.608Z
Learning: Applies to packages/browser/e2e-tests/**/*.{ts,tsx,js,jsx} : Browser E2E scenarios live in `packages/browser/e2e-tests`; extend them when touching mounting, requirements parsing, or iframe messaging
Applied to files:
packages/browser/src/mount.tsx
🧬 Code graph analysis (1)
packages/kernel/src/kernel.ts (1)
packages/kernel/src/types.ts (1)
StliteWorker(188-191)
⏰ 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). (6)
- GitHub Check: Agent
- GitHub Check: build-sharing-editor
- GitHub Check: test-stlite-lib
- GitHub Check: test-kernel
- GitHub Check: test-browser
- GitHub Check: spellcheck
🔇 Additional comments (3)
.changeset/olive-sites-look.md (1)
1-5: LGTM! Changeset properly documents the unstable API exposure.The minor version bump is semantically correct for exposing a new public API, and the description accurately reflects the changes.
packages/kernel/src/kernel.ts (1)
197-201: LGTM! The worker exposure correctly addresses the PR objective.The change from private to public readonly with proper JSDoc documentation enables advanced users to access the worker for custom message passing while preventing mutation and clearly signaling API instability.
packages/browser/src/mount.tsx (1)
70-74: The _kernel exposure correctly completes the API chain for advanced use cases.The addition of
_kernelto the mount return object enables access to the kernel instance and its public properties like_worker. The JSDoc documentation properly warns about the unstable API status with the underscore prefix convention.The code is correctly formatted per Prettier rules (2-space indentation, trailing comma) and follows the established patterns in the codebase. No changes needed.
| --- | ||
| "@stlite/browser": minor | ||
| --- | ||
|
|
||
| Expose controller.\_kernel as an unstable API |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find . -type f -name "mount.tsx" | head -20Repository: whitphx/stlite
Length of output: 90
🏁 Script executed:
wc -l ./packages/browser/src/mount.tsxRepository: whitphx/stlite
Length of output: 93
🏁 Script executed:
cat -n ./packages/browser/src/mount.tsxRepository: whitphx/stlite
Length of output: 3013
Verify the terminology in the changeset description.
The changeset describes exposing "controller._kernel", but the actual implementation in packages/browser/src/mount.tsx exposes _kernel as a property of the object returned by the mount() function (line 74). Users access it directly on the return value, not through a "controller" object. Consider this diff to align the description with the actual API:
-Expose controller.\_kernel as an unstable API
+Expose \_kernel as an unstable API📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| --- | |
| "@stlite/browser": minor | |
| --- | |
| Expose controller.\_kernel as an unstable API | |
| --- | |
| "@stlite/browser": minor | |
| --- | |
| Expose _kernel as an unstable API |
🤖 Prompt for AI Agents
In .changeset/young-mails-cry.md around lines 1 to 5, the changeset text
incorrectly refers to "controller._kernel" whereas the implementation exposes
_kernel as a property on the object returned by mount()
(packages/browser/src/mount.tsx, ~line 74); update the changeset wording to
accurately describe the exposed API (e.g., "Expose _kernel on the object
returned by mount() as an unstable API" or similar), ensuring terminology
matches the actual public surface so users can find the property correctly.
Bundle visualizer reports for
|
|
Deployment completed successfully (log). Importable URLs:
import { StliteApp, createKernel } from "https://a1c304f4.stlite-react-preview.pages.dev/stlite.js";
import "https://a1c304f4.stlite-react-preview.pages.dev/stlite.css"; |
|
Deployment completed successfully (log).
|
|
Deployment completed successfully (log).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Stlite Browser preview</title>
<link rel="stylesheet" href="https://afc34184.stlite-browser-preview.pages.dev/stlite.css" />
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module">
import { mount } from "https://afc34184.stlite-browser-preview.pages.dev/stlite.js"
mount(
{
entrypoint: "streamlit_app.py",
files: {
"streamlit_app.py": `
import streamlit as st
st.write("Hello world")
`,
},
requirements: [],
},
document.getElementById("root"),
);
</script>
</body>
</html> |
Resolves #1662
Summary by CodeRabbit
_workerAPI for accessing kernel worker instances_kernelAPI for accessing kernel instances through controllers_kernelproperty to mount function return values for advanced users requiring direct access to internal components✏️ Tip: You can customize this high-level summary in your review settings.