- dotnet sdk currently 9.0 is required
- node
- Taskfile
- windows:
winget install Task.Task - linux:
sudo snap install task --classicor other options on their website - mac:
brew install go-task/tap/go-task - via npm:
npm install -g @go-task/cli
- windows:
- .Net Maui workload
sudo dotnet workload restore- XCode (for MacOS and iOS)
- Android SDK API 35+ (can be installed via Android Studio)
- Java SDK 17 (for Android)
from repo root:
task fw-lite-webthis will start the frontend vite server (in frontend/viewer) and the backend web server (in backend/FwLite/FwLiteWeb).
For .Net tests, you can run them from the command line, in the repo root:
dotnet test FwLiteOnly.slnf dotnet build -f net9.0-iosYou can choose which framework to build for with the -f flag.
graph
subgraph Lexbox
Harmony[(Harmony)]
Mercurial[(Mercurial)]
sync("Sync FieldWorks Lite \n (manually triggered)")
Harmony <---> sync
Mercurial <---> sync
end
subgraph User machine's/phone
FieldWorksLite[FieldWorks Lite]
ClassicFieldWorks[Classic FieldWorks]
end
FieldWorksLite <-- " Live Sync " --> Harmony
ClassicFieldWorks <-- " Send and Receive " --> Mercurial
- Create a change class. Reference CreateComplexFormType for a simple example of creating a new object. Reference AddComplexFormTypeChange for an example of editing an existing object.
- Register that change class in LcmCrdtKernel.ConfigureCrdt
- Add an instance of the change to UseChangesTests.GetAllChanges to demonstrate that it works.
Things to watch out for
The JSON deserializer maps PascalCase property names to camelCase constructor parameter names. So, they need to be the same.
For example, this will not work:
public class MyChange
{
public MyChange(string userName)
{
Name = userName;
}
public string Name { get; set; }
}In this case, string userName should be changed to string name to match the property.
One place this is important is that all changes extend either CreateChange or EditChange, which both take a Guid entityId argument in their primary constructors.
The property that is assigned to is also called EntityId, so the constructor argument in your change must also be called entityId.
There is a test to guard from mistakes which would prevent deserialization of changes in ChangeSerializationTests.CanRoundTripChanges
Due to syncing, a change could reference an object which has been deleted. For example, AddComplexFormTypeChange.ApplyChange ensures that the complex form type actually exists. If it doesn't exist or has been deleted then it is not added to the entry. In some cases this may mean that the object being modified/created is actually deleted. For example, in CreateSenseChange if the Entry is deleted then the sense is also deleted.