Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in migration guide #70

Merged
merged 1 commit into from
Jun 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Docs/Migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Follow these steps, and you should be up and running in no time. I was able to u
1. Update your dependency manager to point to `hotwired/turbo-ios` instead `turbolinks/turbolinks-ios`, see the [installation](Installation.md) doc for more info.
2. Change all your imports from `import Turbolinks` to `import Turbo`. This also would apply if you have any place you're using the full module for a type, like `Turbolinks.Session` would need to change to `Turbo.Session`
3. Try to build, at which point you should start to see a few errors for API changes.
4. `session(_ session: Session, didPropseVisitToURL url: URL, withAction action: Action)` is now `session(_ session: Session, didProposeVisit proposal: VisitProposal)`. The new `VisitProposal` type includes the url and a new `VisitOptions` type. The `VisitOptions` type includes the action.
4. `session(_ session: Session, didProposeVisitToURL url: URL, withAction action: Action)` is now `session(_ session: Session, didProposeVisit proposal: VisitProposal)`. The new `VisitProposal` type includes the url and a new `VisitOptions` type. The `VisitOptions` type includes the action.
5. `func session(_ session: Session, didFailRequestForVisitable visitable: Visitable, withError error: NSError)` is now `func session(_ session: Session, didFailRequestForVisitable visitable: Visitable, error: Error)`. What was previously an `NSError` is now an `Error`. To access the statusCode from a failure, you can check if the error is a new `TurboError` type like so: `let turboError = error as? TurboError, case .http(let statusCode) = turboError`
6. That should be the major code changes, please test your app first and open an issue if you run into blockers during migration. Note: the old Turbolinks.framework is now deprecated, but you can continue to use it as long as it works for you.

Expand Down