Skip to content

Releases: microsoft/live-share-sdk

v1.0.0-preview.15 release - includes breaking changes!!!

13 May 05:06
07ab6e9
Compare
Choose a tag to compare

We will stop making breaking changes to minor and patch versions for @microsoft/live-share, @microsoft/live-share-media, and @microsoft/live-share-canvas on May 24th, 2023. Thanks for your patience as we prepare for this major release!

LivePresence

  • Created LivePresence Connections api enabling viewing PresenceState and data on a per connection basis.
  • Removed presence.toArray() and presence.forEach(), in favor of a more standard presence.getUsers() API.
  • Changed .update() to be an async method. This will now throw an error if the local user does not have the required roles.

LiveState

  • Changed .set() to be an async method. This will now throw an error if the local user does not have the required roles.

LiveTimer

  • Changed .start(), play(), etc. to be async methods. This will now throw an error if the local user does not have the required roles.

LiveEvent

  • Changed .send() to be async. This will now throw an error if the local user does not have the required roles.

MediaPlayerSynchronizer & LiveMediaSessionCoordinator

  • Changed .play(), pause(), etc. to be async methods. This will now throw an error if the local user does not have the required roles.

LiveShareRuntime

  • Created new LiveDataObject abstract class from which all Live Share DDS's now extend
  • Created new LiveShareRuntime class which is injected into all LiveDataObject instances when joining a container as a non-static reference.
  • getLiveShareContainerSchemaProxy API for injecting the LiveDataObject with liveRuntime into the static Fluid factories. Even though these factories & constructors are static, this is done in a way such that each Fluid container gets a separate proxy class for each LiveDataObject used. That allows you to have different LiveShareRuntime instances for each container, should you have multiple (useful for unit testing, for example).
  • Moved LiveShareClient.getTimestamp() to LiveShareRuntime, if using LiveShareClient.getTimestamp() in your app, please use the new timestampProvider which is returned when calling joinContainer on LiveShareClient.
  • Moved LiveShareClient.verifyRolesAllowed() to LiveShareRuntime
  • Moved LiveShareClient.getClientRoles() to LiveShareRuntime
  • Moved LiveShareClient.setTimestampProvider() to LiveShareRuntime
  • Moved LiveShareClient.setRoleVerifier() to LiveShareRuntime
  • Updated unit tests to use the LiveShareRuntime

AzureLiveShareHost

  • Implemented new AzureLiveShareHost class, which allows developers using AzureClient without LiveShareClient to still use LiveDataObject instances.
  • This work was done in particular so that LivePresence and LiveCanvas can still be used now that displayName is set by default. It uses IAzureAudience to still securely get displayName and userId from the AFR token.
  • Updated AzureTurboClient to do this by default using getLiveShareContainerSchemaProxy, mostly to give partners depending on this change an example they can reference.

LiveObjectSynchronizer

  • Refactored LiveObjectSynchronizer to be centralized without static properties, enabling pre-send validation of roles, removed the requirement to have both LiveEventScope and LiveObjectSynchronizer, and significantly reduced the amount of "connect" events being sent. This significantly reduce the performance of our backend service.

Other changes

  • Fixed bug #563
  • In testing the AzureLiveShareHost, I found out that the backwards-compat decorator would try to registerClientId("fakeId") even if we had a valid error (which is what we expect) for fakeId. I improved that behavior so that valid rejections (ideal behavior for "fakeId") are promptly returned w/o extra requests.
  • Fixed a bug with the BackwardsCompatibilityHostDecorator and LiveShareHostDecorator that caused the polyfill to be used when it shouldn't.
  • Made waitForResult util more flexible for better type validation, ability to have valid undefined results, ability to transform results, the ability to bypass the retry schedule for certain non-timeout error responses, and the ability to handle non Error type promise rejections (e.g., SdkError from teams-js). This allowed me to fix the above bug while also greatly simplifying the waitForResult implementations in our host decorators.
  • Fixed many duplicate warnings being logged if the BackwardsCompatibilityHostDecorator polyfill was being used for getClientInfo
  • Fixed bug where isTesting in LiveShareClient would be false if using TestLiveShareHost.
  • Fixed bug #497
  • Other improvements & bug fixes

v1.0.0-preview.12 release - major features, major breaking changes!!!

04 May 16:20
769edb3
Compare
Choose a tag to compare

What's Changed

This is a big change which includes breaking changes and some exciting new features. This release makes the final set of major changes before our v1.0.0 release this May.

@microsoft/live-share changes

