Skip to content
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

proposal. Set serve_locally = True by default #284

Closed
bpostlethwaite opened this issue Jul 10, 2018 · 6 comments · Fixed by #722
Closed

proposal. Set serve_locally = True by default #284

bpostlethwaite opened this issue Jul 10, 2018 · 6 comments · Fixed by #722

Comments

@bpostlethwaite
Copy link
Member

bpostlethwaite commented Jul 10, 2018

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?

@valentijnnieman
Copy link
Contributor

I don't see why not! 👍

@nicolaskruchten
Copy link
Member

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

@chriddyp
Copy link
Member

I think I'm 👍 with this as well.

A few notes for discussion:

  • Some users have had issues with serve_locally: Serving large files locally (JS bundles) on windows machines in flask sometimes doesn't work #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: Error loading react-dom@15.4.2 #114, Missed react-dom.min.js (react-dom@15.6.1) 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.

@nicolaskruchten
Copy link
Member

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

@T4rk1n
Copy link
Contributor

T4rk1n commented Jul 10, 2018

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
Copy link
Contributor

ned2 commented Jul 11, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants