From 114eb4f9af0ab7ee0a565c5143ab0afd1de7b6f3 Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Mon, 18 Dec 2023 11:23:55 +0900 Subject: [PATCH] Bump up Yorkie to v0.4.11 --- README.md | 2 +- docker/docker-compose.yml | 25 +------- docker/envoy.Dockerfile | 5 -- docker/envoy.yaml | 59 ------------------- package-lock.json | 44 ++++++-------- package.json | 2 +- .../Editor/mime/text/md/CodeEditor/index.tsx | 4 ++ src/components/NavBar/NetworkButton.tsx | 2 + 8 files changed, 30 insertions(+), 113 deletions(-) delete mode 100644 docker/envoy.Dockerfile delete mode 100644 docker/envoy.yaml diff --git a/README.md b/README.md index 1efdaa46..819ec3b7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Real-time markdown editor for interviews, meetings & more... ## Developing CodePair For building CodePair, You'll first need Node.js installed(Node.js version 16+ and npm version 7.10+ are required). -CodePair requires local applications such as Envoy, Yorkie and MongoDB. To start them: +CodePair requires local applications such as Yorkie and MongoDB. To start them: ``` docker-compose -f docker/docker-compose.yml up --build -d diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 8573e00e..8e4ff0ae 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,32 +1,13 @@ version: '3.3' services: - envoy: - build: - context: ./ - dockerfile: ./envoy.Dockerfile - image: 'grpcweb:envoy' - container_name: 'envoy' - restart: always - ports: - - '8080:8080' - - '9901:9901' - depends_on: - - yorkie - # 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. - # (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" yorkie: - image: 'yorkieteam/yorkie:0.4.6' + image: 'yorkieteam/yorkie:0.4.11' container_name: 'yorkie' command: [ 'server', ] restart: always ports: - - '11101:11101' - - '11102:11102' + - '8080:8080' + - '9901:9901' diff --git a/docker/envoy.Dockerfile b/docker/envoy.Dockerfile deleted file mode 100644 index 426026ce..00000000 --- a/docker/envoy.Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM envoyproxy/envoy:v1.19.0 - -COPY ./envoy.yaml /etc/envoy/envoy.yaml - -CMD /usr/local/bin/envoy -c /etc/envoy/envoy.yaml diff --git a/docker/envoy.yaml b/docker/envoy.yaml deleted file mode 100644 index 69b92bcc..00000000 --- a/docker/envoy.yaml +++ /dev/null @@ -1,59 +0,0 @@ -admin: - access_log_path: /tmp/admin_access.log - address: - socket_address: { address: 0.0.0.0, port_value: 9901 } - -static_resources: - listeners: - - name: yorkie_rpc_listener - address: - socket_address: { address: 0.0.0.0, port_value: 8080 } - filter_chains: - - filters: - - name: envoy.filters.network.http_connection_manager - typed_config: - "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager - stat_prefix: ingress_http - route_config: - name: local_route - virtual_hosts: - - name: local_service - domains: ["*"] - routes: - - match: { prefix: "/" } - route: - cluster: yorkie_rpc_service - # https://github.com/grpc/grpc-web/issues/361 - max_stream_duration: - grpc_timeout_header_max: 0s - cors: - allow_origin_string_match: - - prefix: "*" - allow_methods: GET, PUT, DELETE, POST, OPTIONS - allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-api-key,x-shard-key,x-user-agent,x-grpc-web,grpc-timeout,authorization,x-yorkie-user-agent - max_age: "1728000" - expose_headers: custom-header-1,grpc-status,grpc-message - http_filters: - - name: envoy.filters.http.grpc_web - - name: envoy.filters.http.cors - - name: envoy.filters.http.router - clusters: - - name: yorkie_rpc_service - connect_timeout: 0.25s - type: logical_dns - http2_protocol_options: {} - lb_policy: round_robin - # Input the address which envoy can connect to as a yorkie server. - # When you want envoy container to communicate with your host machine, you should set as the following - # - Windows/Mac: Input host.docker.internal - # - Linux: an IP address of the host machine or docker-0 interface or some addresses defined in extra hosts of docker-compose.yml - # you can simply use the yorkie container name(e.g. yorkie) in docker-compose whatever your OS is. - load_assignment: - cluster_name: yorkie_cluster - endpoints: - - lb_endpoints: - - endpoint: - address: - socket_address: - address: host.docker.internal - port_value: 11101 diff --git a/package-lock.json b/package-lock.json index 479092b1..a4d1cd8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,7 +66,7 @@ "remark-toc": "^8.0.1", "tss-react": "^4.8.2", "unique-names-generator": "^4.7.1", - "yorkie-js-sdk": "yorkie-team/yorkie-js-sdk#main" + "yorkie-js-sdk": "^0.4.11" }, "devDependencies": { "@esbuild-plugins/node-globals-polyfill": "^0.2.3", @@ -5019,9 +5019,9 @@ "integrity": "sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw==" }, "node_modules/@types/google-protobuf": { - "version": "3.15.6", - "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.15.6.tgz", - "integrity": "sha512-pYVNNJ+winC4aek+lZp93sIKxnXt5qMkuKmaqS3WGuTq0Bw1ZDYNBgzG5kkdtwcv+GmYJGo3yEg6z2cKKAiEdw==" + "version": "3.15.12", + "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.15.12.tgz", + "integrity": "sha512-40um9QqwHjRS92qnOaDpL7RmDK15NuZYo9HihiJRbYkMQZlWnuH8AdvbMy8/o6lgLmKbDUKa+OALCltHdbOTpQ==" }, "node_modules/@types/hast": { "version": "2.3.4", @@ -10042,9 +10042,9 @@ } }, "node_modules/grpc-web": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/grpc-web/-/grpc-web-1.4.2.tgz", - "integrity": "sha512-gUxWq42l5ldaRplcKb4Pw5O4XBONWZgz3vxIIXnfIeJj8Jc3wYiq2O4c9xzx/NGbbPEej4rhI62C9eTENwLGNw==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/grpc-web/-/grpc-web-1.5.0.tgz", + "integrity": "sha512-y1tS3BBIoiVSzKTDF3Hm7E8hV2n7YY7pO0Uo7depfWJqKzWE+SKr0jvHNIJsJJYILQlpYShpi/DRJJMbosgDMQ==" }, "node_modules/has": { "version": "1.0.3", @@ -19744,22 +19744,15 @@ } }, "node_modules/yorkie-js-sdk": { - "version": "0.4.6", - "resolved": "git+ssh://git@github.com/yorkie-team/yorkie-js-sdk.git#2ac69bbdd570e39143d7ecd4c54bd7a54b9e6215", - "license": "Apache-2.0", - "workspaces": [ - "examples/*" - ], + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/yorkie-js-sdk/-/yorkie-js-sdk-0.4.11.tgz", + "integrity": "sha512-1YUUeyF6xWK56pWHqQmkr2UoLTFL+6YVTo61iJayxWwiNSKgZ8owBexD+LBPSjg0jbVZGOB3dWC3by4NVU5GEw==", "dependencies": { "@types/google-protobuf": "^3.15.5", "@types/long": "^4.0.1", "google-protobuf": "^3.19.4", "grpc-web": "^1.3.1", "long": "^5.2.0" - }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.1.0" } }, "node_modules/zustand": { @@ -23220,9 +23213,9 @@ "integrity": "sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw==" }, "@types/google-protobuf": { - "version": "3.15.6", - "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.15.6.tgz", - "integrity": "sha512-pYVNNJ+winC4aek+lZp93sIKxnXt5qMkuKmaqS3WGuTq0Bw1ZDYNBgzG5kkdtwcv+GmYJGo3yEg6z2cKKAiEdw==" + "version": "3.15.12", + "resolved": "https://registry.npmjs.org/@types/google-protobuf/-/google-protobuf-3.15.12.tgz", + "integrity": "sha512-40um9QqwHjRS92qnOaDpL7RmDK15NuZYo9HihiJRbYkMQZlWnuH8AdvbMy8/o6lgLmKbDUKa+OALCltHdbOTpQ==" }, "@types/hast": { "version": "2.3.4", @@ -27111,9 +27104,9 @@ } }, "grpc-web": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/grpc-web/-/grpc-web-1.4.2.tgz", - "integrity": "sha512-gUxWq42l5ldaRplcKb4Pw5O4XBONWZgz3vxIIXnfIeJj8Jc3wYiq2O4c9xzx/NGbbPEej4rhI62C9eTENwLGNw==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/grpc-web/-/grpc-web-1.5.0.tgz", + "integrity": "sha512-y1tS3BBIoiVSzKTDF3Hm7E8hV2n7YY7pO0Uo7depfWJqKzWE+SKr0jvHNIJsJJYILQlpYShpi/DRJJMbosgDMQ==" }, "has": { "version": "1.0.3", @@ -34015,8 +34008,9 @@ "dev": true }, "yorkie-js-sdk": { - "version": "git+ssh://git@github.com/yorkie-team/yorkie-js-sdk.git#2ac69bbdd570e39143d7ecd4c54bd7a54b9e6215", - "from": "yorkie-js-sdk@yorkie-team/yorkie-js-sdk#main", + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/yorkie-js-sdk/-/yorkie-js-sdk-0.4.11.tgz", + "integrity": "sha512-1YUUeyF6xWK56pWHqQmkr2UoLTFL+6YVTo61iJayxWwiNSKgZ8owBexD+LBPSjg0jbVZGOB3dWC3by4NVU5GEw==", "requires": { "@types/google-protobuf": "^3.15.5", "@types/long": "^4.0.1", diff --git a/package.json b/package.json index 779f1d26..874c68e7 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "remark-toc": "^8.0.1", "tss-react": "^4.8.2", "unique-names-generator": "^4.7.1", - "yorkie-js-sdk": "yorkie-team/yorkie-js-sdk#main" + "yorkie-js-sdk": "^0.4.11" }, "devDependencies": { "@esbuild-plugins/node-globals-polyfill": "^0.2.3", diff --git a/src/components/Editor/mime/text/md/CodeEditor/index.tsx b/src/components/Editor/mime/text/md/CodeEditor/index.tsx index ea54672b..42bb94e4 100644 --- a/src/components/Editor/mime/text/md/CodeEditor/index.tsx +++ b/src/components/Editor/mime/text/md/CodeEditor/index.tsx @@ -728,9 +728,13 @@ export default function CodeEditor() { editor.on('change', () => { dispatch(updateHeadings()); + // TODO(hackerwins): Remove ignore after fixing the type. + // @ts-ignore dispatch(updateLinkNameWithHeading({ docKey: doc.getKey() })); dispatch( addRecentPage({ + // TODO(hackerwins): Remove ignore after fixing the type. + // @ts-ignore docKey: doc.getKey(), page: { name: `${getTableOfContents(1)[0]?.text}`, diff --git a/src/components/NavBar/NetworkButton.tsx b/src/components/NavBar/NetworkButton.tsx index 75a1e466..b1a55ed9 100644 --- a/src/components/NavBar/NetworkButton.tsx +++ b/src/components/NavBar/NetworkButton.tsx @@ -126,6 +126,8 @@ function NetworkConnect() { export default function NetworkButton() { const status = useSelector((state: AppState) => state.docState.status); const hasLocalChanges = useSelector((state: AppState) => { + // TODO(hackerwins): Remove ignore after fixing the type. + // @ts-ignore return state.docState.doc ? state.docState.doc.hasLocalChanges() : false; });