Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Streamlit to 1.41.0 #1199

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ desktop := packages/desktop/build/*
kernel := packages/kernel/dist/*
stlite-lib-wheel := packages/kernel/py/stlite-lib/dist/stlite_lib-0.1.0-py3-none-any.whl
streamlit_proto := streamlit/frontend/lib/src/proto.d.ts
streamlit_wheel := packages/kernel/py/streamlit/lib/dist/streamlit-1.40.1-cp312-none-any.whl
streamlit_wheel := packages/kernel/py/streamlit/lib/dist/streamlit-1.41.0-cp312-none-any.whl
streamlit_frontend_lib_prod := streamlit/frontend/lib/dist/*

export USE_CONSTRAINTS_FILE := false # https://github.com/streamlit/streamlit/blob/1.27.0/.github/workflows/release.yml#L67-L68
Expand Down Expand Up @@ -138,7 +138,7 @@ $(streamlit_wheel): venv $(streamlit_proto) streamlit/lib/streamlit/**/*.py stre
SNOWPARK_CONDA_BUILD=true $(MAKE) -C streamlit distribution && \
mv $$TEMP_DIR/*.pyi ./streamlit/lib/streamlit/proto/ && \
rmdir $$TEMP_DIR && \
pyodide py-compile --keep streamlit/lib/dist/streamlit-1.40.1-py2.py3-none-any.whl && \
pyodide py-compile --keep streamlit/lib/dist/streamlit-1.41.0-py2.py3-none-any.whl && \
mkdir -p $(dir $(streamlit_wheel)) && \
cp streamlit/lib/dist/$(notdir $(streamlit_wheel)) $(streamlit_wheel)

Expand Down
2 changes: 1 addition & 1 deletion packages/common-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"check:prettier": "prettier --check ."
},
"dependencies": {
"@streamlit/lib": "1.40.1"
"@streamlit/lib": "1.41.0"
},
"devDependencies": {
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/common-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// "paths": {} /* Specify a set of entries that re-map imports to additional lookup locations. */,
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
"types": ["vite/client"], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "resolveJsonModule": true, /* Enable importing .json files */
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/bin-src/dump_artifacts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async function installPackages(
requirements.push(stliteLibWheel);
const streamlitWheel = await prepareLocalWheel(
pyodide,
path.join(wheelsDir, "streamlit-1.40.1-cp312-none-any.whl"),
path.join(wheelsDir, "streamlit-1.41.0-cp312-none-any.whl"),
);
requirements.push(streamlitWheel);

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@stlite/common": "^0.73.1",
"@stlite/common-react": "^0.73.1",
"@stlite/kernel": "^0.73.1",
"@streamlit/app": "1.40.1",
"@streamlit/app": "1.41.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.0.0",
"@types/jest": "^27.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/scripts/copy_wheels.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function main() {
);
const streamlitWheelPath = path.join(
stliteKernelPyDir,
"streamlit/lib/dist/streamlit-1.40.1-cp312-none-any.whl",
"streamlit/lib/dist/streamlit-1.41.0-cp312-none-any.whl",
);

// Create the `wheels` directory
Expand Down
2 changes: 1 addition & 1 deletion packages/kernel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"@jupyterlab/coreutils": "^5.4.2",
"@stlite/common": "^0.73.1",
"@streamlit/lib": "1.40.1",
"@streamlit/lib": "1.41.0",
"@tinyhttp/content-disposition": "^2.2.2",
"path-browserify": "^1.0.1",
"react": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/kernel/src/kernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// https://github.com/pyodide/pyodide/pull/1859
// https://pyodide.org/en/stable/project/changelog.html#micropip
import STLITE_LIB_WHEEL from "!!file-loader?name=pypi/[name].[ext]&context=.!../py/stlite-lib/dist/stlite_lib-0.1.0-py3-none-any.whl"; // TODO: Extract the import statement to an auto-generated file like `_pypi.ts` in JupyterLite: https://github.com/jupyterlite/jupyterlite/blob/f2ecc9cf7189cb19722bec2f0fc7ff5dfd233d47/packages/pyolite-kernel/src/_pypi.ts
import STREAMLIT_WHEEL from "!!file-loader?name=pypi/[name].[ext]&context=.!../py/streamlit/lib/dist/streamlit-1.40.1-cp312-none-any.whl";
import STREAMLIT_WHEEL from "!!file-loader?name=pypi/[name].[ext]&context=.!../py/streamlit/lib/dist/streamlit-1.41.0-cp312-none-any.whl";

// Ref: https://github.com/streamlit/streamlit/blob/1.12.2/frontend/src/lib/UriUtil.ts#L32-L33
const FINAL_SLASH_RE = /\/+$/;
Expand Down Expand Up @@ -290,7 +290,7 @@

