Skip to content

Commit bda5823

Browse files
committed
Merge branch 'dev' into single_input
2 parents 06039d7 + 94144a5 commit bda5823

15 files changed

+748
-35
lines changed

Diff for: CHANGELOG.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

55
## [UNRELEASED]
6-
### Added
7-
- [#1315](https://github.com/plotly/dash/pull/1315) Add `update_title` parameter to set or disable the "Updating...." document title during updates. Closes [#856](https://github.com/plotly/dash/issues/856) and [#732](https://github.com/plotly/dash/issues/732)
8-
96
### Changed
107
- [#1180](https://github.com/plotly/dash/pull/1180) `Input`, `Output`, and `State` in callback definitions don't need to be in lists. You still need to provide `Output` items first, then `Input` items, then `State`, and the list form is still supported. In particular, if you want to return a single output item wrapped in a length-1 list, you should still wrap the `Output` in a list. This can be useful for procedurally-generated callbacks.
118

9+
## [1.14.0] - 2020-07-27
10+
### Added
11+
- [#1343](https://github.com/plotly/dash/pull/1343) Add `title` parameter to set the
12+
document title. This is the recommended alternative to setting app.title or overriding
13+
the index HTML.
14+
- [#1315](https://github.com/plotly/dash/pull/1315) Add `update_title` parameter to set or disable the "Updating...." document title during updates. Closes [#856](https://github.com/plotly/dash/issues/856) and [#732](https://github.com/plotly/dash/issues/732)
15+
1216
## [1.13.4] - 2020-06-25
1317
### Fixed
1418
- [#1310](https://github.com/plotly/dash/pull/1310) Fix a regression since 1.13.0 preventing more than one loading state from being shown at a time.

Diff for: dash-renderer/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dash-renderer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-renderer",
3-
"version": "1.5.1",
3+
"version": "1.6.0",
44
"description": "render dash components in react",
55
"main": "dash_renderer/dash_renderer.min.js",
66
"scripts": {

Diff for: dash-renderer/src/components/core/DocumentTitle.react.js

+15-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,27 @@ class DocumentTitle extends Component {
77
super(props);
88
const {update_title} = props.config;
99
this.state = {
10-
initialTitle: document.title,
10+
title: document.title,
1111
update_title,
1212
};
1313
}
1414

1515
UNSAFE_componentWillReceiveProps(props) {
16-
if (this.state.update_title && props.isLoading) {
17-
document.title = this.state.update_title;
16+
if (!this.state.update_title) {
17+
// Let callbacks or other components have full control over title
18+
return;
19+
}
20+
if (props.isLoading) {
21+
this.setState({title: document.title});
22+
if (this.state.update_title) {
23+
document.title = this.state.update_title;
24+
}
1825
} else {
19-
document.title = this.state.initialTitle;
26+
if (document.title === this.state.update_title) {
27+
document.title = this.state.title;
28+
} else {
29+
this.setState({title: document.title});
30+
}
2031
}
2132
}
2233

Diff for: dash/dash.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ class Dash(object):
228228
with a ``plug`` method, taking a single argument: this app, which will
229229
be called after the Flask server is attached.
230230
:type plugins: list of objects
231+
232+
:param title: Default ``Dash``. Configures the document.title
233+
(the text that appears in a browser tab).
234+
235+
:param update_title: Default ``Updating...``. Configures the document.title
236+
(the text that appears in a browser tab) text when a callback is being run.
237+
Set to None or '' if you don't want the document.title to change or if you
238+
want to control the document.title through a separate component or
239+
clientside callback.
231240
"""
232241

233242
def __init__(
@@ -253,6 +262,7 @@ def __init__(
253262
prevent_initial_callbacks=False,
254263
show_undo_redo=False,
255264
plugins=None,
265+
title="Dash",
256266
update_title="Updating...",
257267
**obsolete
258268
):
@@ -301,6 +311,7 @@ def __init__(
301311
),
302312
prevent_initial_callbacks=prevent_initial_callbacks,
303313
show_undo_redo=show_undo_redo,
314+
title=title,
304315
update_title=update_title,
305316
)
306317
self.config.set_read_only(
@@ -322,6 +333,9 @@ def __init__(
322333
"via the Dash constructor"
323334
)
324335

336+
# keep title as a class property for backwards compatability
337+
self.title = title
338+
325339
# list of dependencies - this one is used by the back end for dispatching
326340
self.callback_map = {}
327341
# same deps as a list to catch duplicate outputs, and to send to the front end
@@ -726,7 +740,9 @@ def index(self, *args, **kwargs): # pylint: disable=unused-argument
726740
config = self._generate_config_html()
727741
metas = self._generate_meta_html()
728742
renderer = self._generate_renderer()
729-
title = getattr(self, "title", "Dash")
743+
744+
# use self.title instead of app.config.title for backwards compatibility
745+
title = self.title
730746

731747
if self._favicon:
732748
favicon_mod_time = os.path.getmtime(

Diff for: dash/development/_all_keywords.py

+35
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,38 @@
6868
"NA_character_",
6969
"...",
7070
}
71+
72+
# This is a set of Julia reserved words that cannot be used as function
73+
# argument names.
74+
75+
julia_keywords = {
76+
"baremodule",
77+
"begin",
78+
"break",
79+
"catch",
80+
"const",
81+
"continue",
82+
"do",
83+
"else",
84+
"elseif",
85+
"end",
86+
"export",
87+
"false",
88+
"finally",
89+
"for",
90+
"function",
91+
"global",
92+
"if",
93+
"import",
94+
"let",
95+
"local",
96+
"macro",
97+
"module",
98+
"quote",
99+
"return",
100+
"struct",
101+
"true",
102+
"try",
103+
"using",
104+
"while",
105+
}

0 commit comments

Comments
 (0)