Skip to content
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

Make isFluidHandle public #22029

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

CraigMacomber
Copy link
Contributor

@CraigMacomber CraigMacomber commented Jul 25, 2024

Description

This makes isFluidHandle public.

An alternative API, using Symbol.hasInstrance and instancof IFluidHandle is not possible here, since there already is non-type value exported under the name IFluidHandle (its the string "IFluidHandle") which can not have the symbol added to it.

This leaves the existing isFluidHandle function seeming like the only real API option.

Detecting handles correctly requires knowing implementation details of handle and dealing with the possibility of old in memory handle representations, so we don't want customers rolling their own. As there are use-cases for handle detection, we should probably expose this API to do it robustly.

Reviewer Guidance

The review process is outlined on this wiki page.

Do we want to make this public? I think so, but that should be covered by the review. We could also go to alpha or beta first. THis seems pretty safe to stabilize though.

@CraigMacomber CraigMacomber requested review from a team as code owners July 25, 2024 22:45
Copy link

changeset-bot bot commented Jul 25, 2024

🦋 Changeset detected

Latest commit: 881fefc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 157 packages
Name Type
fluid-framework Major
@fluidframework/runtime-utils Major
@fluid-example/presence-tracker Major
@fluid-example/inventory-app Major
@fluid-example/app-integration-external-controller Major
@fluid-example/shared-tree-demo Major
@fluid-example/bundle-size-tests Major
@fluid-example/attributable-map Major
@fluid-example/collaborative-textarea Major
@fluid-example/contact-collection Major
@fluid-example/data-object-grid Major
@fluid-example/task-selection Major
@fluid-example/tree-comparison Major
@fluid-example/codemirror Major
@fluid-example/multiview-container Major
@fluid-example/prosemirror Major
@fluid-example/smde Major
@fluid-example/table-document Major
@fluid-example/todo Major
@fluid-example/webflow Major
@fluid-example/app-integration-external-data Major
@fluid-example/example-utils Major
@fluid-example/webpack-fluid-loader Major
@fluid-example/app-integration-live-schema-upgrade Major
@fluid-example/version-migration-same-container Major
@fluid-example/app-integration-schema-upgrade Major
@fluid-example/tree-shim Major
@fluid-example/app-integration-container-views Major
@fluid-example/app-integration-external-views Major
@fluid-example/view-framework-sampler Major
@fluid-example/property-inspector Major
@fluid-experimental/property-dds Major
@fluid-experimental/attributable-map Major
@fluid-experimental/tree Major
@fluid-experimental/last-edited Major
@fluidframework/map Major
@fluidframework/matrix Major
@fluidframework/merge-tree Major
@fluidframework/ordered-collection Major
@fluidframework/sequence Major
@fluidframework/shared-object-base Major
@fluid-private/test-dds-utils Major
@fluidframework/tree Major
@fluidframework/agent-scheduler Major
@fluidframework/aqueduct Major
@fluid-experimental/attributor Major
@fluid-experimental/data-object-base Major
@fluidframework/fluid-static Major
@fluidframework/request-handler Major
@fluidframework/synthesize Major
@fluidframework/container-runtime Major
@fluidframework/datastore Major
@fluidframework/test-runtime-utils Major
@fluidframework/azure-client Major
@fluidframework/tinylicious-client Major
@fluid-internal/local-server-tests Major
@fluid-private/test-end-to-end-tests Major
@fluid-internal/test-service-load Major
@fluidframework/test-utils Major
@fluid-internal/devtools-browser-extension Major
@fluid-example/devtools-example Major
@fluid-internal/replay-tool Major
@fluid-example/bubblebench-baseline Major
@fluid-example/bubblebench-experimental-tree Major
@fluid-example/bubblebench-ot Major
@fluid-example/bubblebench-shared-tree Major
@fluid-example/app-insights-logger Major
@fluid-example/canvas Major
@fluid-example/clicker Major
@fluid-example/diceroller Major
@fluid-example/monaco Major
@fluid-example/multiview-coordinate-interface Major
@fluid-experimental/property-binder Major
@fluid-experimental/property-inspector-table Major
@fluid-example/bubblebench-common Major
@fluid-internal/functional-tests Major
@fluid-experimental/azure-scenario-runner Major
@fluid-example/multiview-constellation-model Major
@fluid-example/multiview-coordinate-model Major
@fluid-experimental/data-objects Major
@fluid-experimental/dds-interceptions Major
@fluidframework/undo-redo Major
@fluidframework/azure-end-to-end-tests Major
@fluid-experimental/odsp-end-to-end-tests Major
@fluidframework/odsp-client Major
@fluid-internal/test-snapshots Major
@fluid-private/test-version-utils Major
@fluidframework/devtools-core Major
@fluid-internal/tablebench Major
@fluid-experimental/sequence-deprecated Major
@fluid-experimental/ot Major
@fluid-experimental/sharejs-json1 Major
@fluid-experimental/tree-react-api Major
@fluidframework/cell Major
@fluidframework/counter Major
@fluid-experimental/ink Major
@fluid-experimental/pact-map Major
@fluidframework/register-collection Major
@fluidframework/shared-summary-block Major
@fluidframework/task-manager Major
@fluid-internal/devtools-view Major
@fluid-experimental/oldest-client-observer Major
@fluid-experimental/property-shared-tree-interop Major
@fluidframework/fluid-telemetry Major
@fluidframework/fluid-runner Major
@fluidframework/devtools Major
@fluid-tools/fetch-tool Major
@fluid-private/test-drivers Major
@fluid-example/multiview-constellation-view Major
@fluid-example/multiview-plot-coordinate-view Major
@fluid-example/multiview-slider-coordinate-view Major
@fluid-example/multiview-triangle-view Major
@fluid-example/odspsnapshotfetch-perftestapp Major
@fluid-example/schemas Major
@fluid-experimental/property-changeset Major
@fluid-experimental/property-common Major
@fluid-experimental/property-properties Major
@fluid-experimental/property-proxy Major
@fluid-experimental/property-query Major
@fluid-internal/platform-dependent Major
@fluid-internal/client-utils Major
@fluid-internal/mocha-test-setup Major
@fluid-internal/test-app-insights-logger Major
@fluid-internal/test-driver-definitions Major
@fluid-private/test-loader-utils Major
@fluid-private/stochastic-test-utils Major
@fluid-private/test-pairwise-generator Major
@fluid-private/changelog-generator-wrapper Major
@fluid-tools/markdown-magic Major
@fluidframework/azure-local-service Major
@fluidframework/azure-service-utils Major
@fluidframework/container-definitions Major
@fluidframework/core-interfaces Major
@fluidframework/core-utils Major
@fluidframework/driver-definitions Major
@fluidframework/debugger Major
@fluidframework/driver-base Major
@fluidframework/driver-web-cache Major
@fluidframework/file-driver Major
@fluidframework/local-driver Major
@fluidframework/odsp-driver-definitions Major
@fluidframework/odsp-driver Major
@fluidframework/odsp-urlresolver Major
@fluidframework/replay-driver Major
@fluidframework/routerlicious-driver Major
@fluidframework/routerlicious-urlresolver Major
@fluidframework/tinylicious-driver Major
@fluidframework/app-insights-logger Major
@fluidframework/container-loader Major
@fluidframework/driver-utils Major
@fluidframework/container-runtime-definitions Major
@fluidframework/datastore-definitions Major
@fluidframework/id-compressor Major
@fluidframework/runtime-definitions Major
@fluidframework/odsp-doclib-utils Major
@fluidframework/telemetry-utils Major
@fluidframework/tool-utils Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: runtime Runtime related issues changeset-present dependencies Pull requests that update a dependency file public api change Changes to a public API base: main PRs targeted against main branch labels Jul 25, 2024
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Jul 25, 2024

