We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Clientside PreventUpdate and no_update
It would be helpful for clientside callbacks to be able to conditionally update components. This is not supported right now (as far as I can tell). This should be pretty simple, my idea would be to define

```js
window.dash_clientside.no_update = {};
```

then in `updateClientsideOutput` just conditionally block updating by adding

```js
if(window.dash_clientside.no_update && outputValue === window.dash_clientside.no_update)
    return;
```

Similarly we could define `window.dash_clientside.PreventUpdate` and allow the use of
```js
throw window.dash_clientside.PreventUpdate;
``` 
If this seems reasonable I could put together a PR.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `dash/dependencies.py`
Content:
```
1 class DashDependency:
2     # pylint: disable=too-few-public-methods
3     def __init__(self, component_id, component_property):
4         self.component_id = component_id
5         self.component_property = component_property
6 
7     def __str__(self):
8         return '{}.{}'.format(
9             self.component_id,
10             self.component_property
11         )
12 
13     def __repr__(self):
14         return '<{} `{}`>'.format(self.__class__.__name__, self)
15 
16     def __eq__(self, other):
17         return isinstance(other, DashDependency) and str(self) == str(other)
18 
19     def __hash__(self):
20         return hash(str(self))
21 
22 
23 class Output(DashDependency):  # pylint: disable=too-few-public-methods
24     """Output of a callback."""
25 
26 
27 class Input(DashDependency):  # pylint: disable=too-few-public-methods
28     """Input of callback trigger an update when it is updated."""
29 
30 
31 class State(DashDependency):  # pylint: disable=too-few-public-methods
32     """Use the value of a state in a callback but don't trigger updates."""
33 
34 
35 class ClientsideFunction:
36     # pylint: disable=too-few-public-methods
37     def __init__(self, namespace=None, function_name=None):
38         self.namespace = namespace
39         self.function_name = function_name
40 
41     def __repr__(self):
42         return 'ClientsideFunction({}, {})'.format(
43             self.namespace,
44             self.function_name
45         )
46
```

