Skip to content

Commit

Permalink
Bump up Yorkie to 0.4.6 (#133)
Browse files Browse the repository at this point in the history
Co-authored-by: Youngteac Hong <susukang98@gmail.com>
  • Loading branch information
chacha912 and hackerwins authored Aug 25, 2023
1 parent 62ebfb7 commit 5bcbba7
Show file tree
Hide file tree
Showing 13 changed files with 1,349 additions and 540 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Common Environment Variables
REACT_APP_JS_SDK_VERSION=0.4.3
REACT_APP_JS_SDK_VERSION=0.4.6
11 changes: 4 additions & 7 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ services:
# If you're using Mac or Windows, this special domain name("host.docker.internal" which makes containers able to connect to the host)
# is supported by default.
# But if you're using Linux and want an envoy container to communicate with the host,
# it may help to define "host.docker.internal" in extra_hosts.
# it may help to define "host.docker.internal" in extra_hosts.
# (Actually, other hostnames are available, but in that case you should update clusters[].host configurations of envoy.yaml)
extra_hosts:
- "host.docker.internal:host-gateway"
- 'host.docker.internal:host-gateway'
yorkie:
image: 'yorkieteam/yorkie:0.4.3'
image: 'yorkieteam/yorkie:0.4.6'
container_name: 'yorkie'
command: [
'server',
'--enable-pprof',
]
command: ['server', '--enable-pprof']
restart: always
ports:
- '11101:11101'
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"react-scripts": "5.0.0",
"sass": "^1.55.0",
"typescript": "~4.1.5",
"yorkie-js-sdk": "^0.4.3"
"yorkie-js-sdk": "^0.4.6"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -102,7 +102,8 @@
"jsx",
"svg",
"gnb",
"resize"
"resize",
"indexable"
],
"skipIfMatch": [
"TODO\\(.+\\):",
Expand Down
4 changes: 2 additions & 2 deletions src/api/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { Timestamp as PbTimestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { User, Project, DocumentSummary, AuthWebhookMethod } from './types';
import { Change, converter } from 'yorkie-js-sdk';
import { Change, converter, Indexable } from 'yorkie-js-sdk';
import {
User as PbUser,
Project as PbProject,
Expand Down Expand Up @@ -80,6 +80,6 @@ export function fromDocumentSummaries(pbDocumentSummaries: Array<PbDocumentSumma
return documentSummaries;
}

export function fromChanges(pbChanges: Array<PbChange>): Array<Change> {
export function fromChanges(pbChanges: Array<PbChange>): Array<Change<Indexable>> {
return converter.fromChanges(pbChanges);
}
1 change: 1 addition & 0 deletions src/api/yorkie/v1/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ message ListDocumentsRequest {
string previous_id = 2;
int32 page_size = 3;
bool is_forward = 4;
bool include_snapshot = 5;
}

message ListDocumentsResponse {
Expand Down
2 changes: 1 addition & 1 deletion src/api/yorkie/v1/admin_grpc_web_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
// protoc-gen-grpc-web v1.4.2
// protoc v3.20.3
// protoc v4.23.2
// source: yorkie/v1/admin.proto


Expand Down
4 changes: 4 additions & 0 deletions src/api/yorkie/v1/admin_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ export class ListDocumentsRequest extends jspb.Message {
getIsForward(): boolean;
setIsForward(value: boolean): ListDocumentsRequest;

getIncludeSnapshot(): boolean;
setIncludeSnapshot(value: boolean): ListDocumentsRequest;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ListDocumentsRequest.AsObject;
static toObject(includeInstance: boolean, msg: ListDocumentsRequest): ListDocumentsRequest.AsObject;
Expand All @@ -266,6 +269,7 @@ export namespace ListDocumentsRequest {
previousId: string,
pageSize: number,
isForward: boolean,
includeSnapshot: boolean,
}
}

Expand Down
40 changes: 38 additions & 2 deletions src/api/yorkie/v1/admin_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@

var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
var global =
(typeof globalThis !== 'undefined' && globalThis) ||
(typeof window !== 'undefined' && window) ||
(typeof global !== 'undefined' && global) ||
(typeof self !== 'undefined' && self) ||
(function () { return this; }).call(null) ||
Function('return this')();

var yorkie_v1_resources_pb = require('../../yorkie/v1/resources_pb.js');
goog.object.extend(proto, yorkie_v1_resources_pb);
Expand Down Expand Up @@ -2336,7 +2342,8 @@ proto.yorkie.v1.ListDocumentsRequest.toObject = function(includeInstance, msg) {
projectName: jspb.Message.getFieldWithDefault(msg, 1, ""),
previousId: jspb.Message.getFieldWithDefault(msg, 2, ""),
pageSize: jspb.Message.getFieldWithDefault(msg, 3, 0),
isForward: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
isForward: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
includeSnapshot: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
};

if (includeInstance) {
Expand Down Expand Up @@ -2389,6 +2396,10 @@ proto.yorkie.v1.ListDocumentsRequest.deserializeBinaryFromReader = function(msg,
var value = /** @type {boolean} */ (reader.readBool());
msg.setIsForward(value);
break;
case 5:
var value = /** @type {boolean} */ (reader.readBool());
msg.setIncludeSnapshot(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -2446,6 +2457,13 @@ proto.yorkie.v1.ListDocumentsRequest.serializeBinaryToWriter = function(message,
f
);
}
f = message.getIncludeSnapshot();
if (f) {
writer.writeBool(
5,
f
);
}
};


Expand Down Expand Up @@ -2521,6 +2539,24 @@ proto.yorkie.v1.ListDocumentsRequest.prototype.setIsForward = function(value) {
};


/**
* optional bool include_snapshot = 5;
* @return {boolean}
*/
proto.yorkie.v1.ListDocumentsRequest.prototype.getIncludeSnapshot = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false));
};


/**
* @param {boolean} value
* @return {!proto.yorkie.v1.ListDocumentsRequest} returns this
*/
proto.yorkie.v1.ListDocumentsRequest.prototype.setIncludeSnapshot = function(value) {
return jspb.Message.setProto3BooleanField(this, 5, value);
};



/**
* List of repeated fields within this message type.
Expand Down
65 changes: 46 additions & 19 deletions src/api/yorkie/v1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ option go_package = ".;v1";
option java_multiple_files = true;
option java_package = "dev.yorkie.api.v1";

/////////////////////////////////////////
// Messages for Snapshot //
/////////////////////////////////////////
message Snapshot {
JSONElement root = 1;
map<string, Presence> presences = 2;
}

/////////////////////////////////////////
// Messages for ChangePack //
/////////////////////////////////////////
Expand All @@ -44,6 +52,7 @@ message Change {
ChangeID id = 1;
string message = 2;
repeated Operation operations = 3;
PresenceChange presence_change = 4;
}

message ChangeID {
Expand Down Expand Up @@ -86,6 +95,10 @@ message Operation {
TimeTicket executed_at = 6;
map<string, string> attributes = 7;
}
// NOTE(hackerwins): Select Operation is not used in the current version.
// In the previous version, it was used to represent selection of Text.
// However, it has been replaced by Presence now. It is retained for backward
// compatibility purposes.
message Select {
TimeTicket parent_created_at = 1;
TextNodePos from = 2;
Expand All @@ -108,8 +121,9 @@ message Operation {
TimeTicket parent_created_at = 1;
TreePos from = 2;
TreePos to = 3;
repeated TreeNode content = 4;
TimeTicket executed_at = 5;
map<string, TimeTicket> created_at_map_by_actor = 4;
repeated TreeNodes contents = 5;
TimeTicket executed_at = 6;
}
message TreeStyle {
TimeTicket parent_created_at = 1;
Expand Down Expand Up @@ -224,20 +238,30 @@ message TextNodeID {
}

message TreeNode {
TreePos pos = 1;
TreeNodeID id = 1;
string type = 2;
string value = 3;
TimeTicket removed_at = 4;
TreePos ins_prev_pos = 5;
int32 depth = 6;
map<string, NodeAttr> attributes = 7;
TreeNodeID ins_prev_id = 5;
TreeNodeID ins_next_id = 6;
int32 depth = 7;
map<string, NodeAttr> attributes = 8;
}

message TreePos {
message TreeNodes {
repeated TreeNode content = 1;
}

message TreeNodeID {
TimeTicket created_at = 1;
int32 offset = 2;
}

message TreePos {
TreeNodeID parent_id = 1;
TreeNodeID left_sibling_id = 2;
}

/////////////////////////////////////////
// Messages for Common //
/////////////////////////////////////////
Expand Down Expand Up @@ -280,14 +304,19 @@ message DocumentSummary {
google.protobuf.Timestamp updated_at = 6;
}

message Presence {
int32 clock = 1;
map<string, string> data = 2;
message PresenceChange {
enum ChangeType {
CHANGE_TYPE_UNSPECIFIED = 0;
CHANGE_TYPE_PUT = 1;
CHANGE_TYPE_DELETE = 2;
CHANGE_TYPE_CLEAR = 3;
}
ChangeType type = 1;
Presence presence = 2;
}

message Client {
bytes id = 1;
Presence presence = 2;
message Presence {
map<string, string> data = 1;
}

message Checkpoint {
Expand Down Expand Up @@ -325,14 +354,12 @@ enum ValueType {
}

enum DocEventType {
DOC_EVENT_TYPE_DOCUMENTS_CHANGED = 0;
DOC_EVENT_TYPE_DOCUMENTS_WATCHED = 1;
DOC_EVENT_TYPE_DOCUMENTS_UNWATCHED = 2;
DOC_EVENT_TYPE_PRESENCE_CHANGED = 3;
DOC_EVENT_TYPE_DOCUMENT_CHANGED = 0;
DOC_EVENT_TYPE_DOCUMENT_WATCHED = 1;
DOC_EVENT_TYPE_DOCUMENT_UNWATCHED = 2;
}

message DocEvent {
DocEventType type = 1;
Client publisher = 2;
string document_id = 3;
string publisher = 2;
}
Loading

0 comments on commit 5bcbba7

Please sign in to comment.