[WIP] fix: updates for public server & client types #4423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
This is a WIP and should not be merged
What does this PR do?
As described in #4401, there are several issues with the existing "public types". This PR is intended to be a short-term solution to surface the more common types so they can be consumed by uesio app developers.
WireRecord.getId()
- it's not 100% clear yet to me when getId() needs to be used by getIdFieldValue() but in certain situations, getId() seems needed (e.g., api.signal.run) and in others getIdFieldValue() is needed (e.g., getting route assignments).Mergeable
instead of a string and return aFieldValue
instead of a string. The runtime behavior of this for any consumer won't change/break anything but the typescript will complain in the IDE due to the change in return type. This change was necessary for a couple of reasons: 1) the default component generated when creating a new component usedmergeString
which wasn't exported and if exported without changingmerge
, they would have the same signatures; 2) Could not change the default component to usemerge
because while the typing wouldn't error in a consumer project, it would in the uesio project itself; 3) merge actually does and should accept things besides strings since at runtime, there's no way to know what the user is going to input in a "merge" operation. Currently, I did not add mergeMap, mergeList, mergeDeep, etc. intentionally since until it's fully determined what the public merge API should be, felt it unnecessary to include these.Testing
Manual testing using a workspace that has code that relies on many of the types that were previously exported and no more typing errors :)