From 77090aa7ad3215163f9a2fe48676386593cef55c Mon Sep 17 00:00:00 2001 From: Dave Verwer Date: Thu, 4 Jun 2026 11:31:27 +0100 Subject: [PATCH 1/3] Removed the Try in a Playground app. --- FrontEnd/main.js | 2 - FrontEnd/scripts/playgrounds_app_link.js | 56 ------------------- FrontEnd/styles/_package.scss | 37 ------------ Resources/Markdown/faq.md | 9 --- Resources/Markdown/try-package.md | 19 ------- Sources/App/Core/SiteURL.swift | 5 -- .../PackageController/PackageShow+View.swift | 20 ------- Sources/App/routes.swift | 4 -- 8 files changed, 152 deletions(-) delete mode 100644 FrontEnd/scripts/playgrounds_app_link.js delete mode 100644 Resources/Markdown/try-package.md diff --git a/FrontEnd/main.js b/FrontEnd/main.js index 462a065eb5..6e0dc13400 100644 --- a/FrontEnd/main.js +++ b/FrontEnd/main.js @@ -21,13 +21,11 @@ import './scripts/external_link_retargeter.js' import { SPIAutofocus } from './scripts/autofocus.js' import { SPIBuildLogNavigation } from './scripts/build_log_navigation.js' import { SPICopyableInput } from './scripts/copy_buttons.js' -import { SPIPlaygroundsAppLinkFallback } from './scripts/playgrounds_app_link.js' import { SPISearchFilterSuggestions } from './scripts/search_filter_suggestions.js' new SPIAutofocus() new SPIBuildLogNavigation() new SPICopyableInput() -new SPIPlaygroundsAppLinkFallback() new SPISearchFilterSuggestions() //# sourceMappingURL=main.js.map diff --git a/FrontEnd/scripts/playgrounds_app_link.js b/FrontEnd/scripts/playgrounds_app_link.js deleted file mode 100644 index fb2d7c39aa..0000000000 --- a/FrontEnd/scripts/playgrounds_app_link.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright Dave Verwer, Sven A. Schmidt, and other contributors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import { measurePlausibleEvent } from './plausible_analytics.js' - -export class SPIPlaygroundsAppLinkFallback { - constructor() { - document.addEventListener('click', (event) => { - const linkElement = event.target.findParentMatching((element) => { - return element.matches('a') && element.protocol === 'spi-playgrounds:' - }) - - if (linkElement) { - // This link should *never* act as a link otherwise people will see the - // error page saying the app isn't installed with no opportunity for us - // to tell them how to continue. - event.preventDefault() - - // Instead, fake a link inside a page that's never visible by creating - // an iframe element and having that try to load the app. If the app is - // not installed, this fails silently. - const frameElement = document.createElement('iframe') - frameElement.style.display = 'none' - frameElement.src = linkElement.href - linkElement.insertAdjacentElement('afterend', frameElement) - setTimeout(() => { - frameElement.remove() - }, 1000) - - // Also, because we can never know whether the app opened, display the - // popover div that links to the download page. Hide it again 5 seconds later. - const explainerElement = document.getElementById('app-download-explainer') - explainerElement.classList.remove('hidden') - setTimeout(() => { - explainerElement.classList.add('hidden') - }, 5000) - - // Trigger an analytics event and pass the dependency as a custom property - const targetUrl = new URL(linkElement.href) - const dependencies = targetUrl.searchParams.get('dependencies') - measurePlausibleEvent('SPI Playgrounds Launch', { props: { dependency: dependencies } }) - } - }) - } -} diff --git a/FrontEnd/styles/_package.scss b/FrontEnd/styles/_package.scss index 783c78acd5..e2590a6a6a 100644 --- a/FrontEnd/styles/_package.scss +++ b/FrontEnd/styles/_package.scss @@ -266,43 +266,6 @@ } } - .try-in-playground { - position: relative; - - #app-download-explainer { - position: absolute; - left: -25%; - width: 150%; - margin-top: 10px; - padding: 10px; - font-size: 14px; - color: var(--page-text); - background-color: var(--panel-background); - border-top: 3px var(--panel-border) solid; - box-shadow: var(--panel-shadow); - - &::before { - content: ''; - position: absolute; - top: -13px; - left: 50%; - width: 0; - height: 0; - margin-left: -10px; - border-style: solid; - border-width: 0 10px 10px; - border-color: transparent transparent var(--panel-border) transparent; - } - } - - @media screen and (max-width: $mobile-breakpoint) { - #app-download-explainer { - left: 10%; - width: 80%; - } - } - } - .use-this-package { .version { display: flex; diff --git a/Resources/Markdown/faq.md b/Resources/Markdown/faq.md index b1435af35f..b4bd3642cf 100644 --- a/Resources/Markdown/faq.md +++ b/Resources/Markdown/faq.md @@ -17,7 +17,6 @@ description: Frequently Asked Questions about the Swift Package Index - [Can I contribute to the Swift Package Index?](#contributing) - [Is there an API?](#api) - [Why are package versions missing?](#missing-versions) -- [What is the SPI-Playgrounds app?](#spi-playgrounds-app) - [How can I filter search results?](#search-filters) --- @@ -116,14 +115,6 @@ A good way to check what the latest semantic version release of a package is is --- -

