Repository navigation
Self-host Material Design Lite and list.js instead of loading them from cdnjs - #133
Merged
Merged
Conversation
Serve MDL 1.3.0's material.indigo-blue.min.css and material.min.js (with its source map and Apache 2.0 license) from server/static/vendor, so the pages no longer depend on a CDN for a library that's no longer maintained. The files are the npm release's dist files, identical to the cdnjs copies the pages loaded before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage for e2e tests for Python 3.14
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
=======================================
Coverage 66.34% 66.34%
=======================================
Files 29 29
Lines 2383 2383
=======================================
Hits 1581 1581
Misses 802 802 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🚀 Staging Preview Deployed! URL: https://preview-seating-pr-133-137456085712.us-west1.run.app |
The students page's search and column sorting use List.js 1.5.0, loaded from cdnjs. Serve it from server/static/vendor with its MIT license; the file is the npm release's dist file, identical to the cdnjs copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
PR preview looks good and search works still. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #84: Material Design Lite is no longer maintained, and Google's own CDN for it now returns 403. The pages load it from cdnjs instead, which works but leaves them depending on a third-party copy of an unmaintained library. This hosts it in the repo, along with list.js, the other library the pages loaded from cdnjs. It doesn't replace MDL, which #84 still tracks (Bootstrap 5 is the likely long-term option).
Changes
server/static/vendor/material-design-lite/: MDL 1.3.0'smaterial.indigo-blue.min.cssandmaterial.min.js, plus the script's source map and MDL's Apache 2.0LICENSE.dist/files of the official npm packagematerial-design-lite@1.3.0. They're byte-for-byte identical to the cdnjs files the pages loaded before (SHA-25638a6c7d1…for the CSS,3c27eee3…for the JS), so nothing changes visually.data:URLs.material.min.jsends with asourceMappingURLcomment, so it's included to keep browser dev tools from requesting a file that 404s.server/static/vendor/list.js/: List.js 1.5.0'slist.min.jsand its MITLICENSE. It runs the students page's search box and column sorting.dist/list.min.jsof the npm packagelist.js@1.5.0, identical to the cdnjs copy (SHA-25662a388a7…). The version is unchanged; the latest is 2.3.1.url_for('static', …)instead of from cdnjs.base.html.j2andseat.html.j2: MDL. These are the only two templates that load it.students.html.j2: list.js.No template loads anything from cdnjs anymore.
Not in this PR
Google Fonts (Roboto and Material Icons) are still loaded from Google, in
base.html.j2andseat.html.j2.Testing
/static/vendor/material-design-lite/with HTTP 200, MDL's JavaScript initializes (componentHandleris defined and the page's MDL components are set up), and the MDL layout styles apply./static/vendor/list.js/with HTTP 200, searching "Jimmy" narrows the three seeded students to one, and clicking the Name header twice sorts the table ascending and then descending.🤖 Generated with Claude Code