LionWeb-io / lionweb-typescript

Implements (select parts of) the LionWeb specification, and tooling around that - all in TypeScript.
Apache License 2.0
10 stars 4 forks source link

Support deserialization of sub-trees and not just entire partitions #145

Closed ftomassetti closed 3 months ago

ftomassetti commented 3 months ago

I think this should be changed to support deserializing subtrees:

https://github.com/LionWeb-io/lionweb-typescript/blob/8e6b058c38fe8b8eb5942c7702122eba613bf826/packages/core/src/deserializer.ts#L48

We recently encountered the very same problem in lioncore-java where we had the same logic. The problem is that in this way we are only able to deserialize entire partitions, but nothing below them.

See https://github.com/LionWeb-io/lionweb-java/pull/132 for comparison

dslmeinte commented 3 months ago

So, we should

?

ftomassetti commented 3 months ago

Yes, I would do that. In Java we can define the three options:

Of these, I think that the only option that makes sense in most cases is setting the parent to null

dslmeinte commented 3 months ago

At this point, I wouldn't really do anything too configurable in the TS-space, so I'd simply set things to null.

dslmeinte commented 3 months ago

Fixed by PR #148