Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add component packages dist to hot reload watch. #603

Merged
merged 3 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- Fix missing component prop docstring error [#598](https://github.com/plotly/dash/issues/598)
- Moved `__repr__` to base component instead of being generated. [#492](https://github.com/plotly/dash/pull/492)

## Added
- Added components libraries js/css distribution to hot reload watch. [#603](https://github.com/plotly/dash/pull/603)

## [0.37.0] - 2019-02-11
## Fixed
- Fixed collections.abc deprecation warning for python 3.8 [#563](https://github.com/plotly/dash/pull/563)
Expand Down
15 changes: 13 additions & 2 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from .dependencies import Input, Output, State
from .resources import Scripts, Css
from .development.base_component import Component
from .development.base_component import Component, ComponentRegistry
from . import exceptions
from ._utils import AttributeDict as _AttributeDict
from ._utils import interpolate_str as _interpolate
Expand Down Expand Up @@ -1155,9 +1155,20 @@ def enable_dev_tools(self,

if self._dev_tools.hot_reload:
self._reload_hash = _generate_hash()

component_packages_dist = [
os.path.dirname(package.path)
if hasattr(package, 'path')
else package.filename
for package in (
pkgutil.find_loader(x) for x in
list(ComponentRegistry.registry) + ['dash_renderer']
)
]

self._watch_thread = threading.Thread(
target=lambda: _watch.watch(
[self._assets_folder],
[self._assets_folder] + component_packages_dist,
self._on_assets_change,
sleep_time=self._dev_tools.hot_reload_watch_interval)
)
Expand Down