What is the SPI-Playgrounds app?

- -Have you ever wanted to try out a package in a Swift playground before you decide to use it? Click “Try in a Playground” from any package page and have the Swift Package Index Playgrounds app create a playground with the package automatically imported, ready for testing and experimentation. - -If you don't have the SPI-Playgrounds app installed, you can [download it for macOS here](/try-in-a-playground). - ---- -

How can I filter search results?

You can narrow package search results with a search syntax that filters based on package metadata. For example, you could search for packages that [match "networking" and have more than 500 stars](https://swiftpackageindex.com/search?query=networking+stars%3A%3E500). diff --git a/Resources/Markdown/try-package.md b/Resources/Markdown/try-package.md deleted file mode 100644 index 73cb23540e..0000000000 --- a/Resources/Markdown/try-package.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -page-title: Try in a Playground -description: Try any Swift package in a Swift Playground by downloading the Swift Package Index Playgrounds app for macOS. ---- - -## Try Packages in a Swift Playground - -What’s the best way to know whether a package is right for your project? Try it in a Swift Playground! **Download the Swift Package Index Playgrounds app for macOS** and generate playground files with the dependency already inserted, ready to open with Xcode. - - - Download - Requires macOS 13 or newer - - -Once downloaded and installed, click **“Try in a Playground”** from any package page on the Swift Package Index to open a Swift playground in Xcode with the package imported, ready for experimentation and testing. - -### Trying packages on older macOS versions - -The latest version of “Swift Package Index Playgrounds” requires macOS 13 or newer. If you are on an earlier version of macOS, version 1.0.1 of the app is still available for download. diff --git a/Sources/App/Core/SiteURL.swift b/Sources/App/Core/SiteURL.swift index 5b9fad00c1..ac03c2c3bc 100644 --- a/Sources/App/Core/SiteURL.swift +++ b/Sources/App/Core/SiteURL.swift @@ -135,7 +135,6 @@ enum SiteURL: Resourceable, Sendable { case siteMapStaticPages case stylesheets(String) case supporters - case tryInPlayground case healthCheck case validateSPIManifest @@ -260,9 +259,6 @@ enum SiteURL: Resourceable, Sendable { case let .stylesheets(name): return "/\(name).css" - case .tryInPlayground: - return "try-in-a-playground" - case .healthCheck: return "health-check" @@ -287,7 +283,6 @@ enum SiteURL: Resourceable, Sendable { .siteMapIndex, .siteMapStaticPages, .supporters, - .tryInPlayground, .healthCheck, .validateSPIManifest: return [.init(stringLiteral: path)] diff --git a/Sources/App/Views/PackageController/PackageShow+View.swift b/Sources/App/Views/PackageController/PackageShow+View.swift index 90f608fdbe..ac585c44b3 100644 --- a/Sources/App/Views/PackageController/PackageShow+View.swift +++ b/Sources/App/Views/PackageController/PackageShow+View.swift @@ -237,26 +237,6 @@ extension PackageShow { "View on GitHub" ) ), - .li( - .class("try-in-playground"), - .a( - .href("spi-playgrounds://open?dependencies=\(model.repositoryOwner)/\(model.repositoryName)"), - "Try in a Playground" - ), - .div( - .id("app-download-explainer"), - .class("hidden"), - .strong("Launching the SPI Playgrounds app…"), - .p( - .text("If nothing happens, you may not have the app installed. "), - .a( - .href(SiteURL.tryInPlayground.relativeURL(parameters: [QueryParameter(key: "dependencies", value: "\(model.repositoryOwner)/\(model.repositoryName)")])), - "Download the Swift Package Index Playgrounds app" - ), - .text(" and try again.") - ) - ) - ), .unwrap(model.homepageUrl) { homepageUrl in .li( .a( diff --git a/Sources/App/routes.swift b/Sources/App/routes.swift index f21c9e372d..7d82164f1f 100644 --- a/Sources/App/routes.swift +++ b/Sources/App/routes.swift @@ -55,10 +55,6 @@ func routes(_ app: Application) throws { app.get(SiteURL.privacy.pathComponents) { req in MarkdownPage(path: req.url.path, "privacy.md").document() } - - app.get(SiteURL.tryInPlayground.pathComponents) { req in - MarkdownPage(path: req.url.path, "try-package.md").document() - } } try docRoutes(app) From 8121f0db425547336508ef94357a78dd6345b805 Mon Sep 17 00:00:00 2001 From: Dave Verwer Date: Thu, 4 Jun 2026 13:03:04 +0100 Subject: [PATCH 2/3] Snapshots. --- .../WebpageSnapshotTests/PackageShow_document.1.html | 9 --------- .../PackageShow_document_binary_targets.1.html | 9 --------- ...ageShow_document_canonicalURL_noImageSnapshots.1.html | 9 --------- .../PackageShow_document_customCollection.1.html | 9 --------- .../PackageShow_document_emoji_summary.1.html | 9 --------- .../PackageShow_document_few_keywords.1.html | 9 --------- .../PackageShow_document_known_license.1.html | 9 --------- .../PackageShow_document_many_keywords.1.html | 9 --------- .../PackageShow_document_no_authors_activity.1.html | 9 --------- .../PackageShow_document_no_builds.1.html | 9 --------- .../PackageShow_document_no_license.1.html | 9 --------- .../PackageShow_document_single_row_tables.1.html | 9 --------- .../PackageShow_document_unknown_license.1.html | 9 --------- .../PackageShow_document_withPackageFundingLinks.1.html | 9 --------- .../PackageShow_document_with_documentation_link.1.html | 9 --------- 15 files changed, 135 deletions(-) diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document.1.html index 94eba84ee9..8235df6b09 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document.1.html @@ -264,15 +264,6 @@

Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -
  • Package Homepage
  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_binary_targets.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_binary_targets.1.html index c39d4cb22d..75626c6963 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_binary_targets.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_binary_targets.1.html @@ -268,15 +268,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -
  • Package Homepage
  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_canonicalURL_noImageSnapshots.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_canonicalURL_noImageSnapshots.1.html index 3458fd3485..294bb88aae 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_canonicalURL_noImageSnapshots.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_canonicalURL_noImageSnapshots.1.html @@ -264,15 +264,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_customCollection.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_customCollection.1.html index 4a947d6813..ae6d87d777 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_customCollection.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_customCollection.1.html @@ -267,15 +267,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -
  • Package Homepage
  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_emoji_summary.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_emoji_summary.1.html index ff32bccc2b..9381b5d4ee 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_emoji_summary.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_emoji_summary.1.html @@ -264,15 +264,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_few_keywords.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_few_keywords.1.html index 6335b06b09..38423fb238 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_few_keywords.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_few_keywords.1.html @@ -295,15 +295,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_known_license.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_known_license.1.html index efc6d350f2..4651b6dac9 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_known_license.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_known_license.1.html @@ -266,15 +266,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_many_keywords.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_many_keywords.1.html index bcf334baed..698fd8c7eb 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_many_keywords.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_many_keywords.1.html @@ -470,15 +470,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_authors_activity.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_authors_activity.1.html index bb550a51e0..453b76e07d 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_authors_activity.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_authors_activity.1.html @@ -259,15 +259,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_builds.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_builds.1.html index d9e84c5bfb..197dc0363b 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_builds.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_builds.1.html @@ -189,15 +189,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_license.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_license.1.html index 8606362f33..83c1d4a865 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_license.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_no_license.1.html @@ -264,15 +264,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_single_row_tables.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_single_row_tables.1.html index 413502e3bb..dc5a63e68a 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_single_row_tables.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_single_row_tables.1.html @@ -229,15 +229,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_unknown_license.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_unknown_license.1.html index cc2e636f90..ecae827fe8 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_unknown_license.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_unknown_license.1.html @@ -266,15 +266,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_withPackageFundingLinks.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_withPackageFundingLinks.1.html index fbdc8b3d74..b8507ce7f7 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_withPackageFundingLinks.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_withPackageFundingLinks.1.html @@ -272,15 +272,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -

  • diff --git a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_with_documentation_link.1.html b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_with_documentation_link.1.html index 107801e835..956c3848e3 100644 --- a/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_with_documentation_link.1.html +++ b/Tests/AppTests/__Snapshots__/WebpageSnapshotTests/PackageShow_document_with_documentation_link.1.html @@ -264,15 +264,6 @@

    Compatibility

  • View on GitHub
  • -
  • - Try in a Playground - -
  • Documentation
  • From 26f2c07ee866ee3f93a8ae62b354440386b24167 Mon Sep 17 00:00:00 2001 From: Dave Verwer Date: Thu, 4 Jun 2026 14:15:13 +0100 Subject: [PATCH 3/3] Pin the Percy CLI tool to a working version as 1.31.14 (and all future betas) hang with the turbo frame files. --- .github/workflows/snapshots.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/snapshots.yml b/.github/workflows/snapshots.yml index 2d2f2ce986..cc66a72661 100644 --- a/.github/workflows/snapshots.yml +++ b/.github/workflows/snapshots.yml @@ -52,7 +52,9 @@ jobs: - name: Run Percy if: steps.front-end-changes.outputs.matching-files != '0' run: | - npm install -g @percy/cli + # Pinned: @percy/cli 1.31.14 and every later build (incl. 1.32.x betas) + # hang during asset discovery on the turboframe HTML fragment snapshots + npm install -g @percy/cli@1.31.13 echo "=== Installed Percy Version ===" npx percy --version echo "=== Running Snapshots ==="