Skip to content

feat: Adds a package trait to turn off the support for LaTeX#144

Merged
LiYanan2004 merged 3 commits intoLiYanan2004:mainfrom
TizianoCoroneo:main
Mar 14, 2026
Merged

feat: Adds a package trait to turn off the support for LaTeX#144
LiYanan2004 merged 3 commits intoLiYanan2004:mainfrom
TizianoCoroneo:main

Conversation

@TizianoCoroneo
Copy link
Copy Markdown
Contributor

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 😅

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@iphilgood
Copy link
Copy Markdown

@TizianoCoroneo just FYI: I had the same issue a couple versions ago (tuist/tuist#9350). Starting from 4.148.3 it started working again for me.

@LiYanan2004 LiYanan2004 self-requested a review March 13, 2026 10:23
@LiYanan2004
Copy link
Copy Markdown
Owner

Humm. @TizianoCoroneo Could you please double check whether the package is still compile-able?

@TizianoCoroneo
Copy link
Copy Markdown
Contributor Author

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)")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line just fixes a warning.

Comment on lines +19 to +20
"LaTeX",
.default(enabledTraits: ["LaTeX"])
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"])
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one makes sure that this package is only included if the trait is enabled.

@LiYanan2004 LiYanan2004 merged commit 31e52d2 into LiYanan2004:main Mar 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants