actual/packages/loot-core/src/server/sync
2022-11-10 12:33:19 -05:00
..
__snapshots__ Initial (open-source) 2022-04-28 22:44:38 -04:00
proto docs: add documentation on how to build the protobuf 2022-06-29 10:07:02 -04:00
encoder.js Separate external, monorepo and internal imports (#237) 2022-09-02 12:43:37 +01:00
index.js Sort import in alphabetical order (#238) 2022-09-02 15:07:24 +01:00
make-test-message.js Separate external, monorepo and internal imports (#237) 2022-09-02 12:43:37 +01:00
migrate.js Separate external, monorepo and internal imports (#237) 2022-09-02 12:43:37 +01:00
migrate.test.js Sort import in alphabetical order (#238) 2022-09-02 15:07:24 +01:00
README.md docs: add documentation on how to build the protobuf 2022-06-29 10:07:02 -04:00
repair.js Sort import in alphabetical order (#238) 2022-09-02 15:07:24 +01:00
reset.js Sort import in alphabetical order (#238) 2022-09-02 15:07:24 +01:00
sync.property.test.js fix: replace last usages of | 0 2022-11-10 12:33:19 -05:00
sync.proto Initial (open-source) 2022-04-28 22:44:38 -04:00
sync.test.js Sort import in alphabetical order (#238) 2022-09-02 15:07:24 +01:00

protobuf

We use protobuf to encode messages as binary data to send across the network.

Generating protobuf

The protobuf is generated by using the protoc compiler.

This can be installed by downloading one of the pre-built binaries and placing it in your $PATH. The version used to build the current protobuf is v3.20.1.

Once installed, the protobuf can be generated by running the below commands.

cd packages/loot-core/src/server/sync

protoc sync.proto --js_out=import_style=commonjs,binary:proto

However there is one very important thing to remember! The default output includes this near the top:

var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);

This will not work with our CSP directives. You must manually modify this to this:

var global = globalThis;