-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for config-aware relative paths #1070
Conversation
# Conflicts: # dash-renderer/package-lock.json
# Conflicts: # dash-renderer/package-lock.json
# Conflicts: # dash-renderer/package-lock.json
- update build artifacts
Getting an odd testing error locally:
|
("/my-dash-app", "/page-1/sub-page-1", "/my-dash-app/page-1/sub-page-1"), | ||
|
||
("/", "relative-page-1", "relative-page-1"), | ||
("/my-dash-app", "/my-dash-apprelative-page-1", "/my-dash-apprelative-page-1"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These relative URLs are ambiguous in this scenario as we don't know what page we're on.
For example, if we were on page /my-dash-app/this-page
and then provided a relative-page-1
, the resolved URL should be /my-dash-app/this-page/relative-page-1
but we can't provide that to the front end because we are unaware of this-page
.
So, I thought we'd just keep it a simple prefix without any additional logic.
Relative URLs aren't documented in Dash nor used very much anyway.
@@ -1565,6 +1566,33 @@ def get_asset_url(self, path): | |||
|
|||
return asset | |||
|
|||
def get_relative_path(self, path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming options:
get_relative_path
get_relative_url
get_rel_path
get_rel_url
relative_path
relative_url
rel_path
rel_url
relpath
relurl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It is technically a
path
and not a full URL although folks might think that "path" is corresponding to the file system path. - We use
get_
in other places likeget_asset_url
. Do we keep it for consistency? I'd prefer to moveget_asset_url
usage over to this function, so folks just need to learn e.g.app.relpath('/assets/logo.png')
andapp.relpath('/page-2')
This reverts commit be001c8.
* ✨ async/dynamic support in R pkg deps * 🔪 remove Authors block * 🔪 insert package version number * 🔨 use verbose 📦 title and desc from YAML * ✨ autodetect vignettes * check for author/maintainer address * ✋ halt processing if fatal errors found * autopopulate KeepSource * auto-escape % in docstrings * 🔪 filter examples from docstrings in R
e2447fe
to
2a1624d
Compare
ugh I rebased off of master instead of |
Fixes https://github.com/plotly/dash-core/issues/78