add `assets_ignore` to include full path in regex search
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
Is your feature request related to a problem? Please describe.
We structure our assets folders to have different subfolders inside of them, and in a path we have css files we'd like to ignore (used for pdf generation with weasyprint).
so for example:
assets/subpath/base.css
The behavior I'd have expected is to be able to pass ".*\/subpath\/.*" as a valid regex string to ignore all files in the subpath dir. But instead https://github.com/plotly/dash/blob/a7a12d180e16eac0a84b88e2b8dc8f7c7601cbaf/dash/dash.py#L1344 does the regex match only against the file name itself.
I'm curious if others have run into this behavior/issue before.
Describe the solution you'd like
Simplest version is:
files_gen = (x for x in files if not ignore_filter.search("/".join([base, x]) if base else x)
This would obviously be a breaking change for those that prefix scan in their ignore patterns, so might just be me that needs to change. Maybe just a documentation fix that declares that these regex patterns are for the filename and not full path?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in dash/dash.py around line 1344, where the ignore regex is matched against asset filenames. Check the surrounding asset-discovery logic and existing tests or documentation to determine the current contract. Done means the requested full-path matching behavior, or an explicit filename-only contract, is covered by tests or documentation without leaving the breaking-change question ambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100