Aller au contenu
Skillpedia
Applis mobiles8.7k · #12332

nuke-migrate

Ce qu’il fait

Ce skill guide la mise à niveau d'une application Apple qui utilise la bibliothèque de chargement d'images Nuke vers la version 14. Il s'adresse aux développeurs qui voient des erreurs de compilation après une mise à jour ou qui doivent mettre à jour la bibliothèque.

Quand l’utiliser

  • ✓Quand vous changez la version de la bibliothèque d'images Nuke dans une application Apple.
  • ✓Lorsqu'une mise à niveau de Nuke échoue à la compilation et que vous avez besoin des étapes de remplacement.
  • ✓Quand vous voulez retirer NukeExtensions ou l'ancien code Combine d'une application.

Lien du skill

https://github.com/kean/Nuke/blob/main/skills/nuke-migrate/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/kean/Nuke/blob/main/skills/nuke-migrate/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Mets à niveau mon application iPhone de Nuke 13 vers Nuke 14, et vérifie les parties de code qui compilent encore mais ne fonctionnent plus.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Il vérifie la version de l'application et les plateformes ciblées, liste le code à risque que le compilateur ne signalera pas, puis met à jour chaque endroit étape par étape.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Migrating to Nuke 14

The compiler finds most of this migration, and its errors name the replacements. What it can't find is the dangerous part: code that keeps compiling and stops working. A green build doesn't mean the migration is done. Follow the steps in order.

1. Check that the app can move

grep -A6 '"identity" : "nuke"' Package.resolved *.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
grep -rnE 'IPHONEOS_DEPLOYMENT_TARGET|\.iOS\(' --include='*.pbxproj' --include='Package.swift' .
git ls-remote --tags https://github.com/kean/Nuke 'refs/tags/14.*'

If there's no Package.resolved, read the version from Package.swift. Nuke 14 needs iOS 16, tvOS 16, macOS 13, watchOS 9, or visionOS 1, and Xcode 26.0 with Swift 6.2. If the app deploys to something lower, stop and ask. The choice is between raising the target and staying on 13.x, which still gets fixes, and it isn't yours to make.

If the app is on 12.x or earlier, read From Nuke 12 or earlier as well.

2. List what the compiler won't report

Do this before you touch the dependency, and keep the list. Every hit gets resolved in step 5, whatever the build says.

# Every conformance to the pipeline delegate
grep -rnE 'ImagePipeline\.Delegate|ImagePipelineDelegate' --include='*.swift' .

# `nil` passed to a LazyImage modifier, and modifiers that take an optional
grep -rnE '\.(processors|priority)\(' --include='*.swift' .

# Error text that reaches people, and errors matched by type in NukeUI callbacks
grep -rn 'localizedDescription' --include='*.swift' .
grep -rnE 'onCompletion|onFailure|\.result|state\.error' --include='*.swift' .

# Views that start playing animations, and repeated loads that used to restart the task
grep -rnE 'LazyImage\(|LazyImageView|FetchImage|onStart' --include='*.swift' .

# Anything that plays, parses, or inspects the encoded data of an image
grep -rnE 'container\.data|imageContainer\?*\.data|\.type == \.gif|Gifu|FLAnimatedImage|SwiftyGif|SDAnimatedImage|makeImageView' --include='*.swift' .

# Queues and prefetchers set by hand, and decoders of your own
grep -rnE 'maxConcurrentRequestCount|ImageDecoding\b|isAsynchronous' --include='*.swift' .

The search can't see through a typealias, or a signature split over lines. Open each file and read it.

3. Update the dependency

from: "14.0.0" doesn't match a prerelease. If the tags from step 1 only have betas, pin one:

.package(url: "https://github.com/kean/Nuke", exact: "14.0.0-beta.1")

In an Xcode project, change the version rule of the package, and remove the Package.resolved entry if it won't update. The product names are the same.

4. Fix what the compiler reports

Widely used removed APIs have a stub, and the compiler error says what to do: follow it. @available(*, unavailable) stubs can't cover a removed enum case or a property of a removed type, and those are in this table.

Nuke 13 Nuke 14
Nuke_ImageDisplaying, nuke_display(image:data:) ImageDisplaying, nuke_display(_ container: ImageContainer?)
ImagePipelineDelegate ImagePipeline.Delegate
imageId, .imageIdKey imageID
.scaleKey, .thumbnailKey request.scale, request.thumbnail
A userInfo dictionary with those keys A var request with the properties set. It no longer needs userInfo
maximumDecodedImageSize ImageRequest.ThumbnailOptions, per request
ImageRequest(url:, userInfo:) request.userInfo = … on a var
imagePublisher(with:) image(for:), or imageTask(with:) and task.previews
FetchImage.load(publisher) load { try await … }
case .started in a delegate imageTaskDidStart(_:pipeline:)
Float(displayScale) for scale or maxPixelSize Remove the conversion, they're CGFloat
@ObservedObject var progress: FetchImage.Progress let progress: ImageTask.Progress, or read state.progress in place
state.error as? ImagePipeline.Error state.error, which is typed
lazyImageView.imageTask = … Read-only. Call cancel() or reset()
dataCache.flush(for: key) await dataCache.flush(), which writes everything
dataCache.queue Removed. Use await dataCache.flush() to wait for writes
dataCache.flush(), dataCache.sweep() await them, so the caller becomes async, and so do its callers
[String: Any] for coreImageFilter(name:parameters:identifier:) `[Stri
Questions fréquentes

Une compilation réussie signifie-t-elle que la migration est terminée ?

Non, le skill indique qu'une compilation réussie ne prouve pas que la migration est complète.

Quelles versions de plateforme Nuke 14 demande-t-il ?

Le skill cite iOS 16, tvOS 16, macOS 13, watchOS 9 ou visionOS 1, avec Xcode 26.

Que faire si mon application utilise une version plus ancienne ?

Le skill contient une section séparée pour la mise à niveau depuis Nuke 12 ou une version antérieure.

Détails

Description originale de l’auteur

Upgrade an app to Nuke 14 from Nuke 13 or earlier. Use when bumping the Nuke, NukeUI, or NukeExtensions dependency, when a Nuke upgrade doesn't compile, or when asked to replace NukeExtensions, Combine publishers, or a hand-written GIF view with current Nuke APIs. Finds what the compiler can't report, such as pipeline delegate methods that compile and are never called.

repo: kean/Nuke

Popularité

Étoiles GitHub
8.7k
Position au classement
#12332
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires