In this lib we will have message classes that will be used by messenger component(or other messaging components from other languages)
All messages are declared as protobuf (v3) files in ./src. For more information about protobuf read https://developers.google.com/protocol-buffers/docs/proto3.
- Create a custom-message.proto
- Declare a new value in DescriminatorType enum in: ./src/message.proto
- Go to github repository and create a release: https://github.com/bagrinsergiu/brizy-protobuf-idl/releases This will trigger an github action that will generate the code and commit it in https://github.com/bagrinsergiu/brizy-protogen-php
- If you created a new message you must go to https://github.com/bagrinsergiu/brizy-protogen-php and add the new message in the ProtobufHydrator https://github.com/bagrinsergiu/brizy-protogen-php/blob/master/src/Hydrator/ProtobufHydrator.php PS: This is small problem that we need to automate.
Ex:
message RemoveEntityTranslationMessage {
Message.DescriminatorType descriminator = 1;
int32 project_id = 2;
string entity_iri = 3;
string project_iri = 4;
}Step 1: Install the required dependencies
npm install @bufbuild/protobuf @bufbuild/buf @bufbuild/protoc-gen-esStep 2: Generate the code
npx buf generate