Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit 6af9c3b

Browse files
leanmendozamenduz
andauthored
feat: implement @dcl/rpc (#308)
* wip * add devtools * wip * wip * mocking decentraland interface * adding events * all scenes running with new rpc * non functional wip * broken wip * fix * fix * remove empty generic response * add protocol-buf in the pipelines * also add in build step * wip * wip * remove debugger * fix: remove events when sending batch * add stats * add fps throttling and add initial rpcContext * get back the devToolAdapter * complete remaining apis * remove old scene runtime with old rpc * fix comms * fix module loading * fix getBootstrapData * log * test hack * fix test * add worker name to RpcClientPort * remove old stuffs * change to a right name * add esModuleInterop option * move 'real' to just the method name and clean code * remove spam log * rollout to 0 in .org * adapt the experimental api * implement SceneStateStorageController * get back Stateful scenes * fix no service * fix builder in world * clean code: remove didStart from EngineAPI * fix lint * merge from main * PR review suggestions (#334) * makefile suggestions * wip * fix avatars * clean and kuruk review. * typed createGenericLogComponent * FIX ME * lint fix * Revert "FIX ME" This reverts commit eedd2c1. * Fix me 2.0 * fix lint * bypass visible avatar test * batched events approach * change .ts generation to .gen.ts and clean. fix hasManyPermissions to get permissions in a unique request * fix circular dependency * fix stats * move new-rpc to runtime clean code, remove eventChannel * clean and pretify code * fix tests * filter transport closed ack error * revert visibleAvatars logic * fix permission loading, ethereumcontroller and parcelidentity apis * fix build * fix bad scenes * remove a level of JSON.parse and JSON.stringify with protocol-buffers * fix ethereum controller * fix signed fetch * fix: avoid starting more than one, and add the event when the cb fails * optimize: send positionChanged and rotationChagned by protocol-buffer * fix raycast * pretify code Co-authored-by: menduz <github@menduz.com>
1 parent f2b7ef2 commit 6af9c3b

120 files changed

Lines changed: 4441 additions & 2870 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/set-rollouts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ jobs:
5858
# Rollout information
5959
deploymentDomain: "play.decentraland.org"
6060
deploymentName: "@dcl/kernel"
61-
percentage: 100
61+
percentage: 0

.github/workflows/test-build-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ jobs:
6464
cwd: ./static
6565

6666
- name: install
67-
run: npm ci
68-
67+
run: |
68+
npm ci
6969
- name: build
7070
run: make build-essentials build-release build-deploy
7171
- uses: hmarr/debug-action@v2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,6 @@ public/local-ipfs
9494
static/package-lock.json
9595
**/*.dot.pdf
9696
**/*.dot
97+
98+
packages/shared/apis/proto/*.ts
9799
lsall

Makefile

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
# General setup
2+
PROTOBUF_VERSION = 3.20.1
3+
ifeq ($(shell uname),Darwin)
4+
PROTOBUF_ZIP = protoc-$(PROTOBUF_VERSION)-osx-x86_64.zip
5+
else
6+
PROTOBUF_ZIP = protoc-$(PROTOBUF_VERSION)-linux-x86_64.zip
7+
endif
28

39
NODE = node
410
COMPILER = $(NODE) --max-old-space-size=4096 node_modules/.bin/decentraland-compiler
511
CONCURRENTLY = node_modules/.bin/concurrently
12+
SCENE_PROTO_FILES := $(wildcard packages/shared/apis/proto/*.proto)
13+
PBS_TS = $(SCENE_PROTO_FILES:packages/shared/apis/proto/%.proto=packages/shared/apis/proto/%.gen.ts)
614
CWD = $(shell pwd)
15+
PROTOC = node_modules/.bin/protobuf/bin/protoc
716

817
# Remove default Makefile rules
918

@@ -51,7 +60,7 @@ empty-parcels:
5160
cp $(EMPTY_SCENES)/mappings.json static/loader/empty-scenes/mappings.json
5261
cp -R $(EMPTY_SCENES)/contents static/loader/empty-scenes/contents
5362

54-
build-essentials: $(COMPILED_SUPPORT_JS_FILES) $(SCENE_SYSTEM) $(INTERNAL_SCENES) $(DECENTRALAND_LOADER) $(GIF_PROCESSOR) $(VOICE_CHAT_CODEC_WORKER) empty-parcels
63+
build-essentials: ${PBS_TS} $(COMPILED_SUPPORT_JS_FILES) $(SCENE_SYSTEM) $(INTERNAL_SCENES) $(DECENTRALAND_LOADER) $(GIF_PROCESSOR) $(VOICE_CHAT_CODEC_WORKER) empty-parcels
5564

5665
# Entry points
5766
static/%.js: build-essentials packages/entryPoints/%.ts
@@ -164,7 +173,6 @@ update-renderer: ## Update the renderer
164173

165174
madge: scripts/deps.js
166175
@node scripts/deps.js
167-
dot packages/scene-system/cli.scene.system.ts.dot -T pdf -O
168176
dot packages/scene-system/scene.system.ts.dot -T pdf -O
169177
dot packages/scene-system/stateful.scene.system.ts.dot -T pdf -O
170178
dot packages/ui/decentraland-ui.scene.ts.dot -T pdf -O
@@ -181,3 +189,19 @@ madge: scripts/deps.js
181189
help:
182190
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
183191
@echo "\nYou probably want to run 'make watch' to build all the test scenes and run the local comms server."
192+
193+
node_modules/.bin/protobuf/bin/protoc:
194+
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOBUF_VERSION)/$(PROTOBUF_ZIP)
195+
unzip -o $(PROTOBUF_ZIP) -d node_modules/.bin/protobuf
196+
rm $(PROTOBUF_ZIP)
197+
chmod +x node_modules/.bin/protobuf/bin/protoc
198+
199+
packages/shared/apis/proto/%.gen.ts: packages/shared/apis/proto/%.proto node_modules/.bin/protobuf/bin/protoc
200+
${PROTOC} \
201+
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
202+
--ts_proto_opt=esModuleInterop=true,returnObservable=false,outputServices=generic-definitions \
203+
--ts_proto_opt=fileSuffix=.gen \
204+
--ts_proto_out="$(PWD)/packages/shared/apis/proto" -I="$(PWD)/packages/shared/apis/proto" \
205+
"$(PWD)/packages/shared/apis/proto/$*.proto";
206+
207+
compile_apis: ${PBS_TS}

0 commit comments

Comments
 (0)