@fluid-example/bundle-size-tests: +245 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 457.99 KB 458.02 KB +35 Bytes
azureClient.js 555.23 KB 555.28 KB +49 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 258.67 KB 258.68 KB +14 Bytes
fluidFramework.js 408.62 KB 408.63 KB +14 Bytes
loader.js 134.04 KB 134.05 KB +14 Bytes
map.js 42.13 KB 42.14 KB +7 Bytes
matrix.js 146.41 KB 146.42 KB +7 Bytes
odspClient.js 523.37 KB 523.42 KB +49 Bytes
odspDriver.js 97.55 KB 97.57 KB +21 Bytes
odspPrefetchSnapshot.js 42.61 KB 42.62 KB +14 Bytes
sharedString.js 163.13 KB 163.14 KB +7 Bytes
sharedTree.js 399.13 KB 399.14 KB +7 Bytes
Total Size 3.3 MB 3.3 MB +245 Bytes

Baseline commit: fd06b93

Generated by 🚫 dangerJS against 881fefc

@@ -56,6 +56,8 @@ export type {
FluidObjectProviderKeys, // Used by FluidObject
} from "@fluidframework/core-interfaces";

export type { isFluidHandle } from "@fluidframework/runtime-utils";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new export source for fluid-framework. @Josmithr do we need to make other config changes to ensure the docs are built correctly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope :) API-Extractor in this package is configured to bundle all @fluidframework packages automatically (assuming they are correctly declared as a direct dependency, which this now is).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case you can tell because the actual declaration ends up in the API reports in this package, rather than appearing as a re-export from an external package.

@Josmithr Josmithr requested a review from a team July 26, 2024 17:06
@@ -1818,130 +1818,6 @@ importers:
specifier: ^5.8.0
version: 5.10.0

examples/benchmarks/bubblebench/shared-tree-flex-tree:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: These changes seem unrelated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like they are from a PR I did the other day, where I removed the shared-tree-flex-tree package. So this is probably good to check in. Is there something I need to do besides run pnpm i in order to regenerate the pnpm-lock? I thought that running pnpm i would have done this for me, but I'm pretty sure I ran pnpm i and it did not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want the lock file to update, you need to run pnpm i --no-frozen-lockfile now. That said if doing so would make a change, I'd expect pnpm i to error and tell you that,. I guess maybe there is some subset of changes which would update, but doesn't error?

@CraigMacomber CraigMacomber enabled auto-merge (squash) July 26, 2024 19:37
@CraigMacomber CraigMacomber merged commit 7827d10 into microsoft:main Jul 26, 2024
30 checks passed
@CraigMacomber CraigMacomber deleted the PublicisFluidHandle branch July 27, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: runtime Runtime related issues base: main PRs targeted against main branch changeset-present dependencies Pull requests that update a dependency file public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants