From 8285a6f53dc96b1adaefe46619a7764fe50c119b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 29 Oct 2019 18:47:09 -0400 Subject: [PATCH 1/3] eval eager_loading when ready --- dash/dash.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dash/dash.py b/dash/dash.py index ddb64bec80..2f2c98e4d4 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -229,12 +229,6 @@ def __init__( plugins=None, **obsolete ): - # Apply _force_eager_loading overrides from modules - for module_name in ComponentRegistry.registry: - module = sys.modules[module_name] - eager = getattr(module, '_force_eager_loading', False) - eager_loading = eager_loading or eager - for key in obsolete: if key in ["components_cache_max_age", "static_folder"]: raise exceptions.ObsoleteKwargException( @@ -272,6 +266,7 @@ def __init__( assets_external_path=get_combined_config( "assets_external_path", assets_external_path, "" ), + eager_loading=eager_loading, include_assets_files=get_combined_config( "include_assets_files", include_assets_files, True ), @@ -1434,6 +1429,16 @@ def _validate_layout(self): component_ids.add(component_id) def _setup_server(self): + # Apply _force_eager_loading overrides from modules + eager_loading = self.config.eager_loading + for module_name in ComponentRegistry.registry: + module = sys.modules[module_name] + eager = getattr(module, '_force_eager_loading', False) + eager_loading = eager_loading or eager + + # Update eager_loading settings + self.scripts.config.eager_loading = eager_loading + if self.config.include_assets_files: self._walk_assets_directory() From 21023c0fe0c48bc3096466276a227d851bbcd2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 29 Oct 2019 19:22:01 -0400 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c53116aa7c..3542271c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] +### Fixed +- [#986](https://github.com/plotly/dash/pull/986) Fix bug with evaluation of `_force_eager_loading` when application is loaded with gunicorn + ## [1.5.0] - 2019-10-29 ### Added - [#964](https://github.com/plotly/dash/pull/964) Adds support for preventing updates in clientside functions. From c0be9713b63c9bf6608d7d035c2dd49d032a531a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Tue, 29 Oct 2019 20:29:05 -0400 Subject: [PATCH 3/3] typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3542271c37..52e3a52573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Fixed -- [#986](https://github.com/plotly/dash/pull/986) Fix bug with evaluation of `_force_eager_loading` when application is loaded with gunicorn +- [#986](https://github.com/plotly/dash/pull/986) Fix a bug with evaluation of `_force_eager_loading` when application is loaded with gunicorn ## [1.5.0] - 2019-10-29 ### Added