Upgrading libraries - ProjectSidewalk/SidewalkWebpage GitHub Wiki
We periodically check for updates to the various libraries that we use to power Project Sidewalk. Below we list the libraries that we're using, along with how to check for and download updates to those libraries. This is a work in progress, as we try to make the process of keeping libraries up-to-date more streamlined and consistent.
When updating, please update the version numbers that we're using below. This makes it easier to know whether a library has a new update available when scanning through the list next time.
Scala
After making any changes, you'll want to rerun npm start
to trigger the new versions to download.
- Scala: 2.13.16
- Note: For now, we're using Scala 2.13. There is an open ticket for upgrading to Scala 3, as that's a major lift and we're not sure if all the libraries we use support it yet.
- Releases: https://www.scala-lang.org/download/all.html
- How to update: edit the
scalaVersion
line in the build.sbt
- sbt: 1.11.6
- Note: You may need to update the Play Framework at the same time as sbt for major updates.
- Releases: https://github.com/sbt/sbt/releases
- How to update: Set the version in project/build.properties. The new version will be downloaded and used automatically when you next run
npm start
- Play Framework: 3.0.9
- Check if there's a new release: https://github.com/playframework/playframework/releases
- How to update
- Change the version number in plugins.sbt
- Change the version number in build.sbt for the plugins provided by play that have the same versioning scheme
- play-mailer/play-mailer-guice: 10.1.0
- Releases: https://mvnrepository.com/artifact/org.playframework/play-mailer
- Knowing which version to use: https://github.com/playframework/play-mailer?tab=readme-ov-file#versioning
- play-json: 3.0.5
- play-silhouette (and associated plugins): 10.0.3
- scala-guice: 6.0.0
- Note: Versions 6.0.0 and 7.0.0 are identical, except that the javax namespace is changed to jakarta. It seems as though Play has not made this transition themselves yet (as of Play 3.0.8). So even if we change the namespace in all of our code, we end up with errors from core Play functionality. So we need to stick with version 6 until Play makes this change. So it's worth keeping an eye on the Play Framework changelog to see if this is updated in the future.
- Releases: https://mvnrepository.com/artifact/net.codingwell/scala-guice
- Changelog: https://github.com/codingwell/scala-guice/blob/develop/CHANGELOG.md
- ficus: 1.5.2
- postgresql (the driver in build.sbt): 42.7.7
- Releases: https://mvnrepository.com/artifact/org.postgresql/postgresql
- Changelog: https://jdbc.postgresql.org/
- play-slick/play-slick-evolutions: 6.2.0
- Releases: https://mvnrepository.com/artifact/org.playframework/play-slick
- Knowing which version to use: https://github.com/playframework/play-slick?tab=readme-ov-file#all-releases
- slick-pg (and associated plugins): 0.23.1
- jts: 1.20.0
- jackson-datatype-jts: 1.2.10
- TODO We need to get more clarity on this library. I think that I struggled to find a version that was compatible with the versions of slick-pg and jts that we're using. There are much newer versions available, but they may not have worked for some reason? The releases link below doesn't show all available versions. You can see other repos that offer the library here, and some offer many newer versions. For now, we can just do any minor upgrades that become available at the link below until we want to invest the time into figuring out what it takes to make the full upgrade.
- Releases: https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts
- scala-parallel-collections: 1.2.0
- play-bootstrap: 1.6.1-P28-B3
- Note: The version number, 1.6.1 is the newest. Looks like there haven't been updates since April, 2020. The P28-B3 at the end of the version number means "Play version 2.8, Bootstrap version 3". We're using Boostrap 3 right now (not Bootstrap 4). And Play 2.8 was the newest version when the most recent version of play-bootstrap was released. The library continues to function despite not being updated in 5+ years. We have very few pages that actually use it (really just our authentication pages). I don't expect this library to be updated again, and we're likely just going to keep using it until it breaks and we're forced to figure something else out!
- Releases: https://mvnrepository.com/artifact/com.adrianhurt/play-bootstrap
- Docs: https://playframework.github.io/play-bootstrap/
- jai_core: 1.1.3
- Note: There are no new releases for this library. The GeoTools libraries that we use to generate Shapefiles/GeoPackages use it, though they have long term plans to phase it out.
- Releases: https://mvnrepository.com/artifact/javax.media/jai_core
- gt-shapefile/gt-epsg-hsql/gt-geopkg: 29.6
- Note: I believe that we froze at this old version for some compatibility issues. Though I am not convinced that we couldn't figure out how to move forward to newer versions. The project continues to be actively maintained and improved, so there are likely benefits to figuring out how to upgrade this library.
- Releases: https://mvnrepository.com/artifact/org.geotools/gt-shapefile?repo=geotools-releases
- Changelog: https://github.com/geotools/geotools/releases
JavaScript
In almost all cases, we're downloading libraries and providing them directly ourselves, rather than using a CDN. We do this because providing them ourselves will generally be faster than using a CDN; it also give us a bit more control and clarity on what we're using.
Below, I've added links to changelogs where we should be able to see whether a new version is available, along with a link to a download page (or an example link to download directly from a URL, where we'd need to tweak the URL with the correct version number). Aim to download minified files (.min.js) to improve download times.
To upgrade the library, you should download the new version, and add the file to public/javascripts/lib/
, rename it to include the version number for clarity, update the file name throughout the code to use the new version number, and finally delete the version.
- async-lock: 1.4.1
- Note: if we download a new one, prob need to remove the module.export line at the end
- Download: https://cdn.jsdelivr.net/npm/[email protected]/lib/index.min.js
- Version list: https://github.com/rogierschouten/async-lock/releases
- backbone: 1.6.1
- Changelog: https://backbonejs.org/#changelog
- Download: https://github.com/jashkenas/backbone/blob/master/backbone-min.js
- Check version:
Backbone.VERSION
- betterknown: 1.0.5
- Download: https://unpkg.com/betterknown
- Version list: https://www.npmjs.com/package/betterknown?activeTab=versions
- Changelog: I've found no changelog anywhere
- bootstrap: 3.3.5
- Note: Upgrading to a newer version of bootstrap would be a huge undertaking, so it's been put off for now. Though I'm sure that we could upgrade from 3.3.5 to 3.4.1!
- bootstrap-datepicker: 1.9.0
- Download JS: https://unpkg.com/[email protected]/dist/js/bootstrap-datepicker.min.js
- Download CSS: https://unpkg.com/[email protected]/dist/css/bootstrap-datepicker.min.css
- Changelog: https://github.com/uxsolutions/bootstrap-datepicker/blob/master/CHANGELOG.md
- Note: There are also language-specific files that we haven't bothered with yet since it's only on admin pages right now.
- bowser: 1.9.4
- Note: We're at least one major release behind here. Their Github page says "Version 2.0 has drastically changed the API", so I punted on making the upgrade. It would be a good idea to upgrade though, as we use this library to determine what type of browser the user is using; being many years out of date here likely causes problems!
- Releases: https://www.npmjs.com/package/bowser/v/1.9.4?activeTab=versions
- Changelog: https://github.com/bowser-js/bowser/releases
- chart.js: 4.5.0
- Changelog: https://github.com/chartjs/Chart.js/releases
- Download: https://unpkg.com/chart.js
- Check version:
Chart.version
- countUp.js: 1.9.3
- I think that there might be a couple of libraries that have this name? I think that we only use it to animate the counting up of stats on the landing page. It's not heavily used, so I haven't put effort into upgrading it.
- d3: 3.5.6
- Note: We are at least 4 major versions behind at this point... It's a big library that I haven't put the time into upgrading.
- Versions: https://www.npmjs.com/package/d3?activeTab=versions
- Changelog: https://github.com/d3/d3/releases
- dataTable.bootstrap / jquery.dataTables
- TODO: We need to figure out what's going on with these libraries and their relationships to jquery and bootstrap.
- i18next: 23.16.8
- Note: Upgrading to v24+ involves some breaking changes that I haven't tested out yet. The changelog linked below links to a migration guide that we can work through. In the meantime, it's worth updating the minor versions as they come out.
- Download: https://unpkg.com/i18next/dist/umd/i18next.min.js
- Changelog: https://github.com/i18next/i18next/blob/master/CHANGELOG.md
- i18nextXHRBackend: 3.0.2
- Download for minified file is linked on this page: https://github.com/i18next/i18next-http-backend
- Changelog: https://github.com/i18next/i18next-http-backend/blob/master/CHANGELOG.md
- jquery.magnific-popup
- Not sure what's going on with this library at all. Probably need to figure out our jquery situation first.
- js-cookie: 3.0.5
- Download: https://unpkg.com/js-cookie
- Changelog: https://github.com/js-cookie/js-cookie/releases
- kinetic: 4.4.3
- I think that we just use this for the hand animation in the Explore page's tutorial? According to the Github, it's no longer being maintained. Looks like we could upgrade it to 5.1.0 at some point and call it a day.
- mapbox-gl js & css: 3.15.0
- Download most recent using script tags here: https://docs.mapbox.com/mapbox-gl-js/guides/install/
- Changelog: https://github.com/mapbox/mapbox-gl-js/blob/main/CHANGELOG.md
- Check version:
mapboxgl.version
- mapbox-gl-language: 1.0.1
- Download latest: https://unpkg.com/@mapbox/mapbox-gl-language
- Changelog: https://github.com/mapbox/mapbox-gl-language/releases
- mapbox-search-js: 1.3.0
- Download for minified file is linked on this page: https://docs.mapbox.com/mapbox-search-js/guides/install/
- Changelog: https://docs.mapbox.com/mapbox-search-js/guides/changelog/
- proj4js: 2.19.10
- Download: https://cdnjs.com/libraries/proj4js
- Changelog: https://github.com/proj4js/proj4js/releases
- turf.js: 7.2.0
- Download (change version number in URL): https://unpkg.com/@turf/[email protected]/turf.min.js
- Changelog: https://github.com/Turfjs/turf/releases
- underscore: 1.10.2
- I think that I tried upgrading versions, and it broke something. iirc, I determined that we don't use this library enough for it to be worthwhile to work through the upgrades. But I didn't document it at the time, so I could be wrong!
- Changelog: https://underscorejs.org/#changelog
- moment.js: 2.30.1
- Download main file: https://momentjs.com/
- Download individual language files: https://github.com/moment/moment/tree/develop/locale
- Changelog: https://github.com/moment/moment/blob/develop/CHANGELOG.md