Skip to content

proposal. Set serve_locally = True by default #284

Closed

Description

@bpostlethwaite

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?

Activity

  1. valentijnnieman commented on Jul 10, 2018

    @valentijnnieman
    Contributor

    I don't see why not! 👍

  2. nicolaskruchten commented on Jul 10, 2018

    @nicolaskruchten
    Contributor

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

  3. chriddyp commented on Jul 10, 2018

    @chriddyp
    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) unpkg/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.
  4. nicolaskruchten commented on Jul 10, 2018

    @nicolaskruchten
    Contributor

    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

  5. T4rk1n commented on Jul 10, 2018

    @T4rk1n
    Contributor

    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.

  6. ned2 commented on Jul 11, 2018

    @ned2
    Contributor
  7. added a commit that references this issue on Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions