You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When cloning/retrieving a workspace, a directory generated/@types/uesio is created that contains various type definitions that can be used when developing component packs.
Unfortunately, there are a few shortcomings with the current generated files:
Many types are not exported meaning they can't be referenced. For example, @uesio/ui/WireRecord, @uesio/ui/Context.
The API surface of the underlying objects contains methods that aren't included in the types. This is likely intentional in some cases (private vs public API) but in other cases, it would make sense to include methods that can be public. For example, Context contains a mergeString method but its not included in the generated Type, WireRecord contains getId which isn't included. There are other examples of this as well.
In short:
Unless there is a reason not to, "generated" types should be exported so they can be referenced. An example of this is an entry component that has properties for a collection. The entry component can useWire to obtain the collection, grab the data and then condition around displaying a child component if there is/isn't data. The child component should be able to accept the WireRecord[] as a prop but WireRecord isn't exported.
The generated types should include all props/methods/etc. that are determined to be public and this needs to be maintained as new props/methods are added.
The text was updated successfully, but these errors were encountered:
When cloning/retrieving a workspace, a directory
generated/@types/uesio
is created that contains various type definitions that can be used when developing component packs.Unfortunately, there are a few shortcomings with the current generated files:
@uesio/ui/WireRecord
,@uesio/ui/Context
.Context
contains amergeString
method but its not included in the generated Type, WireRecord containsgetId
which isn't included. There are other examples of this as well.In short:
useWire
to obtain the collection, grab the data and then condition around displaying a child component if there is/isn't data. The child component should be able to accept theWireRecord[]
as a prop butWireRecord
isn't exported.The text was updated successfully, but these errors were encountered: