-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add all referenced fluid API to fluid-framework rollup package #20554
base: main
Are you sure you want to change the base?
Conversation
…to full-framework
import { FieldSchemaUnsafe as FieldSchemaUnsafe_2 } from './typesUnsafe.js'; | ||
import { FluidObject } from '@fluidframework/core-interfaces'; | ||
import { IChannel } from '@fluidframework/datastore-definitions'; | ||
import type { IErrorBase } from '@fluidframework/core-interfaces'; | ||
import { IEvent } from '@fluidframework/core-interfaces'; | ||
import { IEventProvider } from '@fluidframework/core-interfaces'; | ||
import { IFluidHandle } from '@fluidframework/core-interfaces'; | ||
import { IFluidLoadable } from '@fluidframework/core-interfaces'; | ||
import { ISharedObjectKind } from '@fluidframework/shared-object-base'; | ||
import { FluidObject as FluidObject_2 } from '@fluidframework/core-interfaces'; | ||
import { IFluidHandle as IFluidHandle_2 } from '@fluidframework/core-interfaces'; | ||
import { IFluidLoadable as IFluidLoadable_2 } from '@fluidframework/core-interfaces'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is strange/broken. API extractor bug? Rollup issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does seem problematic (wonder how it would affect generated doc pages). Any workaround? If we enforce consistently importing from /internal everywhere in our repo for example?
packages/framework/fluid-framework/api-report/fluid-framework.api.md
Outdated
Show resolved
Hide resolved
packages/framework/fluid-framework/api-report/fluid-framework.api.md
Outdated
Show resolved
Hide resolved
https://learn.microsoft.com/en-us/azure/azure-fluid-relay/concepts/version-compatibility#compatibility-table is relevant as we document our compat in terms of the fluid-framework package, so rolling these all up into one place robustly avoids the issue of what the implacied support/compat of the packages referenced by fluid-framework is. It also reduces the risk of mismatched point releases since fluid-framework gains a direct dependency on the packages it implicitly depends on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the main thing is that we need to clarify our support promise for these - I had been assuming we'd add them and fully support them (as they are accessible from the public API surface), so if we're saying it's something more nuanced as the @alpha
tagging implies I think we need to get that written down.
@@ -64,6 +24,194 @@ export enum AttachState { | |||
Detached = "Detached" | |||
} | |||
|
|||
// @alpha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think everything in this file needs to be @public
to ensure we have a clear support promise (these are part of the API surface we intend you to use), otherwise it's kind of muddy. @DLehenbauer WDYT?
Or else we probably need something concrete about what "exported but @alpha
" means -- available but no breaking change promise? available with full support promise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think our policy with respect to public vs alpha stuff is specific to this package, so I don't think this is the place to do that. I have separate work to document what we mean by supported and breaking changes, which can cover things like relying on undocumented behavior or non-public API not being supported and thus not being covered by our no breaking changes policy and what ever more formal policy we have for support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't see this PR as making any changes to what we support. For example before this PR IFluidHandle was referenced, and changing it could break users of this package. That is still true, users just don't have to depend on another package if they want to save a handle in a typed variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChumpChief - The @alpha
tag is how we get Fluid Framework 1.0 types to show up under the 'fluid-framework/legacy' path. (It's the same as how we use @alpha
elsewhere.)
The message to customers is that '/legacy' types are supported, but not recommended for new designs. We'll mark the types as @deprecated
when we have a way for customers to migrate their data forward to SharedTree.
export interface AttributionPolicy { | ||
attach: (client: Client) => void; | ||
detach: () => void; | ||
// (undocumented) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably all these should be documented too - obv a lot so not in this PR necessarily, but we should open some work items and consider them for 2.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this PR as a way to make these issues more discoverable, so I think we should specifically not block it on trying to fix these issues, and instead merge this PR before farming out work to fix issues like this.
import { FieldSchemaUnsafe as FieldSchemaUnsafe_2 } from './typesUnsafe.js'; | ||
import { FluidObject } from '@fluidframework/core-interfaces'; | ||
import { IChannel } from '@fluidframework/datastore-definitions'; | ||
import type { IErrorBase } from '@fluidframework/core-interfaces'; | ||
import { IEvent } from '@fluidframework/core-interfaces'; | ||
import { IEventProvider } from '@fluidframework/core-interfaces'; | ||
import { IFluidHandle } from '@fluidframework/core-interfaces'; | ||
import { IFluidLoadable } from '@fluidframework/core-interfaces'; | ||
import { ISharedObjectKind } from '@fluidframework/shared-object-base'; | ||
import { FluidObject as FluidObject_2 } from '@fluidframework/core-interfaces'; | ||
import { IFluidHandle as IFluidHandle_2 } from '@fluidframework/core-interfaces'; | ||
import { IFluidLoadable as IFluidLoadable_2 } from '@fluidframework/core-interfaces'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does seem problematic (wonder how it would affect generated doc pages). Any workaround? If we enforce consistently importing from /internal everywhere in our repo for example?
export type { | ||
EventEmitterEventType, | ||
TypedEventEmitter, | ||
// It is unclear why ae-forgotten-export requires this since its not referenced. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypedEventEmitter references it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you search the API report for it there are no usages so it should not need to be imported. This is entangled with the strangeness that the above two types are not getting inclined in the report like everything else (if that was fixed, then this would be referenced). I'll update the comments to make that more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments have been updated.
@@ -250,6 +692,226 @@ export interface IDisposable { | |||
[disposeSymbol](): void; | |||
} | |||
|
|||
// @public | |||
export interface IDisposable_2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unfortunate that IDisposable and IDisposable_2 are different? Is there something we can do to disambiguate these more nicely, merge them, etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have existing internal work items about that, see https://dev.azure.com/fluidframework/internal/_workitems/edit/6591/ which I have also just updated.
⯅ @fluid-example/bundle-size-tests: +2.99 KB
Baseline commit: 350c06a |
Description
This adds exports to the fluid-framework package until all the imports from fluid framework are gone from its API report.
This would avoid errors where using some APIs (ex: exporting them from packages in apps) may warn about types not being namable, or being unable to explicitly type some values without additional imports.
Additionally this puts the transitively reachable portion of our public API in one place where it can be reviewed.
Reviewer Guidance
The review process is outlined on this wiki page.
It is unclear to me what the policy is for which things should be exported from fluid-framework, so I'm not sure if this change is a fix or violating some decision that was made. Clarification on this would be valuable.