-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ddk eager flag fix #985
Ddk eager flag fix #985
Conversation
# Conflicts: # dash-renderer/package-lock.json
# Conflicts: # dash-renderer/package-lock.json
dash/dash.py
Outdated
|
||
# static files from the packages | ||
self.css = Css(self.css.config.serve_locally) | ||
self.scripts = Scripts(self.scripts.config.serve_locally, eager_loading) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to recreate these here? Wouldn't it be sufficient to just say
self.scripts.config.eager_loading = eager_loading
or even
for module_name in ComponentRegistry.registry:
module = sys.modules[module_name]
if getattr(module, '_force_eager_loading', False):
self.scripts.config.eager_loading = True
break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I think you're right. I think I misunderstood how/when this got evaluated. But the filter only gets called later.
dash/dash.py
Outdated
if self.config.include_assets_files: | ||
self._walk_assets_directory() | ||
|
||
self._validate_layout() | ||
|
||
self._generate_scripts_html() | ||
self._generate_css_dist_html() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we need these for their side-effects, or perhaps recreating self.scripts
and self.css
was the problem? Regardless, I don't see any harm bringing this back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Undoing this.
@alexcjohnson Closing this in favor of #986 as the baseline was |
Fixes #984 - delays (reevaluates) Css and Scripts at the moment when the server is ready instead of doing so during initialization.
This should allow us to handle both (1) app.run_server and (2) gunicorn / multi-page apps correctly.