LivePresence & role verification changes

  • The LivePresence initialize() function no longer accepts userId as the first prop, which will be a breaking change for apps that use this class in their applications. To fix this issue, remove this prop. If you still want to broadcast a custom userId with LivePresence, then you can simply include it in the optional custom data object.
  • Fixed a security gap in LivePresence which made it possible to "hijack" another user's LivePresenceUser record simply by claiming their userId.
  • LivePresenceUser now includes a displayName field. For now, this field will only be populated up to Teams Developer Preview, but will be generally available by May 24th. Until then, regular Teams users displayName field will appear as undefined. This display name is un-spoofable, making it ideal for sensitive situations where you want accountability & visibility into whom is taking what action in your app.
  • LivePresenceUser now has a roles field, which replaces the asynchronous getRoles() API. This should make it easier to know which user has what role, without the additional complexity caused by that async API. For apps using the getRoles() API, this is a breaking change. Replace await user.getRoles() with user.roles.
  • When a participant's UserMeetingRole changes, that will now be updated in our cache much faster than before. The role cache is set to expire every 4 seconds.
  • LivePresence's updatePresence() method was deprecated in favor of update(). This is more aligned with our other DDS naming. We've had feedback that data is more commonly set than the state prop, so in this new method the order goes update(data?: TData, state?: PresenceState). The old API will continue to work until we remove it in v1.0.0.
  • You can now add a filter to the .toArray() method in LivePresence, such as const onlineUsers = presence.toArray(PresenceState.online).

Other changes

  • We changed our dependency model so that you will have more flexibility with what Fluid Framework version you use. To accomplish this, we have moved fluid-framework: ^1.2.3 and @fluidframework/azure-client: ^1.0.0 in as peerDependencies. If this results in a build error for your application, please include those dependencies in your dependencies within your package.json.
  • LiveEvent's sendEvent() method was deprecated in favor of send(), which is more aligned with other DDS naming.
  • LiveEvent.setTimestampProvider() and LiveEvent.setRoleVerifier() were moved to LiveShareClient. If you use these static methods in your application, this will be a breaking change.

@microsoft/live-share-canvas changes

  • We changed our dependency model so that you will have more flexibility with what Fluid Framework version you use, as well as to avoid issues from conflicting dependencies. To accomplish this, we have moved fluid-framework: ^1.2.3 and @microsoft/live-share: 1.0.0-preview.12 in as peerDependencies. If this results in a build error for your application, please include those dependencies in your dependencies within your package.json.
  • LiveCanvas now supports un-spoofable names in cursors by default.
  • The onGetLocalUserInfo(): IUserInfo | undefined method in LiveCanvas was replaced with onGetLocalUserPictureUrl(): string | undefined.
  • For apps using LiveCanvas in a regular Fluid container (e.g., not using LiveShareClient), this will result in the displayName appearing as the first 4 characters of the user's clientId. We are working on a workaround for this that we will release before our v1.0.0 release.

@microsoft/live-share-media

  • We changed our dependency model so that you will have more flexibility with what Fluid Framework version you use, as well as to avoid issues from conflicting dependencies. To accomplish this, we have moved fluid-framework: ^1.2.3 and @microsoft/live-share: 1.0.0-preview.12 in as peerDependencies. If this results in a build error for your application, please include those dependencies in your dependencies within your package.json.

@microsoft/live-share-react

  • We changed our dependency model so that you will have more flexibility with what Fluid Framework version you use, as well as to avoid issues from conflicting dependencies. To accomplish this, we have moved fluid-framework: ^1.2.3, @fluidframework/azure-client: ^1.0.0, @microsoft/live-share: 1.0.0-preview.12, @microsoft/live-share-media: 1.0.0-preview.12, and @microsoft/live-share-canvas: 1.0.0-preview.12 in as peerDependencies. If this results in a build error for your application, please include those dependencies in your dependencies within your package.json.
  • userId is no longer a prop in useLivePresence.
  • updatePresence callback returned by useLivePresence now has data as first prop and state as second prop, to align with new LivePresence changes.
  • localUserCursor prop was replaced with localUserProfilePictureUrl.

@microsoft/live-share-turbo

  • We changed our dependency model so that you will have more flexibility with what Fluid Framework version you use, as well as to avoid issues from conflicting dependencies. To accomplish this, we have moved fluid-framework: ^1.2.3, @fluidframework/azure-client: ^1.0.0, and @microsoft/live-share: 1.0.0-preview.12 in as peerDependencies. If this results in a build error for your application, please include those dependencies in your dependencies within your package.json.

Workspace changes

  • We migrated from Lerna to NPM workspaces, which improves performance and reliability of our monorepo. We recommend deleting node_modules before you try to re-build any packages or samples.
  • To build only the packages, you can now run npm run:packages.

Known issues

  • You may encounter issues using Live Share with @fluidframework/azure-client version ^1.1.0 while using your app in Teams. This is because of a breaking change they released in that version. We have a server-side fix coming soon that will address this issue. Until then, you can use ~1.0.2 in your package.json.
  • Until our LivePresence dependencies are merged into the Teams client ahead of May 24th, regular Teams users (not in developer preview) will appear with a userId equal to their clientId. If they join from multiple devices, that means they will appear as separate users. This will be fixed automatically once our Teams client dependency becomes generally available.

