plotly/dash

proposal. Set serve_locally = True by default

bpostlethwaite opened this issue ยท 6 comments

This trips up everyone who is playing around with Dash. It trips me up every time I work with Dash.

It could also be turned on be default when debug=True.

@plotly/dash (and community) what do you think?

I don't see why not! ๐Ÿ‘

Yes, yes, yes! The slight performance boost from the CDN is probably not worth the headache and perception of requiring outbound connections.

I think I'm ๐Ÿ‘ with this as well.

A few notes for discussion:

  • Some users have had issues with serve_locally: #56
  • The unpkg cdn hasn't always been reliable. There's been 3 times in the last year where it hasn't served things correctly: #114, mjackson/unpkg#54
  • Would switching this break anyone's code? There is some weird logic where if serve_locally = True then any scripts or stylesheets appended with an external_url won't work (the original idea being that there would be two versions of each resource supplied, one local and one external, and you could swap between the two. That's how the component library's stylsheets and scripts are included. However, in practice, we end up just doing app.scripts.append_script({'external_url': ...})). So, we would have to remove that logic in a way that doesn't end up including the component's resources twice. All of that stuff should be reworked anyway.

IIRC there was some issue with serving up your own CSS as well as serving locally, or something like that. Worth making sure that #265 is compatible with serve_locally=True without any downsides

I think it should be set to True if debug = True, what I have for the static files is compatible with the serve_locally option.

ned2 commented