Skip to content

[FirebaseAI] Convert GenerativeAIUIComponents from Package to Folder Structure #1739

@YoungHypo

Description

@YoungHypo

Problem Description

Currently, 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)

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)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions