File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
tests/integration/clientside Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ This project adheres to [Semantic Versioning](https://semver.org/).
14
14
- `custom_spinner` enables using a custom component for loading messages instead of built-in spinners
15
15
- `display` overrides the loading status with options for "show," "hide," or "auto"
16
16
17
+ ## Fixed
18
+
19
+ - [#2362](https://github.com/plotly/dash/pull/2362) Global namespace not polluted any more when loading clientside callbacks.
20
+
17
21
## [2.16.1] - 2024-03-06
18
22
19
23
## Fixed
Original file line number Diff line number Diff line change @@ -502,9 +502,11 @@ def add_context(*args, **kwargs):
502
502
503
503
504
504
_inline_clientside_template = """
505
- var clientside = window.dash_clientside = window.dash_clientside || {{}};
506
- var ns = clientside["{namespace}"] = clientside["{namespace}"] || {{}};
507
- ns["{function_name}"] = {clientside_function};
505
+ (function() {{
506
+ var clientside = window.dash_clientside = window.dash_clientside || {{}};
507
+ var ns = clientside["{namespace}"] = clientside["{namespace}"] || {{}};
508
+ ns["{function_name}"] = {clientside_function};
509
+ }})();
508
510
"""
509
511
510
512
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ def update_output(value):
35
35
dash_duo .wait_for_text_to_equal ("#output-serverside" , 'Server says "hello world"' )
36
36
dash_duo .wait_for_text_to_equal ("#output-clientside" , 'Client says "hello world"' )
37
37
38
+ assert dash_duo .driver .execute_script ("return 'dash_clientside' in window" )
39
+ assert dash_duo .driver .execute_script ("return !('clientside' in window)" )
40
+ assert dash_duo .driver .execute_script ("return !('ns' in window)" )
41
+
38
42
39
43
def test_clsd002_chained_serverside_clientside_callbacks (dash_duo ):
40
44
app = Dash (__name__ , assets_folder = "assets" )
You can’t perform that action at this time.
0 commit comments