Skip to content

Bump fluid-framework from 1.4.0 to 2.91.0 in /packages/live-share-canvas#839

Open
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/packages/live-share-canvas/fluid-framework-2.91.0
Open

Bump fluid-framework from 1.4.0 to 2.91.0 in /packages/live-share-canvas#839
dependabot[bot] wants to merge 1 commit intomainfrom
dependabot/npm_and_yarn/packages/live-share-canvas/fluid-framework-2.91.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Mar 23, 2026

Bumps fluid-framework from 1.4.0 to 2.91.0.

Release notes

Sourced from fluid-framework's releases.

Fluid Framework v2.91.0 (minor)

Contents

  • ✨ New Features
    • [Adds withDefault API to allow defining default values for required and optional fields (#26502)](#user-content-adds-withdefault-api-to-allow-defining-default-values-for-required-and-optional-fields-26502)

✨ New Features

Adds withDefault API to allow defining default values for required and optional fields (#26502)

The withDefault API is now available on SchemaFactoryAlpha. It allows you to specify default values for fields, making them optional in constructors even when the field is marked as required in the schema. This provides a better developer experience by reducing boilerplate when creating objects.

The withDefault API wraps a field schema and defines a default value to use when the field is not provided during construction. The default value must be of an allowed type of the field. You can provide defaults in two ways:

  • A value: When a value is provided directly, the data is copied for each use to ensure independence between instances
  • A generator function: A function that is called each time to produce a fresh value

Defaults are evaluated eagerly during node construction.

Required fields with defaults

import { SchemaFactoryAlpha, TreeAlpha } from "@fluidframework/tree/alpha";
const sf = new SchemaFactoryAlpha("example");
class Person extends sf.objectAlpha("Person", {
name: sf.required(sf.string),
age: sf.withDefault(sf.required(sf.number), -1),
role: sf.withDefault(sf.required(sf.string), "guest"),
}) {}
// Before: all fields were required
// const person = new Person({ name: "Alice", age: -1, role: "guest" });
// After: fields with defaults are optional
const person = new Person({ name: "Alice" });
// person.age === -1
// person.role === "guest"
// You can still provide values to override the defaults
const admin = new Person({ name: "Bob", age: 30, role: "admin" });

Optional fields with custom defaults

Optional fields (sf.optional) already default to undefined, but withDefault allows you to specify a different default value:

... (truncated)

Changelog

Sourced from fluid-framework's changelog.

2.91.0

Minor Changes

  • Adds withDefault API to allow defining default values for required and optional fields (#26502) 44fdd9421e4

    The withDefault API is now available on SchemaFactoryAlpha. It allows you to specify default values for fields, making them optional in constructors even when the field is marked as required in the schema. This provides a better developer experience by reducing boilerplate when creating objects.

    The withDefault API wraps a field schema and defines a default value to use when the field is not provided during construction. The default value must be of an allowed type of the field. You can provide defaults in two ways:

    • A value: When a value is provided directly, the data is copied for each use to ensure independence between instances
    • A generator function: A function that is called each time to produce a fresh value

    Defaults are evaluated eagerly during node construction.

    Required fields with defaults

    import { SchemaFactoryAlpha, TreeAlpha } from "@fluidframework/tree/alpha";
    const sf = new SchemaFactoryAlpha("example");
    class Person extends sf.objectAlpha("Person", {
    name: sf.required(sf.string),
    age: sf.withDefault(sf.required(sf.number), -1),
    role: sf.withDefault(sf.required(sf.string), "guest"),
    }) {}
    // Before: all fields were required
    // const person = new Person({ name: "Alice", age: -1, role: "guest" });
    // After: fields with defaults are optional
    const person = new Person({ name: "Alice" });
    // person.age === -1
    // person.role === "guest"
    // You can still provide values to override the defaults
    const admin = new Person({ name: "Bob", age: 30, role: "admin" });

    Optional fields with custom defaults

    Optional fields (sf.optional) already default to undefined, but withDefault allows you to specify a different default value:

    class Config extends sf.object("Config", {
      timeout: sf.withDefault(sf.optional(sf.number), 5000),

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Mar 23, 2026
Bumps [fluid-framework](https://github.com/microsoft/FluidFramework/tree/HEAD/packages/framework/fluid-framework) from 1.4.0 to 2.91.0.
- [Release notes](https://github.com/microsoft/FluidFramework/releases)
- [Changelog](https://github.com/microsoft/FluidFramework/blob/main/packages/framework/fluid-framework/CHANGELOG.md)
- [Commits](https://github.com/microsoft/FluidFramework/commits/client_v2.91.0/packages/framework/fluid-framework)

---
updated-dependencies:
- dependency-name: fluid-framework
  dependency-version: 2.91.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/packages/live-share-canvas/fluid-framework-2.91.0 branch from 14d34fa to 6c2b198 Compare April 2, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants