implementing-new-features
Implementation guide for new Streamlit features. Use when adding new elements, widgets, or features that span backend, frontend, and protobufs.
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Implementation guide for new Streamlit features. Use when adding new elements, widgets, or features that span backend, frontend, and protobufs.
How to use
Zapoznaj się z architekturą Streamlit, zwłaszcza runtime'em backendu, renderowaniem frontendu i komunikacją WebSocket, aby zrozumieć, jak nowa funkcja będzie się integrować z systemem.
Rozpocznij od zmian w plikach protobuf w katalogu
proto/. Jeśli dodajesz nowy element, dodaj go doproto/streamlit/proto/Element.proto, a następnie uruchommake protobufaby wygenerować niezbędne pliki.Przejdź do implementacji backendu w
lib/streamlit/. Dodaj nowy element dolib/streamlit/__init__.pyi utwórz testy jednostkowe wlib/tests. Uruchom testy za pomocąuv run pytest lib/tests/streamlit/nazwa_testu.py.Zaimplementuj frontend w katalogu
frontend/. Dla nowych elementów dodaj je dofrontend/lib/src/components/core/Block/ElementNodeRenderer.tsx. Napisz testy Vitest w plikach*.test.tsxi uruchom je poleceniemcd frontend && yarn vitest.Dodaj testy end-to-end w
e2e_playwright/używając Playwright. Uruchom je za pomocąmake run-e2e-test e2e_playwright/nazwa_testu.py.Uruchom
make autofixaby automatycznie naprawić formatowanie i błędy lintingu, a następniemake verifyaby potwierdzić, że cała implementacja działa poprawnie.