Commits

Full Changelog: v1.0.0-preview.10...v1.0.0-preview.12

v1.0.0-preview.10, LiveState revamp & bug fixes

25 Apr 20:35
3bf32c1
Compare
Choose a tag to compare

We have revamped LiveState and useLiveState in this version due to developer feedback, and to accomplish this we had to make a breaking change. Rather than have separate state and data values in LiveState, there is now a single value.

If you are currently using LiveState in your application, here are the relevant changes:

// replace T with your type if in TypeScript, eg <string>
const yourLiveState = container.initialObjects.liveState as LiveState<T>;
// register listeners, now (state: T, local: boolean) instead of (state, value, local)
yourLiveState.on("stateChanged", (state, local) => {
  // handle change
});
// initialize LiveState with initial state (this previously was optional and didn't work)
// default value can be any JSON serializable value, such as string, number, object, etc.
await yourLiveState.initialize("your-default-value");
// when making changes, use `.set(state: T)` instead of `.changeState(state: string, data?: T)`
yourLiveState.set("your-new-value");

For Live Share React, similar to useSharedState, you can now simply do this:

// in TypeScript replace <T> with your type (eg string), otherwise delete <T>
const [liveState, setLiveState] = useLiveState<T>("key", "your-default-value");
return (
  {liveState}
);

Other changes include:

  • Fixed bug where initialState was not getting set when using LiveState.initialize()
  • Fixed bug where localUserCursor prop in Live Share React's useLiveCanvas hook was not properly setting changes

1.0.0-preview.9, TypeScript error for teams-js versions ^2.10.1

21 Apr 21:23
b26d590
Compare
Choose a tag to compare

Fixed a TypeScript compile error that was introduced as of @microsoft/teams-js version 2.10.1 and higher (published 2 weeks ago). If you are having issues, please upgrade your version of teams-js to 2.10.1 or higher, along with this release.

v1.0.0-preview.8, stroke import/export of raw strokes + SVG export

13 Apr 19:36
668ec11
Compare
Choose a tag to compare

What's Changed

  • Add export/import support of raw strokes and export as SVG to InkingManager, and improved framerate of cursor movements in LiveCanvas by @dclaux in #499
  • Increment version to v1.0.0-preview.8 by @ryanbliss in #500

To use this release, please update all Live Share packages to 1.0.0-preview.8 in your package.json file.

Full Changelog: v1.0.0-preview.7...v1.0.0-preview.8

v1.0.0-preview.7, new live-share-turbo & live-share-react packages

08 Apr 20:17
a0cbb6c
Compare
Choose a tag to compare

We are testing out a new version of Live Share called Live Share Turbo, or if you use React, Live Share React! Give it a try and let us know what you think.

If you run into any issues installing the latest version, make sure you are using version ^2.5.0 of @microsoft/teams-js. Also, if using Webpack, you may need to have @fluidframework/test-client-utils version ~1.2.3 in your devDependencies.

v1.0.0-preview.1

13 Oct 18:27
f3269d3
Compare
Choose a tag to compare
v1.0.0-preview.1 Pre-release
Pre-release

This release brings major breaking changes as we prepare to bring Live Share to v1.0.0. Please carefully review before updating your app.

Changes to @microsoft/live-share

Major changes

  • Renamed TeamsFluidClient to LiveShareClient
  • Added LiveShareHost interface as parameter when initializingLiveShareClient to override default behavior in Microsoft Teams container management, shared clock, etc.
  • Renamed EphemeralPresence to LivePresence
  • Renamed EphemeralEvent to LiveEvent
  • Renamed EphemeralState to LiveState
  • Renamed EphemeralTimer to LiveTimer
  • Added public testLiveShare namespace for joining a container locally in a browser

Changes to @microsoft/live-share-media

Major changes

  • Renamed EphemeralMediaSession to LiveMediaSession
  • Renamed EphemeralMediaSessionCoordinator to LiveMediaSessionCoordinator
  • Renamed VolumeLimiter to VolumeManager
  • VolumeManager now has startLimiting and stopLimiting to more closely align with modeling of teams-js API for registerSpeakingStateChangeHandler
  • VolumeManager renamed level to limitLevel
  • VolumeManager renamed limitType to limitLevelType
  • VolumeManager now supports setting the user selected volume with a volume property for compatibility with volume sliders. When limiting ends, the user is returned back to the set volume level.

Minor changes

  • Play/pause at zero seconds when in view only mode now properly blocks the action

New package: @microsoft/live-share-canvas

This was first released in v0.4.1, which we never prepared release notes for. This package allows applications to add turn-key inking and cursors in their UI. For more information, visit our concept docs at https://aka.ms/livesharecanvas, or try out any of the following samples:

  • 03.live-canvas-demo
  • 21.react-meda-template
  • 23.react-live-canvas