Skip to content

Fix pages redirect_from with a prefix and use_pages in Jupyter, document dash.hooks - #4196

Open
T4rk1n wants to merge 4 commits into
devfrom
fix/p2-size1-docs
Open

T4rk1n wants to merge 4 commits into
devfrom
fix/p2-size1-docs

Conversation

@T4rk1n

@T4rk1n T4rk1n commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Bundles four small fixes, one commit each.

  • Add docstrings to dash.hooks (fixes [BUG] Dash Hooks missing docstring #3979): every hook on dash.hooks now says what its function receives and returns, with an example. The class docstring covers plugin loading through the dash_hooks entry point, priority and final. test_hook013 keeps the public hook API documented.
  • Document meta tag generation in the AI docs (fixes Improve AI documentation of meta tags & replace constructor section with link to code to avoid drift. #4051): the meta tag section of .ai/ARCHITECTURE.md now explains where the tags come from, their order, how defaults are overridden and how values are escaped. The copied Dash() constructor parameter list is replaced by a pointer to dash/dash.py so it cannot drift.
  • Fix pages redirect_from with a path prefix (fixes [BUG]-Pages redirection doesn't on DE workspace #3549): the redirect route was registered under requests_pathname_prefix, but the server receives requests under routes_pathname_prefix. Behind a proxy that strips the prefix (DE workspace) it returned 404. The target was also prefixed twice, so url_base_pathname="/app/" redirected to /app/app/<page>. Checked on Flask, FastAPI and Quart. test_pare004 covers both cases.
  • Fix use_pages=True in Jupyter (fixes jupyter_mode='external' doesn't work with use_pages=True #3132): _module_name_is_package read __main__.__file__, which a Jupyter kernel's __main__ does not have. test_pala008 runs a pages app from a bare __main__.

New tests fail before their fix and pass after. All tests in tests/integration/multi_page and tests/integration/test_hooks.py pass headless.

Document every hook on the public dash.hooks API with what the function
receives, what it returns, and an example, plus a class docstring on
plugin loading, priority and final hooks.

Fixes #3979
Explain where the index page meta tags come from, their order, how
defaults are overridden and how values are escaped. Replace the copied
Dash() constructor parameter list with a pointer to dash/dash.py so it
cannot drift.

Fixes #4051
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Dash performance benchmarks

✅ all within thresholds

scenario metric p90 (ms) median growth baseline p90 note
✅ callback_chain chain_ms 329.2 318.0 0.94x 595.4
✅ callback_chain graph_ms 1.3 1.3 1.0x 2.1
✅ callback_fanout fanout_ms 56.6 52.3 0.89x 88.3
✅ deep_nesting render_ms 35.3 33.2 0.97x 61.1
✅ full_children_replace replace_ms 99.7 62.1 2.6x 161.2
✅ initial_render_large render_ms 393.2 364.7 1.01x 697.8
✅ initial_render_small render_ms 62.4 57.8 0.94x 102.7
✅ patch_append_nested append_ms 77.7 59.0 2.37x 127.2
✅ patch_append_toplevel append_ms 78.7 59.8 2.42x 165.8
✅ patch_scalar_update_large update_ms 95.0 86.6 0.94x 144.7
✅ rerender_existing_subtree rerender_ms 74.5 65.1 0.93x 121.0
✅ wildcard_all_resolve wildcard_ms 195.4 188.6 0.96x 313.4
✅ wildcard_all_resolve graph_ms 0.8 0.8 1.0x 1.2

growth = late-third / early-third per-op time; ~1 is flat, a large value means the per-op cost scales with accumulated state.

machine scale vs baseline: 0.59x - divided out of the baseline ratios so they compare like for like (the absolute warn/fail ceilings are left un-scaled); calibrated on initial_render_small.

The redirect route was registered under requests_pathname_prefix, but
the server receives requests under routes_pathname_prefix. Behind a
proxy that strips the prefix, like the DE workspace, the redirect
returned 404. The target was also prefixed twice, since the backends
already apply get_relative_path, so url_base_pathname apps redirected
to /app/app/<page>.

Fixes #3549
@T4rk1n T4rk1n changed the title Document dash.hooks and meta tag generation Fix pages redirect_from with a prefix and use_pages in Jupyter, document dash.hooks Nov 25, 2026
@sonarqubecloud

Copy link
Copy Markdown

@camdecoster camdecoster self-assigned this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants