implementing-new-features
Implementation guide for new Streamlit features. Use when adding new elements, widgets, or features that span backend, frontend, and protobufs.
来源信息
- 仓库
- whitphx/streamlit
- 最近来源活动
- 2026年2月3日 18:06
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 8
- 分支
- 2
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- implementing-new-features
- description
- Implementation guide for new Streamlit features. Use when adding new elements, widgets, or features that span backend, frontend, and protobufs.
# New Feature Implementation Guide
Most features need implementation in three areas:
- Backend: `lib/streamlit/`
- Frontend: `frontend/`
- Protobufs: `proto/`
New features should include:
- Python unit tests in `lib/tests`
- Vitest unit tests
- E2E Playwright tests in `e2e_playwright/`
## Order of Implementation
1. **Protobuf changes** in `proto/` then run `make protobuf`
- New elements: add to `proto/streamlit/proto/Element.proto`
2. **Backend** in `lib/streamlit/`
- New elements: add to `lib/streamlit/__init__.py`
3. **Python unit tests** in `lib/tests`
- Run: `uv run pytest lib/tests/streamlit/the_test_name.py`
- New elements: add to `lib/tests/streamlit/element_mocks.py`
4. **Frontend** in `frontend/`
- New elements: add to `frontend/lib/src/components/core/Block/ElementNodeRenderer.tsx`
5. **Vitest tests** in `*.test.tsx`
- Run: `cd frontend && yarn vitest lib/src/components/elements/NewElement/NewElement.test.tsx`
6. **E2E Playwright tests** in `e2e_playwright/`
- Run: `make run-e2e-test e2e_playwright/name_of_the_test.py`
7. **Autofix** formatting and linting: `make autofix`
8. **Verify** the implementation: `make check`
在 GitHub 查看