Skip to content

BHoM_Engine - Improved serialisation - #3631

Open
adecler wants to merge 11 commits into
developfrom
BHoM_Engine-#3618-ImprovedSerialisation
Open

adecler wants to merge 11 commits into
developfrom
BHoM_Engine-#3618-ImprovedSerialisation

Conversation

@adecler

@adecler adecler commented Oct 26, 2026

Copy link
Copy Markdown
Member

Issues addressed by this PR

Closes #3618

As mentioned in the issue, the solution in this PR focuses on two aspects:

  • Removing the dependency to assembly qualified names (they should not be found anywhere in the json)
  • Simplify the deserialisation of methods by removing the need to deserialise the types of the arguments.

There is a separate commit for each of those. Note that is is critical for the deserialisation to support both versions of the json to guarantee that the legacy json format is supported.

There are then two additional commits directly related:

  • Adding support for versioning of the new serialisation methods
  • Toggle to control whether the new serialisation is used or not. The chosen approach for now is to keep the legacy serialisation for a few milestones but with the dual deserialisation already merged. This way, we limit the risk of problems when someone saves a script with the new serialiser and shares it with a person that is on an older version of the BHoM.

Then, because I am also looking at the strongly related issue of lazy loading for Revit, I have added two commits to this PR:

  • Add support for lazy loading of assemblies in additional Engine methods. This was found when I was working on the lazy loading but highlights issues with the existing code so needed to be fixed regardless. Basically, a few places were missed when implementing the lazy loading. This commit tries to correct that.
  • Record the assemblies with extraction issues. This is purely for the incoming refactoring of the AssemblyResolver so it could have been done in a separate PR but it is purely a new separate feature so I didn't think it was harmful to have it already. And it makes my life a lot easier when juggling two related issues at once.

Test files

I'll write something tomorrow but wanted to, at least, have the PR created.
@IsakNaslundBh, you'll be the main reviewer on this so let's have a catchup sometime this week.

Changelog

Additional comments

@adecler adecler self-assigned this Oct 26, 2026
@adecler adecler added the type:feature New capability or enhancement label Oct 26, 2026
@adecler adecler changed the title B ho m engine #3618 improved serialisation BHoM_Engine - Improved serialisation Oct 26, 2026
@adecler

adecler commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

@BHoMBot check versioning
@BHoMBot check serialisation

@bhombot-ci

bhombot-ci Bot commented Nov 3, 2026

Copy link
Copy Markdown

@adecler to confirm, the following actions are now queued:

  • check versioning
  • check serialisation

There are 101 requests in the queue ahead of you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New capability or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure serialisation and versioning provide identical results independently of the framework

1 participant