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

Load css and js from CDN #21

merged 7 commits into from Feb 17, 2021


Copy link

@Flix6x Flix6x commented Feb 9, 2021

What I did:

  • Load external js from CDN.
  • Load most external css from CDN. There's just one I customized to not conflict with the rest of our app (rq-dashboard-bootstrap.min.css), another I can't find hosted on a CDN (weather-icons.min.css), and finally one that I moved out of the external css folder, because it just contains a customisable skin configuration for our range slider (ion.rangeSlider.skinCustom.css).

I read that, if CDN-based scripts were not loaded from CDN for whatever reason, you should fallback to a local copy. Is that functionality you would like to have?

Load most external css from cdn.
@Flix6x Flix6x requested a review from nhoening February 9, 2021 15:47
@Flix6x Flix6x self-assigned this Feb 9, 2021
@Flix6x Flix6x linked an issue Feb 9, 2021 that may be closed by this pull request
@Flix6x Flix6x added the UI label Feb 9, 2021
Copy link

nhoening commented Feb 9, 2021

I haven't thought about the fallback yet. I guess the recommendation is easier for closed-source projects, as they don't have to consider licensing :D

So there are three resources which we'll definitely keep in the source, so we'll mention them in NOTICES?

Copy link
Contributor Author

Flix6x commented Feb 10, 2021

As you pointed out earlier, these js and css files usually have very permissive licences. I don't think it matters from where they are served, from a copyright perspective.

I made sure that all our css and js dependencies have permissive licences: all MIT, except Bokeh (BSD-3), Leaflet and rq-dashboard (both BSD-2). I could include a full list in the NOTICES file, if you'd like.

Copy link
Contributor Author

Flix6x commented Feb 17, 2021

I upgraded external css and js, and by doing so I was also able to remove one more css file: an ion.rangeslider skin that is now supported out of the box. We only use it on the control page (currently hidden), but it looks quite nice.

The daterangepicker also looks nicer now, with users being nudged to use one of the default date ranges rather than set a custom date range.

Otherwise, no noticeable changes as far as I can tell.

@Flix6x Flix6x merged commit 10017e0 into main Feb 17, 2021
@Flix6x Flix6x deleted the issue-18-Retrieve_external_css_and_js_from_CDN branch February 17, 2021 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

Retrieve external css and js from CDN
2 participants