Problem
A framework adapter should be usable standalone. However, as of right now, all our adapters automatically include the basic catalog:
This increases the API surface of the core libraries, and the dependency tree for all apps, even those that do not use the basic catalog. As A2UI is designed to support high trust GenUI experiences, apps would want to have tight control over widgets used in their A2UI catalogs. Having the basic catalog always in the import namespace of your code, however, makes it too easy to use the wrong widget, and too hard to guard against it (it requires deep code analysis with type resolution).
Options
Instead, developers who would like to reuse some of the basic components should import them from a separate library.
There's a couple of way to do this decoupling:
- Same package, separate libraries: keep the basic components in the core package, but put them in a separate library. I would recommend this option if our basic components satisfy the following two criteria:
a. Highly reusable: the core packages should be limited to only highly reusable code, or high value code that cannot exist outside core packages without compromising the design of the core packages.
b. High quality: basic components should meet the standard of quality we set for the whole package.
c. Inherently safe: basic components should be safe to use, and not pose hallucination, exfiltration, code execution, and other security risks.
- Separate packages: separate basic components into separate packages, requiring not only additional imports, but also additional dependencies (e.g. in
pubspec.yam, packages.json, etc). I would recommend this option if our basic components do not meet the standards set in option 1.
Overall, I have a preference for option #1 same package, separate libraries. This makes A2UI easier to start with, and it is a standard practice for UI toolkits (Flutter, ReactNative, HTML) to include some basics. However, as of right now, other than a few layout primitives, it is unclear how reusable and safe our basic components are. For example, we provide image, audio, and video components, but they do not check the URLs passed to them, which makes them unsuitable for any kind of production deployment. We might have to prune the catalog to something a lot more basic but highly reusable.
Problem
A framework adapter should be usable standalone. However, as of right now, all our adapters automatically include the basic catalog:
This increases the API surface of the core libraries, and the dependency tree for all apps, even those that do not use the basic catalog. As A2UI is designed to support high trust GenUI experiences, apps would want to have tight control over widgets used in their A2UI catalogs. Having the basic catalog always in the import namespace of your code, however, makes it too easy to use the wrong widget, and too hard to guard against it (it requires deep code analysis with type resolution).
Options
Instead, developers who would like to reuse some of the basic components should import them from a separate library.
There's a couple of way to do this decoupling:
a. Highly reusable: the core packages should be limited to only highly reusable code, or high value code that cannot exist outside core packages without compromising the design of the core packages.
b. High quality: basic components should meet the standard of quality we set for the whole package.
c. Inherently safe: basic components should be safe to use, and not pose hallucination, exfiltration, code execution, and other security risks.
pubspec.yam,packages.json, etc). I would recommend this option if our basic components do not meet the standards set in option 1.Overall, I have a preference for option #1 same package, separate libraries. This makes A2UI easier to start with, and it is a standard practice for UI toolkits (Flutter, ReactNative, HTML) to include some basics. However, as of right now, other than a few layout primitives, it is unclear how reusable and safe our basic components are. For example, we provide image, audio, and video components, but they do not check the URLs passed to them, which makes them unsuitable for any kind of production deployment. We might have to prune the catalog to something a lot more basic but highly reusable.