dash-components-build
Use and maintain Vizro Dash Components, including Cascader/Markdown props, TypeScript source, generated Python wrappers, npm build, and browser-test constraints.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- dash-components-build
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use and maintain Vizro Dash Components, including Cascader/Markdown props, TypeScript source, generated Python wrappers, npm build, and browser-test constraints.
- disable-model-invocation
- true
03 SKILL.md 正文
Dash Components Build
Use this sub-skill when a task involves vizro-dash-components, vizro_dash_components, Cascader, Markdown, TypeScript/React component source, generated Python wrappers, webpack, or Dash component browser tests.
Route elsewhere when the task is mainly about using these components inside a broader Vizro dashboard: also load ../core-components-data-actions/SKILL.md.
Component usage
from vizro_dash_components import Cascader, Markdown
cascader = Cascader(
id="region-picker",
options=[{"label": "Europe", "value": "europe", "children": [{"label": "France", "value": "fr"}]}],
value=["europe", "fr"],
)
markdown = Markdown(
id="notes",
children="## Notes\n\nUse **Markdown** and optional MathJax.",
mathjax=True,
)
In this snapshot, Markdown accepts children; markdown_text is not a valid keyword.
Source-of-truth rule
- Edit TypeScript/React source under
vizro-dash-components/src/ts/. - Do not hand-edit generated files in
vizro-dash-components/vizro_dash_components/. - Regenerate Python wrappers and JS bundles after source changes.
Build pipeline
From vizro-dash-components/:
npm install --legacy-peer-deps
npm run build
If dash-generate-components is not found during the backend generation step, run the two phases explicitly with a Python environment where dash[dev] is installed:
npm run build:js
dash-generate-components ./src/ts/components vizro_dash_components -p package-info.json --ignore \.test\.
Why --legacy-peer-deps: npm 11 strict peer resolution can reject the package's current React 18 / react-markdown@4.3.1 combination; legacy peer resolution completed the verified build.
Testing
Browser-backed package tests:
cd vizro-dash-components
hatch run test
These require Chrome/Chromium plus Dash/Selenium fixtures. If no browser is installed, run build/import/static checks and mark browser tests blocked rather than changing code blindly.
Quick import smoke after install/build:
python - <<'PY'
from vizro_dash_components import Cascader, Markdown
print(Cascader(id='c', options=[{'label': 'A', 'value': 'a'}], value=['a']))
print(Markdown(id='m', children='**ok**'))
PY
Development patterns
- Each
.tsxfile undersrc/ts/components/becomes a Python Dash component. - Props should have useful TypeScript types and JSDoc comments because they feed Python docstrings/metadata.
- Use
setProps({...})for Dash callback-updated properties. - Internal React helpers belong in
src/ts/fragmentsorsrc/ts/utils, not exported Dash components. - Keep generated package metadata (
package-info.json,metadata.json,_imports_.py) in sync through generation.
Common failures
ModuleNotFoundErrorfor_imports_or missing component classes: generated wrappers were not produced or the local wheel was built before generation.dash-generate-components: not found: installdash[dev]in the environment or run through Hatch's generation command.- Browser test failures: confirm Chrome/Chromium first; then inspect component props/callback behavior.
- Python prop error for Markdown: use
children, notmarkdown_text.
Evidence anchors
vizro-dash-components/README.mdvizro-dash-components/AGENTS.md/CLAUDE.mdvizro-dash-components/package.jsonvizro-dash-components/src/ts/components/*vizro-dash-components/examples/app.pyandexamples/pages/*vizro-dash-components/tests/test_cascader.py
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).