Skip to content

Conversation

@milanro
Copy link
Collaborator

@milanro milanro commented Feb 16, 2023

Description

This is the initial implementation of the schema converter from Property DDS schema to SharedTree LLS schema.
It is based on the code at
https://github.com/sharptrip/FluidFramework/blob/editable-tree-inspector-with-transaction-handling/experimental/PropertyDDS/examples/schemas/src/schemaConverter.ts

Following are the changes and additions to the original code

Fields are never merged

Two fields of the Array context are not merged to one Empty Key field with both type1 and type2 instances possible. All fields are generated in the LLS schema as they were present in PDDS schema

        "filed1": {"kind": "Value", "types": ["array<Type1-1.0.0>"]},
        "field2": {"kind": "Value", "types": ["array<Type2-1.0.0>"]},

Enums

Enums are supported and converted to the type Enum which is the node containing the number value as follows

    "Enum": {
      "localFields": {},
      "globalFields": [],
      "extraLocalFields": {"kind": "Forbidden", "types": []},
      "extraGlobalFields": false,
      "value": 1
    }

OO Inheritance

Inheritance within the class hierarchy is covered by union of types. For example, if we have the types Ext2-1.0.0 inherits from Ext1-1.0.0 inherits from Base-1.0.0 and the Base is configured for the property fieldWithInherits, we get following schema structure

        "fieldWithInherits": {
          "kind": "Value",
          "types": [
            "Base-1.0.0",
            "Ext1-1.0.0",
            "Ext2-1.0.0"
          ]
        }

Review Notes

Reviewers:
@dstanesc @sharptrip @ruiterr

@sharptrip sharptrip mentioned this pull request Feb 17, 2023
milanro pushed a commit that referenced this pull request Mar 29, 2023
## Description
Currently tinylicious fails to run sample scenarios in the [Share Live
Repo](https://github.com/microsoft/live-share-sdk)
2 interesting commits: 
a) [Update deps (minor) on server release group in tinylicious (microsoft#14586)
· microsoft/FluidFramework@12b3f4c
(github.com)](microsoft@12b3f4c#diff-18fce4d66a0b908f502bc635b1c1377557fd7ec4f8d9df8dcaa4d9c261158ca9))

Throws when  getTenantGitManager is invoked. 

2) [Separate api for getting tenant gitManager. (microsoft#14290) ·
microsoft/FluidFramework@d368f26
(github.com)](microsoft@d368f26#diff-deeaa88a2f939b81094f7412e1482709a59c4c47850a5c379c92aef0b78d70d5))
Moved the call when creating the document from getTenant to
getTenantGitManager and I'm not sure if it applies to tinylicious but it
is consumed by it.

This PR is trying to revert the current behavior by keeping changes #2
and not throwing on #1

Repro steps: 
a) Clone https://github.com/microsoft/live-share-sdk

b) Follow instructions from the Readme to install  (I had to also
install vite as it was failing without it)

c) Simply try to run one of the samples (I'm using
samples\javascript\03.live-canvas-demo\) http://localhost:3000/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants