|
2 | 2 | All notable changes to `dash` will be documented in this file. |
3 | 3 | This project adheres to [Semantic Versioning](http://semver.org/). |
4 | 4 |
|
| 5 | +## [1.8.0] - 2020-01-14 |
| 6 | +### Added |
| 7 | +- [#1073](https://github.com/plotly/dash/pull/1073) Two new functions to simplify usage handling URLs and pathnames: `app.get_relative_path` & `app.trim_relative_path`. |
| 8 | +These functions are particularly useful for apps deployed on Dash Enterprise where the apps served under a URL prefix (the app name) which is unlike apps served on localhost:8050. |
| 9 | + - `app.get_relative_path` returns a path with the config setting `requests_pathname_prefix` prefixed. Use `app.get_relative_path` anywhere you would provide a relative pathname, like `dcc.Link(href=app.relative_path('/page-2'))` or even as an alternative to `app.get_asset_url` with e.g. `html.Img(src=app.get_relative_path('/assets/logo.png'))`. |
| 10 | + - `app.trim_relative_path` a path with `requests_pathname_prefix` and leading & trailing |
| 11 | + slashes stripped from it. Use this function in callbacks that deal with `dcc.Location` `pathname` |
| 12 | + routing. |
| 13 | + Example usage: |
| 14 | + ```python |
| 15 | + app.layout = html.Div([ |
| 16 | + dcc.Location(id='url'), |
| 17 | + html.Div(id='content') |
| 18 | + ]) |
| 19 | + @app.callback(Output('content', 'children'), [Input('url', 'pathname')]) |
| 20 | + def display_content(path): |
| 21 | + page_name = app.strip_relative_path(path) |
| 22 | + if not page_name: # None or '' |
| 23 | + return html.Div([ |
| 24 | + html.Img(src=app.get_relative_path('/assets/logo.png')), |
| 25 | + dcc.Link(href=app.get_relative_path('/page-1')), |
| 26 | + dcc.Link(href=app.get_relative_path('/page-2')), |
| 27 | + ]) |
| 28 | + elif page_name == 'page-1': |
| 29 | + return chapters.page_1 |
| 30 | + if page_name == "page-2": |
| 31 | + return chapters.page_2 |
| 32 | + ``` |
| 33 | + |
| 34 | +### Changed |
| 35 | +- [#1035](https://github.com/plotly/dash/pull/1035) Simplify our build process. |
| 36 | +- [#1074](https://github.com/plotly/dash/pull/1045) Error messages when providing an incorrect property to a component have been improved: they now specify the component type, library, version, and ID (if available). |
| 37 | + |
| 38 | +### Fixed |
| 39 | +- [#1037](https://github.com/plotly/dash/pull/1037) Fix no_update test to allow copies, such as those stored and retrieved from a cache. |
| 40 | + |
5 | 41 | ## [1.7.0] - 2019-11-27 |
6 | 42 | ### Added |
7 | 43 | - [#967](https://github.com/plotly/dash/pull/967) Add support for defining |
|
0 commit comments