-
Notifications
You must be signed in to change notification settings - Fork 557
Description
I think we'll need to solve #3264, and #2566 before we can do much here, as the current Module augmentation used by IFluidObject doesn't work correctly with re-exporting, and in general will create a lot of cross version pain. The biggest unknown here is how to deal with types that leverage keyof IFluidObject. I don't think there is a one size fits all approach to replacing that, but i'm exploring the usage patterns to see what we can do.
Originally posted by @anthony-murphy in #6540 (comment)
Proposal:
IFluidObject has two major issues. The first is the module augmentation, which results in unintuitive behavior. For instance it can be necessary to import unused typed to get compilation and intellisence to work correctly. The second is related, in that by augmenting all types onto IFluidObject we end up with an uber type that is easily broken by any change on any interface reachable by IFluidObject, which ends up being most interfaces in the fluid framework: Almost any interface change in the Fluid repo results in IFluidObject typing incompatibility · #2566
The below replacement doesn’t depend on module augmentation, or previous knowledge of the types. Instead it depends on the self-referential provider pattern itself to craft new types for inspection and discovery. The biggest change is that the developer needs to explicitly specify the types they will inspect for. However on code inspection of the repos this seems trivial in all current usage. The one caveat is when the type is just being passed, like in the scope or request pattern, and the caller may inspect it for anything. To solve for this case I’ve add a new type IProvideUnknown. It is just an empty interface, but signals that the type should be inspected with the Provider pattern.
Phase 1 work items
- Add provider pattern types to core interfaces #8072
- Mark IFluidObject as deprecated #8073
- Deprecate Internal and uncessary IFluidObject interfaces #8075
- Move internal usages of IFluidObject to provider pattern #8076
- Move Aqueduct from IFluidObject to Provider Pattern #8074
- Remove Synthesize Deprecated #8631
Phase 2 work items
Phase 3 work items - AB#155
- Remove all IFluid Object module augmentation #8077
- Remove IFluidObject interface #8078
- Add Core-Interfaces readme section on FluidObject #8253
Related issues: