firebase / firebase/quickstart-ios

[FirebaseAI] Convert GenerativeAIUIComponents from Package to Folder Structure

Open
#1,739 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
3k
Forks
1.5k
Avg merge
2d 5h
Merged PRs (30d)
3

Description

## Problem Description

Currently, [GenerativeAIUIComponents](https://github.com/firebase/quickstart-ios/tree/main/firebaseai/GenerativeAIUIComponents) in firebaseai uses **Swift Package mode**, which adds configuration complexity.

The goal of this project is to facilitate developers' quick reuse of the code, and focus more on using Firebase Gemini API.
So, it is suggested to convert GenerativeAIUIComponents from Package mode to **folder structure mode** to simplify dependency management and improve development experience.

## Current Structure (Package Mode)

```bash
GenerativeAIUIComponents/
├── Package.swift
├── .swiftpm/
└── Sources/GenerativeAIUIComponents/
├── InputField.swift
└── MultimodalInputField.swift
```

This structure requires maintaining Package.swift and adding `import GenerativeAIUIComponents` at usage points.

## Proposed Structure (Folder Mode)

```bash
firebaseai/
├── GenerativeAIUIComponents/
│ ├── Views/
│ │ ├── InputField.swift
│ │ └── MultimodalInputField.swift
│ └── Models/
│ └── ChatMessage.swift # Migrated from ChatExample
...
```

- Because all files belong to the same compilation target (PBXSourcesBuildPhase), they can be directly referenced within the root target.
- No additional `import statement coding` or Package configuration maintenance

## Proposed Changes
- Remove GenerativeAIUIComponents Package reference
- Move component source code to project folder structure
- Delete all `import GenerativeAIUIComponents` statements

For possible future work, new shared files can be added directly into this folder without maintaining SPM dependencies.

If it is feasible, I’d love to submit a PR. Looking forward to your feedback. @peterfriese

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.