Skip to content

Commit 64a1c25

Browse files
authored
Merge pull request #2507 from plotly/master-2.9.3
Master 2.9.3
2 parents f3d4ffe + ede8102 commit 64a1c25

22 files changed

+107
-34
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## [2.9.3] - 2023-04-13
6+
7+
## Fixed
8+
9+
- [#2489](https://github.com/plotly/dash/pull/2489) Fix location change event handling when `Location` objects are removed from the layout. Event handlers would not be removed and eventually change props of a random DOM element, fix [#1346](https://github.com/plotly/dash/issues/1346)
10+
- [#2498](https://github.com/plotly/dash/pull/2498) Fix error when caching callbacks which return `Patch` objects by making `Patch` objects picklable
11+
- [#2491](https://github.com/plotly/dash/pull/2491) Fix clientside inline function name not found, fix [#2488](https://github.com/plotly/dash/issues/2488)
12+
513
## [2.9.2] - 2023-03-29
614

715
## Fixed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 Plotly, Inc
3+
Copyright (c) 2023 Plotly, Inc
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

components/dash-core-components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/dash-core-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-core-components",
3-
"version": "2.9.1",
3+
"version": "2.9.2",
44
"description": "Core component suite for Dash",
55
"repository": {
66
"type": "git",

components/dash-core-components/src/components/Location.react.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ export default class Location extends Component {
121121
this.updateLocation(this.props);
122122
}
123123

124+
componentWillUnmount() {
125+
window.onpopstate = () => {};
126+
window.removeEventListener(
127+
'_dashprivate_pushstate',
128+
this.onLocationChange
129+
);
130+
}
131+
124132
UNSAFE_componentWillReceiveProps(nextProps) {
125133
this.updateLocation(nextProps);
126134
}

components/dash-html-components/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/dash-html-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-html-components",
3-
"version": "2.0.10",
3+
"version": "2.0.11",
44
"description": "Vanilla HTML components for Dash",
55
"main": "lib/index.js",
66
"repository": {

components/dash-html-components/scripts/data/attributes.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@
331331
"hrefLang": {
332332
"elements": [
333333
"a",
334-
"area",
335334
"link"
336335
],
337336
"description": "Specifies the language of the linked resource."
@@ -850,7 +849,6 @@
850849
"coords",
851850
"download",
852851
"href",
853-
"hrefLang",
854852
"media",
855853
"referrerPolicy",
856854
"rel",

dash/_callback.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import collections
2-
import uuid
2+
import hashlib
33
from functools import wraps
44

55
import flask
@@ -534,8 +534,8 @@ def register_clientside_callback(
534534
# name, then inject the code.
535535
if isinstance(clientside_function, str):
536536
namespace = "_dashprivate_clientside_funcs"
537-
# Just make sure every function has a different name if not provided.
538-
function_name = uuid.uuid4().hex
537+
# Create a hash from the function, it will be the same always
538+
function_name = hashlib.md5(clientside_function.encode("utf-8")).hexdigest()
539539

540540
inline_scripts.append(
541541
_inline_clientside_template.format(

dash/_patch.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ def __init__(self, location=None, parent=None):
3030
else:
3131
self._operations = []
3232

33+
def __getstate__(self):
34+
return vars(self)
35+
36+
def __setstate__(self, state):
37+
vars(self).update(state)
38+
3339
def __getitem__(self, item):
3440
validate_slice(item)
3541
return Patch(location=self._location + [item], parent=self)

0 commit comments

Comments
 (0)