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
## Description
Since simple schema can now contain view schema specific data, but might
also be derived from stored schema, and might also be storing only a
subset of its view specific data that it can hold (like when
snapshotting for compatibility tests) using it is rather error prone.
This refactoring attempts to better clarify what the semantics of a
given simple schema are by allowing them to be typed as either view or
stored, and providing more specific names and docs to the compatibility
snapshotting APIs.
This also refactors how we generate stored schema: now we transform a
simple schema for a view to a simple schema for stored schema, then
convert that to the persisted format. This redesign separates the
concerns for persisted format conversion and the semantics of things
like staged schema which get processes when converting from view to
stored.
This results in some deduplication of logic, and allows all schema
transformation logic to be applied directly to simple-schema.
This change could be followed up with some further changes to better
remove stored schema from the alpha APIs, and replace those APIs with
use of stored-simple-schema and thus shrinking the package API surface
area and making its types more interoperable.
`getUnhydratedContext` has been improved to give better asserts when
uses re-entrantly.
## Breaking Changes
Several stored and simple schema alpha APIs have been impacted, but all
stable APIs should behave as is.
// Validate the schema and collect ambiguity errors.
213
+
// This does a lot of validation (throwing usage errors as a side effect) in addition to just collecting ambiguity errors.
214
+
// ambiguityErrors are considered a lower priority, so only thrown if no other errors are found.
235
215
walkFieldSchema(config.schema,{
236
-
node: (schema)=>{
237
-
// Ensure all reachable schema are marked as most derived.
238
-
// This ensures if multiple schema extending the same schema factory generated class are present (or have had instances of them constructed, or get instances of them constructed in the future),
0 commit comments