Skip to content

Commit 1c5ead2

Browse files
Update the bundled Scalar UI to 1.60.0
Dependabot flagged @scalar/api-reference 1.60.0. It is an additive minor — a content.start plugin slot and an opt-in sidebar for plugin views, plus a handful of rendering fixes (composition nesting, deep links into collapsed schemas, response descriptions, the loading skeleton, a 1000px sidebar overlap). None of it touches the standalone build or the #api-reference/data-url bootstrap both UIs rely on, so no page or CSP change is needed. The version is pinned in several places that have to move together or the parity tests fail: the package.json tracker, the CDN version and sha384 SRI in ui/scalar, and the vendored bundle, version, and go:generate URL in ui/scalaremb, plus both pinning tests. The new standalone.js is byte-identical between the npm tarball and the pinned jsDelivr URL, and the SRI is recomputed from those bytes.
1 parent 7ed116c commit 1c5ead2

6 files changed

Lines changed: 260 additions & 259 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"description": "Dev-only manifest. Used by Dependabot to track upstream versions of the docs UI bundles and the typescript release CI type-checks tsgen output against; the Go source in ui/*/*.go is the source of truth for the bundle versions that ship. Do not 'npm install' — the runtime does not import any npm package.",
66
"devDependencies": {
7-
"@scalar/api-reference": "1.59.3",
7+
"@scalar/api-reference": "1.60.0",
88
"@stoplight/elements": "9.0.22",
99
"redoc": "2.5.3",
1010
"swagger-ui-dist": "5.32.6",

ui/scalar/scalar.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// Scalar JavaScript and CSS are loaded from cdn.jsdelivr.net at page
1818
// load time, so an internet connection is required.
1919
//
20-
// The CDN URL is pinned to a specific version (1.59.3) and points at
20+
// The CDN URL is pinned to a specific version (1.60.0) and points at
2121
// the verbatim dist/browser/standalone.js file from the npm package,
2222
// so its bytes are deterministic and the sha384 SRI hash below is
2323
// pinned in the <script> tag. Bumping the pinned version requires
@@ -34,14 +34,14 @@ import (
3434
// scalarVersion is the version of @scalar/api-reference this
3535
// package is pinned to. Bumping this requires updating the SRI
3636
// hash below and re-vendoring the bundle in ui/scalaremb.
37-
const scalarVersion = "1.59.3"
37+
const scalarVersion = "1.60.0"
3838

3939
// scalarSRIHash is the sha384 SRI hash of dist/browser/standalone.js
4040
// at the pinned version. Re-compute with:
4141
//
4242
// curl -fsSL "https://cdn.jsdelivr.net/npm/@scalar/api-reference@<ver>/dist/browser/standalone.js" \
4343
// | openssl dgst -sha384 -binary | openssl base64 -A
44-
const scalarSRIHash = "sha384-cIupCoQjF73k8Pd8cAp5J3dicczn0FqXBbC8Iyjd8UTSj8vqW+NUcD7jJWed81ko"
44+
const scalarSRIHash = "sha384-3sxnxyp7pbU2/o4+gs4EbvQ4YKyF60pWDL2LW8SoFZNQBTSiPah2xcHpxsndZEgF"
4545

4646
// WithUI returns a stdocs.Option that replaces the default docs
4747
// page with the Scalar UI.

ui/scalar/scalar_pinning_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
// dist/browser/standalone.js file, so its sha384 SRI hash is
1515
// pinned too.
1616
func TestPinnedVersion(t *testing.T) {
17-
if scalarVersion != "1.59.3" {
18-
t.Errorf("scalarVersion = %q, want 1.59.3 (re-vendor the bundle in ui/scalaremb)", scalarVersion)
17+
if scalarVersion != "1.60.0" {
18+
t.Errorf("scalarVersion = %q, want 1.60.0 (re-vendor the bundle in ui/scalaremb)", scalarVersion)
1919
}
2020
wantURL := fmt.Sprintf("https://cdn.jsdelivr.net/npm/@scalar/api-reference@%s/dist/browser/standalone.js", scalarVersion)
2121
if !strings.Contains(scalarHTML, `src="`+wantURL+`"`) {

ui/scalaremb/assets/standalone.js

Lines changed: 249 additions & 248 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/scalaremb/scalaremb.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// bundle in your binary so the docs UI works without an internet
77
// connection.
88
//
9-
// The vendored bundle is pinned to @scalar/api-reference@1.59.3 and
9+
// The vendored bundle is pinned to @scalar/api-reference@1.60.0 and
1010
// ships in-repo, so importing this package is all you need; the
1111
// //go:generate directive below is a maintainer-only convenience for
1212
// re-vendoring the bundle on a version bump.
@@ -50,12 +50,12 @@ import (
5050
// `go generate` cannot run inside the module cache anyway). Bumping
5151
// the version requires updating scalarVersion, the URL below, the
5252
// SRI hash in ui/scalar, and the hash pin in the tests.
53-
//go:generate bash -c "curl -fsSL https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.59.3/dist/browser/standalone.js -o assets/standalone.js"
53+
//go:generate bash -c "curl -fsSL https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.60.0/dist/browser/standalone.js -o assets/standalone.js"
5454

5555
// scalarVersion is the version of @scalar/api-reference vendored
5656
// under assets/. It must match the devDependencies entry in the
5757
// repo-root package.json.
58-
const scalarVersion = "1.59.3"
58+
const scalarVersion = "1.60.0"
5959

6060
//go:embed assets/*
6161
var assetsFS embed.FS

ui/scalaremb/scalaremb_pinning_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212

1313
// standaloneJSHash is the sha384 hash of the vendored
1414
// assets/standalone.js, verified byte-identical to
15-
// dist/browser/standalone.js in the @scalar/api-reference@1.59.3
15+
// dist/browser/standalone.js in the @scalar/api-reference@1.60.0
1616
// npm tarball (and to the pinned jsDelivr URL). It matches
1717
// scalarSRIHash in ui/scalar.
18-
const standaloneJSHash = "sha384-cIupCoQjF73k8Pd8cAp5J3dicczn0FqXBbC8Iyjd8UTSj8vqW+NUcD7jJWed81ko"
18+
const standaloneJSHash = "sha384-3sxnxyp7pbU2/o4+gs4EbvQ4YKyF60pWDL2LW8SoFZNQBTSiPah2xcHpxsndZEgF"
1919

2020
func sri384(data []byte) string {
2121
sum := sha512.Sum384(data)

0 commit comments

Comments
 (0)