Releases: microsoft/live-share-sdk
v1.0.0-preview.15 release - includes breaking changes!!!
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()
andpresence.forEach()
, in favor of a more standardpresence.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 allLiveDataObject
instances when joining a container as a non-static reference. getLiveShareContainerSchemaProxy
API for injecting theLiveDataObject
withliveRuntime
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 eachLiveDataObject
used. That allows you to have differentLiveShareRuntime
instances for each container, should you have multiple (useful for unit testing, for example).- Moved
LiveShareClient.getTimestamp()
toLiveShareRuntime
, if usingLiveShareClient.getTimestamp()
in your app, please use the newtimestampProvider
which is returned when callingjoinContainer
onLiveShareClient
. - Moved
LiveShareClient.verifyRolesAllowed()
toLiveShareRuntime
- Moved
LiveShareClient.getClientRoles()
toLiveShareRuntime
- Moved
LiveShareClient.setTimestampProvider()
toLiveShareRuntime
- Moved
LiveShareClient.setRoleVerifier()
toLiveShareRuntime
- Updated unit tests to use the
LiveShareRuntime
AzureLiveShareHost
- Implemented new
AzureLiveShareHost
class, which allows developers usingAzureClient
withoutLiveShareClient
to still useLiveDataObject
instances. - This work was done in particular so that
LivePresence
andLiveCanvas
can still be used now thatdisplayName
is set by default. It usesIAzureAudience
to still securely getdisplayName
anduserId
from the AFR token. - Updated
AzureTurboClient
to do this by default usinggetLiveShareContainerSchemaProxy
, 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 bothLiveEventScope
andLiveObjectSynchronizer
, 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 toregisterClientId("fakeId")
even if we had a valid error (which is what we expect) forfakeId
. 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
andLiveShareHostDecorator
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 nonError
type promise rejections (e.g.,SdkError
from teams-js). This allowed me to fix the above bug while also greatly simplifying thewaitForResult
implementations in our host decorators. - Fixed many duplicate warnings being logged if the
BackwardsCompatibilityHostDecorator
polyfill was being used forgetClientInfo
- Fixed bug where
isTesting
inLiveShareClient
would be false if usingTestLiveShareHost
. - Fixed bug #497
- Other improvements & bug fixes
v1.0.0-preview.12 release - major features, major breaking changes!!!
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 acceptsuserId
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 withLivePresence
, then you can simply include it in the optional customdata
object. - Fixed a security gap in
LivePresence
which made it possible to "hijack" another user'sLivePresenceUser
record simply by claiming theiruserId
. LivePresenceUser
now includes adisplayName
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 usersdisplayName
field will appear asundefined
. 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 aroles
field, which replaces the asynchronousgetRoles()
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 thegetRoles()
API, this is a breaking change. Replaceawait user.getRoles()
withuser.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
'supdatePresence()
method was deprecated in favor ofupdate()
. This is more aligned with our other DDS naming. We've had feedback thatdata
is more commonly set than thestate
prop, so in this new method the order goesupdate(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 inLivePresence
, such asconst 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 aspeerDependencies
. If this results in a build error for your application, please include those dependencies in yourdependencies
within yourpackage.json
. LiveEvent
'ssendEvent()
method was deprecated in favor ofsend()
, which is more aligned with other DDS naming.LiveEvent.setTimestampProvider()
andLiveEvent.setRoleVerifier()
were moved toLiveShareClient
. 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 aspeerDependencies
. If this results in a build error for your application, please include those dependencies in yourdependencies
within yourpackage.json
. LiveCanvas
now supports un-spoofable names in cursors by default.- The
onGetLocalUserInfo(): IUserInfo | undefined
method inLiveCanvas
was replaced withonGetLocalUserPictureUrl(): string | undefined
. - For apps using
LiveCanvas
in a regular Fluid container (e.g., not usingLiveShareClient
), this will result in thedisplayName
appearing as the first 4 characters of the user'sclientId
. 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 aspeerDependencies
. If this results in a build error for your application, please include those dependencies in yourdependencies
within yourpackage.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 aspeerDependencies
. If this results in a build error for your application, please include those dependencies in yourdependencies
within yourpackage.json
. userId
is no longer a prop inuseLivePresence
.updatePresence
callback returned byuseLivePresence
now hasdata
as first prop andstate
as second prop, to align with newLivePresence
changes.localUserCursor
prop was replaced withlocalUserProfilePictureUrl
.
@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 aspeerDependencies
. If this results in a build error for your application, please include those dependencies in yourdependencies
within yourpackage.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 yourpackage.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 auserId
equal to theirclientId
. 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
- RoleVerifier and LivePresence v2 by @huntj88 in #516
- v1.0.0 preview.12 release by @ryanbliss in #557
Full Changelog: v1.0.0-preview.10...v1.0.0-preview.12
v1.0.0-preview.10, LiveState revamp & bug fixes
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 usingLiveState.initialize()
- Fixed bug where
localUserCursor
prop in Live Share React'suseLiveCanvas
hook was not properly setting changes
1.0.0-preview.9, TypeScript error for teams-js versions ^2.10.1
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
What's Changed
- Add export/import support of raw strokes and export as SVG to
InkingManager
, and improved framerate of cursor movements inLiveCanvas
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
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
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
toLiveShareClient
- Added
LiveShareHost
interface as parameter when initializingLiveShareClient
to override default behavior in Microsoft Teams container management, shared clock, etc. - Renamed
EphemeralPresence
toLivePresence
- Renamed
EphemeralEvent
toLiveEvent
- Renamed
EphemeralState
toLiveState
- Renamed
EphemeralTimer
toLiveTimer
- Added public
testLiveShare
namespace for joining a container locally in a browser
Changes to @microsoft/live-share-media
Major changes
- Renamed
EphemeralMediaSession
toLiveMediaSession
- Renamed
EphemeralMediaSessionCoordinator
toLiveMediaSessionCoordinator
- Renamed
VolumeLimiter
toVolumeManager
VolumeManager
now hasstartLimiting
andstopLimiting
to more closely align with modeling of teams-js API forregisterSpeakingStateChangeHandler
VolumeManager
renamedlevel
tolimitLevel
VolumeManager
renamedlimitType
tolimitLevelType
VolumeManager
now supports setting the user selected volume with avolume
property for compatibility with volume sliders. When limiting ends, the user is returned back to the setvolume
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