public readFile(
path: string,
opts?: Record<string, any>,

Check warning on line 293 in packages/kernel/src/kernel.ts

View workflow job for this annotation

GitHub Actions / test-kernel

Unexpected any. Specify a different type
): Promise<string | Uint8Array> {
return this._asyncPostMessage(
{
Expand Down
2 changes: 2 additions & 0 deletions packages/kernel/src/pyodide-loader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference lib="WebWorker" />

import type Pyodide from "pyodide";

interface ResolvePyodideUrlResult {
Expand Down Expand Up @@ -63,7 +65,7 @@
loadPyodide = pyodideModule.loadPyodide;
} else {
importScripts(scriptURL);
loadPyodide = (self as any).loadPyodide;

Check warning on line 68 in packages/kernel/src/pyodide-loader.ts

View workflow job for this annotation

GitHub Actions / test-kernel

Unexpected any. Specify a different type
}
return loadPyodide({ ...loadPyodideOptions, indexURL: pyodideIndexURL });
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ describe("<CustomComponentIFrame />", () => {
requirements: [],
prebuiltPackageNames: [],
});
function CustomIframe(props: JSX.IntrinsicElements["iframe"]) {
return <iframe {...props} />;
}
const { container } = render(
<StliteKernelProvider kernel={kernel}>
<CustomComponentIFrame src={src} />
<CustomComponentIFrame src={src} IframeComponent={CustomIframe} />
</StliteKernelProvider>,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import { manipulateIFrameDocument } from "./iframe-manipulation";
type IFrameProps = JSX.IntrinsicElements["iframe"];
interface CustomComponentIFrameProps extends IFrameProps {
src: string;
IframeComponent: React.ComponentType<IFrameProps>;
}

const InnerIFrame = React.forwardRef<
HTMLIFrameElement,
CustomComponentIFrameProps
>(({ src: path, ...props }, ref) => {
>(({ src: path, IframeComponent, ...props }, ref) => {
const kernel = useStliteKernel();

const [srcdoc, setSrcdoc] = useState<string>();
Expand Down Expand Up @@ -74,7 +75,12 @@ const InnerIFrame = React.forwardRef<
);

return (
<iframe {...props} srcDoc={srcdoc} onLoad={handleIFrameLoad} ref={ref} />
<IframeComponent
{...props}
srcDoc={srcdoc}
onLoad={handleIFrameLoad}
ref={ref}
/>
);
});
InnerIFrame.displayName = "InnerIFrame";
Expand Down
2 changes: 2 additions & 0 deletions packages/kernel/src/worker-runtime.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference lib="WebWorker" />

import type Pyodide from "pyodide";
import type { PyProxy, PyBuffer } from "pyodide/ffi";
import { PromiseDelegate } from "@stlite/common";
Expand Down
4 changes: 3 additions & 1 deletion packages/kernel/src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/// <reference lib="WebWorker" />

import { startWorkerEnv } from "./worker-runtime";

const postMessage = (self as DedicatedWorkerGlobalScope).postMessage;
self.onmessage = startWorkerEnv(
"https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js",
(event, port) => postMessage(event, port ? [port] : undefined),
(event, port) => (port ? postMessage(event, [port]) : postMessage(event)),
);
4 changes: 2 additions & 2 deletions packages/kernel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/* Language and Environment */
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
"lib": ["DOM", "DOM.Iterable", "ESNext"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
"jsx": "react-jsx", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
Expand All @@ -31,7 +31,7 @@
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */,
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
"types": ["vite/client"], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "resolveJsonModule": true, /* Enable importing .json files */
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
Expand Down
2 changes: 1 addition & 1 deletion packages/kernel/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default defineConfig({
),
"streamlit.whl": path.resolve(
__dirname,
"./py/streamlit/lib/dist/streamlit-1.40.1-cp312-none-any.whl",
"./py/streamlit/lib/dist/streamlit-1.41.0-cp312-none-any.whl",
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/mountable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@stlite/common": "^0.73.1",
"@stlite/common-react": "^0.73.1",
"@stlite/kernel": "^0.73.1",
"@streamlit/app": "1.40.1",
"@streamlit/app": "1.41.0",
"@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sharing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@stlite/common-react": "^0.73.1",
"@stlite/kernel": "^0.73.1",
"@stlite/sharing-common": "^0.73.1",
"@streamlit/app": "1.40.1",
"@streamlit/app": "1.41.0",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.0.0",
"@types/jest": "^27.4.3",
Expand Down
2 changes: 1 addition & 1 deletion streamlit
Submodule streamlit updated 2131 files
Loading
Loading