live-share-sdk

A framework for building collaborative Microsoft Teams and M365 experiences.

OTHER License

Downloads
14.6K
Stars
95
Committers
15
live-share-sdk - Release v1.4.0 Latest Release

Published by ryanbliss 9 months ago

What's Changed

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.3.1...v1.4.0

live-share-sdk - Release v1.3.1

Published by ryanbliss 9 months ago

What's Changed

  • Add canSendBackgroundUpdates check on initial background presence update to prevent sending initial update on .initialize() when background updates are disabled.
  • Fixed suspensions not working when canSendPositionUpdates is false.
  • Added enableBackgroundUpdates option for each instance LiveObjectSynchronizer and refactored connect event from LiveMediaSession to use LiveObjectSynchronizer to reduce redundant signals.

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.3.0...v1.3.1

live-share-sdk - Release v1.3.0

Published by ryanbliss 9 months ago

What's Changed

  • Renamed getLiveContainerSchemaProxy to getLiveContainerSchema
  • Overhaul for error messages across the board
  • Improved typedocs for some of our APIs

Live Share Media

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.2.2...v1.3.0

live-share-sdk - Release v1.2.2

Published by ryanbliss about 1 year ago

What's Changed

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.2.1...v1.2.2

live-share-sdk - Release v1.2.1

Published by ryanbliss about 1 year ago

What's Changed

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.2.0...v1.2.1

live-share-sdk - v1.2.0 release

Published by ryanbliss about 1 year ago

@microsoft/live-share

Warning

This update changed props of LiveShareRuntime constructor. This isn't something we expect external developers to use in normal circumstances, but it is technically a public class. If you use this and used some of the optional props in the constructor (non-normative), this will be a breaking change for you. Normally we wouldn't make a breaking change to a public class, but these optional props for the constructor were really only added for our unit tests, and this class is publicly exposed primarily for use in live-share-turbo. But in the off chance this does impact you, we are attaching a guide here for your convenience.

To fix this, change this:

// Create your host, such as AzureLiveShareHost
const host = AzureLiveShareHost.create();
// Create your timestampProvider (optional)
const timestampProvider = new CustomTimestampProvider();
// Create your role verifier (optional)
const roleVerifier = new CustomRoleVerifier();
// Create the LiveShareRuntime
const runtime = new LiveShareRuntime(this._host, timestampProvider, roleVerifier);

To this:

// Create your host, such as AzureLiveShareHost
const host = AzureLiveShareHost.create();
// Create your options (optional)
const options = {
  timestampProvider: new CustomTimestampProvider(),
  roleVerifier: new CustomRoleVerifier(),
};
// Create the LiveShareRuntime
const runtime = new LiveShareRuntime(this._host, options);

@microsoft/live-share-react

@microsoft/live-share-turbo

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.1.0...v1.2.0

live-share-sdk - v1.1.0 release

Published by ryanbliss about 1 year ago

What's Changed

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.0.2...v1.1.0

live-share-sdk - v1.0.2 release

Published by ryanbliss about 1 year ago

This update includes a critical bug fix for Android devices, which was causing role verification and LivePresence to fail in some cases. If you are running into any issues, please update immediately.

What's Changed

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.0.1...v1.0.2

live-share-sdk - v1.0.1 release

Published by ryanbliss over 1 year ago

What's Changed

This is a minor patch release with bug fixes and additional flexibility.

live-share-media (1.0.1)

live-share-react (1.0.1-preview.1)

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.0.0...v1.0.1

live-share-sdk - v1.0.0 release - Live Share is generally available!

Published by ryanbliss over 1 year ago

What's changed

Live Share is officially generally available! This means Microsoft can now recommend for production scenarios. We have published the v1.0.0 version of @microsoft/live-share, @microsoft/live-share-media, and @microsoft/live-share-canvas to npm. Since we use semantic versioning, this means that we are committed to no breaking changes to our interfaces until our next major release (2.0.0).

Our general availability comes with the following officially supported LiveDataObject classes:

  • LivePresence
  • LiveState
  • LiveTimer
  • LiveEvent
  • LiveMediaSession
  • LiveCanvas

For those still using our Preview versions of the SDK, please refer to previous release notes for guides on how to upgrade. A lot of APIs were renamed, removed, or reworked (for example, updatePresence was renamed to update in LivePresence, and now returns Promise<void> instead of void). If you need any help, feel free to ask us questions in our discussion board.

Our general availability has been a long time coming, and we're so excited to see what apps you release in the coming months.

Changes from this release (compared to preview.23)

  • userId, clientId, state, and data were replaced with a localUser getter in LivePresence.
  • We have updated our license to reflect our general availability.

Known issues

  • When using the teams-js LiveShareHost, LivePresenceUser's displayName field will currently show as undefined. This will change in the next week or two once the Teams desktop client completes its May rollout.
  • Similar to above, the userId of LivePresenceUser will temporarily be equal to clientId. This will be replaced with a real userId once the Teams desktop client completes its May rollout.
  • Guest users in calendar & meet now meetings (aka "anonymous" users) will not be supported until the Teams desktop client completes its May rollout.
  • Guest users in channel meetings are not yet supported.
  • Like other Teams platform capabilities, Live Share does not yet support "the new Teams", with availability planned for later this summer.

Live Share Turbo and React previews

While the three packages mentioned above are generally available, live-share-turbo and live-share-react remain in preview. Those are published as as version 1.0.0-preview.24. We will keep the minor versions in sync with the core SDK versions (e.g., 1.0.1 of live-share will be released as 1.0.1-preview.1 of live-share-react). We hope to make those packages generally available in the coming months, so please give it a try and let us know what you think!

Commits since last release notes

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.0.0-preview.15...v1.0.0

live-share-sdk - v1.0.0-preview.15 release - includes breaking changes!!!

Published by ryanbliss over 1 year ago

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
live-share-sdk - v1.0.0-preview.12 release - major features, major breaking changes!!!

Published by ryanbliss over 1 year ago

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: https://github.com/microsoft/live-share-sdk/compare/v1.0.0-preview.10...v1.0.0-preview.12

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

Published by ryanbliss over 1 year ago

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
live-share-sdk - 1.0.0-preview.9, TypeScript error for teams-js versions ^2.10.1

Published by ryanbliss over 1 year ago

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.

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

Published by ryanbliss over 1 year ago

What's Changed

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

Full Changelog: https://github.com/microsoft/live-share-sdk/compare/v1.0.0-preview.7...v1.0.0-preview.8

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

Published by ryanbliss over 1 year ago

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.

live-share-sdk - v1.0.0-preview.1

Published by ryanbliss about 2 years ago

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