Path: `dash/_utils.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3 import shlex
4 import sys
5 import uuid
6 import hashlib
7 import collections
8 import subprocess
9 import logging
10 from io import open  # pylint: disable=redefined-builtin
11 from functools import wraps
12 import future.utils as utils
13 
14 logger = logging.getLogger()
15 
16 
17 def interpolate_str(template, **data):
18     s = template
19     for k, v in data.items():
20         key = "{%" + k + "%}"
21         s = s.replace(key, v)
22     return s
23 
24 
25 def format_tag(tag_name, attributes, inner="", closed=False, opened=False):
26     tag = "<{tag} {attributes}"
27     if closed:
28         tag += "/>"
29     elif opened:
30         tag += ">"
31     else:
32         tag += ">" + inner + "</{tag}>"
33     return tag.format(
34         tag=tag_name,
35         attributes=" ".join(
36             ['{}="{}"'.format(k, v) for k, v in attributes.items()]
37         ),
38     )
39 
40 
41 def generate_hash():
42     return str(uuid.uuid4().hex).strip("-")
43 
44 
45 def get_asset_path(requests_pathname, asset_path, asset_url_path):
46 
47     return "/".join(
48         [
49             # Only take the first part of the pathname
50             requests_pathname.rstrip("/"),
51             asset_url_path,
52             asset_path,
53         ]
54     )
55 
56 
57 # pylint: disable=no-member
58 def patch_collections_abc(member):
59     return getattr(collections if utils.PY2 else collections.abc, member)
60 
61 
62 class AttributeDict(dict):
63     """Dictionary subclass enabling attribute lookup/assignment of keys/values.
64 
65     For example::
66         >>> m = AttributeDict({'foo': 'bar'})
67         >>> m.foo
68         'bar'
69         >>> m.foo = 'not bar'
70         >>> m['foo']
71         'not bar'
72     ``AttributeDict`` objects also provide ``.first()`` which acts like
73     ``.get()`` but accepts multiple keys as arguments, and returns the value of
74     the first hit, e.g.::
75         >>> m = AttributeDict({'foo': 'bar', 'biz': 'baz'})
76         >>> m.first('wrong', 'incorrect', 'foo', 'biz')
77         'bar'
78     """
79 
80     def __setattr__(self, key, value):
81         self[key] = value
82 
83     def __getattr__(self, key):
84         try:
85             return self[key]
86         except KeyError:
87             pass
88         # to conform with __getattr__ spec
89         # but get out of the except block so it doesn't look like a nested err
90         raise AttributeError(key)
91 
92     def set_read_only(self, names, msg="Attribute is read-only"):
93         object.__setattr__(self, "_read_only", names)
94         object.__setattr__(self, "_read_only_msg", msg)
95 
96     def finalize(self, msg="Object is final: No new keys may be added."):
97         """Prevent any new keys being set."""
98         object.__setattr__(self, "_final", msg)
99 
100     def __setitem__(self, key, val):
101         if key in self.__dict__.get("_read_only", []):
102             raise AttributeError(self._read_only_msg, key)
103 
104         final_msg = self.__dict__.get("_final")
105         if final_msg and key not in self:
106             raise AttributeError(final_msg, key)
107 
108         return super(AttributeDict, self).__setitem__(key, val)
109 
110     # pylint: disable=inconsistent-return-statements
111     def first(self, *names):
112         for name in names:
113             value = self.get(name)
114             if value:
115                 return value
116 
117 
118 def create_callback_id(output):
119     if isinstance(output, (list, tuple)):
120         return "..{}..".format(
121             "...".join(
122                 "{}.{}".format(x.component_id, x.component_property)
123                 for x in output
124             )
125         )
126 
127     return "{}.{}".format(output.component_id, output.component_property)
128 
129 
130 def run_command_with_process(cmd):
131     proc = subprocess.Popen(shlex.split(cmd, posix=sys.platform != "win32"))
132     proc.wait()
133     if proc.poll() is None:
134         logger.warning("🚨 trying to terminate subprocess in safe way")
135         try:
136             proc.communicate()
137         except Exception:  # pylint: disable=broad-except
138             logger.exception("🚨 first try communicate failed")
139             proc.kill()
140             proc.communicate()
141 
142 
143 def compute_md5(path):
144     with open(path, encoding="utf-8") as fp:
145         return hashlib.md5(fp.read().encode("utf-8")).hexdigest()
146 
147 
148 def job(msg=""):
149     def wrapper(func):
150         @wraps(func)
151         def _wrapper(*args, **kwargs):
152             logger.info("🏗️  [%s] 🏗️️  - %s", func.__name__, msg)
153             res = func(*args, **kwargs)
154             logger.info("::: 🍻🍻🍻 [%s] job done 🍻🍻🍻 :::", func.__name__)
155             return res
156 
157         return _wrapper
158 
159     return wrapper
160
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/dash/_utils.py b/dash/_utils.py
--- a/dash/_utils.py
+++ b/dash/_utils.py
@@ -128,7 +128,8 @@
 
 
 def run_command_with_process(cmd):
-    proc = subprocess.Popen(shlex.split(cmd, posix=sys.platform != "win32"))
+    is_win = sys.platform == "win32"
+    proc = subprocess.Popen(shlex.split(cmd, posix=is_win), shell=is_win)
     proc.wait()
     if proc.poll() is None:
         logger.warning("🚨 trying to terminate subprocess in safe way")
diff --git a/dash/dependencies.py b/dash/dependencies.py
--- a/dash/dependencies.py
+++ b/dash/dependencies.py
@@ -35,6 +35,11 @@
 class ClientsideFunction:
     # pylint: disable=too-few-public-methods
     def __init__(self, namespace=None, function_name=None):
+
+        if namespace in ['PreventUpdate', 'no_update']:
+            raise ValueError('"{}" is a forbidden namespace in'
+                             ' dash_clientside.'.format(namespace))
+
         self.namespace = namespace
         self.function_name = function_name

{"golden_diff": "diff --git a/dash/_utils.py b/dash/_utils.py\n--- a/dash/_utils.py\n+++ b/dash/_utils.py\n@@ -128,7 +128,8 @@\n \n \n def run_command_with_process(cmd):\n-    proc = subprocess.Popen(shlex.split(cmd, posix=sys.platform != \"win32\"))\n+    is_win = sys.platform == \"win32\"\n+    proc = subprocess.Popen(shlex.split(cmd, posix=is_win), shell=is_win)\n     proc.wait()\n     if proc.poll() is None:\n         logger.warning(\"\ud83d\udea8 trying to terminate subprocess in safe way\")\ndiff --git a/dash/dependencies.py b/dash/dependencies.py\n--- a/dash/dependencies.py\n+++ b/dash/dependencies.py\n@@ -35,6 +35,11 @@\n class ClientsideFunction:\n     # pylint: disable=too-few-public-methods\n     def __init__(self, namespace=None, function_name=None):\n+\n+        if namespace in ['PreventUpdate', 'no_update']:\n+            raise ValueError('\"{}\" is a forbidden namespace in'\n+                             ' dash_clientside.'.format(namespace))\n+\n         self.namespace = namespace\n         self.function_name = function_name\n", "issue": "Clientside PreventUpdate and no_update\nIt would be helpful for clientside callbacks to be able to conditionally update components. This is not supported right now (as far as I can tell). This should be pretty simple, my idea would be to define\r\n\r\n```js\r\nwindow.dash_clientside.no_update = {};\r\n```\r\n\r\nthen in `updateClientsideOutput` just conditionally block updating by adding\r\n\r\n```js\r\nif(window.dash_clientside.no_update && outputValue === window.dash_clientside.no_update)\r\n    return;\r\n```\r\n\r\nSimilarly we could define `window.dash_clientside.PreventUpdate` and allow the use of\r\n```js\r\nthrow window.dash_clientside.PreventUpdate;\r\n``` \r\nIf this seems reasonable I could put together a PR.\r\n\n", "before_files": [{"content": "class DashDependency:\n    # pylint: disable=too-few-public-methods\n    def __init__(self, component_id, component_property):\n        self.component_id = component_id\n        self.component_property = component_property\n\n    def __str__(self):\n        return '{}.{}'.format(\n            self.component_id,\n            self.component_property\n        )\n\n    def __repr__(self):\n        return '<{} `{}`>'.format(self.__class__.__name__, self)\n\n    def __eq__(self, other):\n        return isinstance(other, DashDependency) and str(self) == str(other)\n\n    def __hash__(self):\n        return hash(str(self))\n\n\nclass Output(DashDependency):  # pylint: disable=too-few-public-methods\n    \"\"\"Output of a callback.\"\"\"\n\n\nclass Input(DashDependency):  # pylint: disable=too-few-public-methods\n    \"\"\"Input of callback trigger an update when it is updated.\"\"\"\n\n\nclass State(DashDependency):  # pylint: disable=too-few-public-methods\n    \"\"\"Use the value of a state in a callback but don't trigger updates.\"\"\"\n\n\nclass ClientsideFunction:\n    # pylint: disable=too-few-public-methods\n    def __init__(self, namespace=None, function_name=None):\n        self.namespace = namespace\n        self.function_name = function_name\n\n    def __repr__(self):\n        return 'ClientsideFunction({}, {})'.format(\n            self.namespace,\n            self.function_name\n        )\n", "path": "dash/dependencies.py"}, {"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport shlex\nimport sys\nimport uuid\nimport hashlib\nimport collections\nimport subprocess\nimport logging\nfrom io import open  # pylint: disable=redefined-builtin\nfrom functools import wraps\nimport future.utils as utils\n\nlogger = logging.getLogger()\n\n\ndef interpolate_str(template, **data):\n    s = template\n    for k, v in data.items():\n        key = \"{%\" + k + \"%}\"\n        s = s.replace(key, v)\n    return s\n\n\ndef format_tag(tag_name, attributes, inner=\"\", closed=False, opened=False):\n    tag = \"<{tag} {attributes}\"\n    if closed:\n        tag += \"/>\"\n    elif opened:\n        tag += \">\"\n    else:\n        tag += \">\" + inner + \"</{tag}>\"\n    return tag.format(\n        tag=tag_name,\n        attributes=\" \".join(\n            ['{}=\"{}\"'.format(k, v) for k, v in attributes.items()]\n        ),\n    )\n\n\ndef generate_hash():\n    return str(uuid.uuid4().hex).strip(\"-\")\n\n\ndef get_asset_path(requests_pathname, asset_path, asset_url_path):\n\n    return \"/\".join(\n        [\n            # Only take the first part of the pathname\n            requests_pathname.rstrip(\"/\"),\n            asset_url_path,\n            asset_path,\n        ]\n    )\n\n\n# pylint: disable=no-member\ndef patch_collections_abc(member):\n    return getattr(collections if utils.PY2 else collections.abc, member)\n\n\nclass AttributeDict(dict):\n    \"\"\"Dictionary subclass enabling attribute lookup/assignment of keys/values.\n\n    For example::\n        >>> m = AttributeDict({'foo': 'bar'})\n        >>> m.foo\n        'bar'\n        >>> m.foo = 'not bar'\n        >>> m['foo']\n        'not bar'\n    ``AttributeDict`` objects also provide ``.first()`` which acts like\n    ``.get()`` but accepts multiple keys as arguments, and returns the value of\n    the first hit, e.g.::\n        >>> m = AttributeDict({'foo': 'bar', 'biz': 'baz'})\n        >>> m.first('wrong', 'incorrect', 'foo', 'biz')\n        'bar'\n    \"\"\"\n\n    def __setattr__(self, key, value):\n        self[key] = value\n\n    def __getattr__(self, key):\n        try:\n            return self[key]\n        except KeyError:\n            pass\n        # to conform with __getattr__ spec\n        # but get out of the except block so it doesn't look like a nested err\n        raise AttributeError(key)\n\n    def set_read_only(self, names, msg=\"Attribute is read-only\"):\n        object.__setattr__(self, \"_read_only\", names)\n        object.__setattr__(self, \"_read_only_msg\", msg)\n\n    def finalize(self, msg=\"Object is final: No new keys may be added.\"):\n        \"\"\"Prevent any new keys being set.\"\"\"\n        object.__setattr__(self, \"_final\", msg)\n\n    def __setitem__(self, key, val):\n        if key in self.__dict__.get(\"_read_only\", []):\n            raise AttributeError(self._read_only_msg, key)\n\n        final_msg = self.__dict__.get(\"_final\")\n        if final_msg and key not in self:\n            raise AttributeError(final_msg, key)\n\n        return super(AttributeDict, self).__setitem__(key, val)\n\n    # pylint: disable=inconsistent-return-statements\n    def first(self, *names):\n        for name in names:\n            value = self.get(name)\n            if value:\n                return value\n\n\ndef create_callback_id(output):\n    if isinstance(output, (list, tuple)):\n        return \"..{}..\".format(\n            \"...\".join(\n                \"{}.{}\".format(x.component_id, x.component_property)\n                for x in output\n            )\n        )\n\n    return \"{}.{}\".format(output.component_id, output.component_property)\n\n\ndef run_command_with_process(cmd):\n    proc = subprocess.Popen(shlex.split(cmd, posix=sys.platform != \"win32\"))\n    proc.wait()\n    if proc.poll() is None:\n        logger.warning(\"\ud83d\udea8 trying to terminate subprocess in safe way\")\n        try:\n            proc.communicate()\n        except Exception:  # pylint: disable=broad-except\n            logger.exception(\"\ud83d\udea8 first try communicate failed\")\n            proc.kill()\n            proc.communicate()\n\n\ndef compute_md5(path):\n    with open(path, encoding=\"utf-8\") as fp:\n        return hashlib.md5(fp.read().encode(\"utf-8\")).hexdigest()\n\n\ndef job(msg=\"\"):\n    def wrapper(func):\n        @wraps(func)\n        def _wrapper(*args, **kwargs):\n            logger.info(\"\ud83c\udfd7\ufe0f  [%s] \ud83c\udfd7\ufe0f\ufe0f  - %s\", func.__name__, msg)\n            res = func(*args, **kwargs)\n            logger.info(\"::: \ud83c\udf7b\ud83c\udf7b\ud83c\udf7b [%s] job done \ud83c\udf7b\ud83c\udf7b\ud83c\udf7b :::\", func.__name__)\n            return res\n\n        return _wrapper\n\n    return wrapper\n", "path": "dash/_utils.py"}], "after_files": [{"content": "class DashDependency:\n    # pylint: disable=too-few-public-methods\n    def __init__(self, component_id, component_property):\n        self.component_id = component_id\n        self.component_property = component_property\n\n    def __str__(self):\n        return '{}.{}'.format(\n            self.component_id,\n            self.component_property\n        )\n\n    def __repr__(self):\n        return '<{} `{}`>'.format(self.__class__.__name__, self)\n\n    def __eq__(self, other):\n        return isinstance(other, DashDependency) and str(self) == str(other)\n\n    def __hash__(self):\n        return hash(str(self))\n\n\nclass Output(DashDependency):  # pylint: disable=too-few-public-methods\n    \"\"\"Output of a callback.\"\"\"\n\n\nclass Input(DashDependency):  # pylint: disable=too-few-public-methods\n    \"\"\"Input of callback trigger an update when it is updated.\"\"\"\n\n\nclass State(DashDependency):  # pylint: disable=too-few-public-methods\n    \"\"\"Use the value of a state in a callback but don't trigger updates.\"\"\"\n\n\nclass ClientsideFunction:\n    # pylint: disable=too-few-public-methods\n    def __init__(self, namespace=None, function_name=None):\n\n        if namespace in ['PreventUpdate', 'no_update']:\n            raise ValueError('\"{}\" is a forbidden namespace in'\n                             ' dash_clientside.'.format(namespace))\n\n        self.namespace = namespace\n        self.function_name = function_name\n\n    def __repr__(self):\n        return 'ClientsideFunction({}, {})'.format(\n            self.namespace,\n            self.function_name\n        )\n", "path": "dash/dependencies.py"}, {"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\nimport shlex\nimport sys\nimport uuid\nimport hashlib\nimport collections\nimport subprocess\nimport logging\nfrom io import open  # pylint: disable=redefined-builtin\nfrom functools import wraps\nimport future.utils as utils\n\nlogger = logging.getLogger()\n\n\ndef interpolate_str(template, **data):\n    s = template\n    for k, v in data.items():\n        key = \"{%\" + k + \"%}\"\n        s = s.replace(key, v)\n    return s\n\n\ndef format_tag(tag_name, attributes, inner=\"\", closed=False, opened=False):\n    tag = \"<{tag} {attributes}\"\n    if closed:\n        tag += \"/>\"\n    elif opened:\n        tag += \">\"\n    else:\n        tag += \">\" + inner + \"</{tag}>\"\n    return tag.format(\n        tag=tag_name,\n        attributes=\" \".join(\n            ['{}=\"{}\"'.format(k, v) for k, v in attributes.items()]\n        ),\n    )\n\n\ndef generate_hash():\n    return str(uuid.uuid4().hex).strip(\"-\")\n\n\ndef get_asset_path(requests_pathname, asset_path, asset_url_path):\n\n    return \"/\".join(\n        [\n            # Only take the first part of the pathname\n            requests_pathname.rstrip(\"/\"),\n            asset_url_path,\n            asset_path,\n        ]\n    )\n\n\n# pylint: disable=no-member\ndef patch_collections_abc(member):\n    return getattr(collections if utils.PY2 else collections.abc, member)\n\n\nclass AttributeDict(dict):\n    \"\"\"Dictionary subclass enabling attribute lookup/assignment of keys/values.\n\n    For example::\n        >>> m = AttributeDict({'foo': 'bar'})\n        >>> m.foo\n        'bar'\n        >>> m.foo = 'not bar'\n        >>> m['foo']\n        'not bar'\n    ``AttributeDict`` objects also provide ``.first()`` which acts like\n    ``.get()`` but accepts multiple keys as arguments, and returns the value of\n    the first hit, e.g.::\n        >>> m = AttributeDict({'foo': 'bar', 'biz': 'baz'})\n        >>> m.first('wrong', 'incorrect', 'foo', 'biz')\n        'bar'\n    \"\"\"\n\n    def __setattr__(self, key, value):\n        self[key] = value\n\n    def __getattr__(self, key):\n        try:\n            return self[key]\n        except KeyError:\n            pass\n        # to conform with __getattr__ spec\n        # but get out of the except block so it doesn't look like a nested err\n        raise AttributeError(key)\n\n    def set_read_only(self, names, msg=\"Attribute is read-only\"):\n        object.__setattr__(self, \"_read_only\", names)\n        object.__setattr__(self, \"_read_only_msg\", msg)\n\n    def finalize(self, msg=\"Object is final: No new keys may be added.\"):\n        \"\"\"Prevent any new keys being set.\"\"\"\n        object.__setattr__(self, \"_final\", msg)\n\n    def __setitem__(self, key, val):\n        if key in self.__dict__.get(\"_read_only\", []):\n            raise AttributeError(self._read_only_msg, key)\n\n        final_msg = self.__dict__.get(\"_final\")\n        if final_msg and key not in self:\n            raise AttributeError(final_msg, key)\n\n        return super(AttributeDict, self).__setitem__(key, val)\n\n    # pylint: disable=inconsistent-return-statements\n    def first(self, *names):\n        for name in names:\n            value = self.get(name)\n            if value:\n                return value\n\n\ndef create_callback_id(output):\n    if isinstance(output, (list, tuple)):\n        return \"..{}..\".format(\n            \"...\".join(\n                \"{}.{}\".format(x.component_id, x.component_property)\n                for x in output\n            )\n        )\n\n    return \"{}.{}\".format(output.component_id, output.component_property)\n\n\ndef run_command_with_process(cmd):\n    is_win = sys.platform == \"win32\"\n    proc = subprocess.Popen(shlex.split(cmd, posix=is_win), shell=is_win)\n    proc.wait()\n    if proc.poll() is None:\n        logger.warning(\"\ud83d\udea8 trying to terminate subprocess in safe way\")\n        try:\n            proc.communicate()\n        except Exception:  # pylint: disable=broad-except\n            logger.exception(\"\ud83d\udea8 first try communicate failed\")\n            proc.kill()\n            proc.communicate()\n\n\ndef compute_md5(path):\n    with open(path, encoding=\"utf-8\") as fp:\n        return hashlib.md5(fp.read().encode(\"utf-8\")).hexdigest()\n\n\ndef job(msg=\"\"):\n    def wrapper(func):\n        @wraps(func)\n        def _wrapper(*args, **kwargs):\n            logger.info(\"\ud83c\udfd7\ufe0f  [%s] \ud83c\udfd7\ufe0f\ufe0f  - %s\", func.__name__, msg)\n            res = func(*args, **kwargs)\n            logger.info(\"::: \ud83c\udf7b\ud83c\udf7b\ud83c\udf7b [%s] job done \ud83c\udf7b\ud83c\udf7b\ud83c\udf7b :::\", func.__name__)\n            return res\n\n        return _wrapper\n\n    return wrapper\n", "path": "dash/_utils.py"}]}