You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks great! I think we should actually turn this feature on when a user is in a global "dev" mode, where they would also turn on the Dash Dev Tools features. I think an argument to dash.Dash is the most intuitive way to turn such a thing on.
I don't have a method in Dev Tools just yet. Maybe we should change serve_dash_bundles to something more general like use_dev_tools, then I can piggy back off this flag in the Dev Tools PR and turn those on when it is true.
@rmarren1 So you want to combine the flag to serve the dev bundle and activate the devtools ? It make sense because the stacktraces will be much better with dev bundles.
I think we should call the keyword argument enable_dev_tools or just dev_tools.
Yeah either of those sound good. Yeah the stack traces are generally unreadable for the production bundles, so Dev tools should definitely depend on them
I think an argument to dash.Dash is the most intuitive way to turn such a thing on.
One issue with this is that users will accidentally deploy with dev_tools turned on. I'd also like for this to become the default behaviour for dash. So, I think we should introduce a second set of config parameters in the run_server call that turn on all dev_tools-like things. Users shouldn't be doing run_server in production as they should be running it with gunicorn. We could even move towards renaming run_server to like run_dev_server or something.
For some more context, see the debug, dev, production section in this issue: #312
For the same reason @chriddyp mentionned, I don't really like the argument in the constructor for this (and hot-reload). I think these arguments could very well be in run_server since that the most likely place it gonna be used and have them default to true.
I like the approach of pushing dev mode activation away from Dash's constructor. I also think it's important that we don't bake dev-mode specific setup logic into run_server because users should still be able to conveniently run in dev mode using a WSGI server like gunicorn etc. This enables development/debugging in an environment that is closer to production for those people not using the built-in development server.
What about having a separate Dash method like activate_dev_mode or something that does all the relevant setup (I guess currently just setting _serve_dev_bundle to True, but I can imagine the setup might grow over time) and which run_server can call? Then this could be manually invoked for those wanting dev mode on gunicorn etc?
If we wanted to do that, this could be a separate PR though.
I changed the naming of the dev tools variables, please review.
Also I used _config.get_config in lieu of with_defaults, this allow for setting the dev tools variables from environ, can use them to have different run configs without changing the code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for serving unminified component bundles. Resolves#313.
Enable with:
The components libs needs a new key in the their
_js_dist:dev_package_path.