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
merged 7 commits into from Feb 17, 2021
Merged

Conversation

Flix6x
Copy link
Contributor

@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 Feb 9, 2021
@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
@nhoening
Copy link
Contributor

@nhoening 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?

@Flix6x
Copy link
Contributor Author

@Flix6x 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.

@Flix6x
Copy link
Contributor Author

@Flix6x 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
2 checks passed
@Flix6x Flix6x deleted the issue-18-Retrieve_external_css_and_js_from_CDN branch Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants