Skip to content

reorganize library exports#866

Open
yjbanov wants to merge 3 commits intoflutter:mainfrom
yjbanov:better-exports
Open

reorganize library exports#866
yjbanov wants to merge 3 commits intoflutter:mainfrom
yjbanov:better-exports

Conversation

@yjbanov
Copy link
Copy Markdown
Collaborator

@yjbanov yjbanov commented Apr 12, 2026

Fixes #865

Reorganize the export structure of the genui package to improve maintainability, clean up the top-level API surface, and better document the internal library modules.

Changes

  • Directory-Level Exports: Created 11 new library files under lib/src/ (e.g., catalog.dart, engine.dart, model.dart, etc.) that encapsulate the internal structure of the package by exporting all files within their respective directories.
  • Refactored lib/genui.dart: Updated the main entry point to export these new directory-level libraries instead of listing individual files, significantly simplifying the top-level API.
  • Module Documentation: Added library directives and descriptive documentation comments to all new export files, outlining their purpose (e.g., core runtime, object model, transport primitives).
  • Conflict Resolution: Resolved ambiguous export conflicts for SurfaceAdded and SurfaceRemoved by using hide clauses when exporting src/engine.dart in lib/genui.dart.
  • Cleanup:
    • Removed unnecessary cf. prefixes in format_string.dart after resolving imports.
    • Cleaned up unnecessary_import analysis warnings in multiple test files that were caused by the change in export visibility.
  • Updated Package Description: Enhanced the documentation in lib/genui.dart to explicitly mention the A2UI protocol implementation and support for generative AI services.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the package's export structure by introducing barrel files for various modules and updating the main library file accordingly. It also simplifies imports in the core logic and removes redundant imports in the test suite. Review feedback focused on correcting several typos found in the newly added documentation comments.

/// This library provides the necessary components to build generative user
/// interfaces in Flutter applications. It includes models for UI components,
/// data handling, and communication with a generative AI service.
/// interfaces in Flutter applications. It implements that A2UI protocol
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Typo: 'that' should be 'the'.

/// interfaces in Flutter applications. It implements the A2UI protocol

// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/// Conventient abstractions for using the GenUI framework.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Typo: 'Conventient' should be 'Convenient'.

/// Convenient abstractions for using the GenUI framework.


/// Conventient abstractions for using the GenUI framework.
///
/// Contains utilities for building GenUI-enabled system promts, and utilities
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Typo: 'promts' should be 'prompts'.

/// Contains utilities for building GenUI-enabled system prompts, and utilities

// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/// String interpolation functions for interpolating string in A2UI payloads.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Typo: 'string' should be 'strings' for plural agreement.

/// String interpolation functions for interpolating strings in A2UI payloads.

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.

[basic catalog] support constructing custom catalogs with basic functions

1 participant