feat: Adds a package trait to turn off the support for LaTeX#144
feat: Adds a package trait to turn off the support for LaTeX#144LiYanan2004 merged 3 commits intoLiYanan2004:mainfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@TizianoCoroneo just FYI: I had the same issue a couple versions ago (tuist/tuist#9350). Starting from |
|
Humm. @TizianoCoroneo Could you please double check whether the package is still compile-able? |
|
Fixed, sorry. I misunderstood how to declare conditional dependencies using traits, and my Xcode was still building (I blame the package cache). |
| ) | ||
| ) | ||
| default: | ||
| return Text("Unimplemented: \(kind)") |
There was a problem hiding this comment.
This line just fixes a warning.
| "LaTeX", | ||
| .default(enabledTraits: ["LaTeX"]) |
There was a problem hiding this comment.
The first line declares a package trait, the second makes sure that the trait is enabled by default to keep compatibility with the current behavior.
| name: "LaTeXSwiftUI", | ||
| package: "LaTeXSwiftUI", | ||
| condition: .when(platforms: [.iOS, .macOS]) | ||
| condition: .when(platforms: [.iOS, .macOS], traits: ["LaTeX"]) |
There was a problem hiding this comment.
This one makes sure that this package is only included if the trait is enabled.
Hello, I'm using this nice library in a iOS app to deliver custom marketing messaging from our backend.
Overall, great experience using it. Works out of the box and the API is very Swift-y 😄
I encountered an issue when preparing a TestFlight though, due to signing issues related to the presence of JS files in the MathJAXSwift library that is downstream of LatexSwiftUI. Rather than fighting Tuist for hours to figure out how to sign JS files for distribution, I added a "package trait" to turn off the LaTeX dependency when resolving the Package.swift.
Let's be real, the marketing guys were not going to send LaTeX content anyway, for my use case 😅