Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
gRPC-webのここがすごい という話がしたかった
Search
Hazumi Ichijo
November 19, 2018
Programming
1.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
gRPC-webのここがすごい という話がしたかった
Roppongi.js #7
Hazumi Ichijo
November 19, 2018
More Decks by Hazumi Ichijo
See All by Hazumi Ichijo
RailsとRidgepoleの マイグレを120倍早くする
hazumirr
0
450
CIを整備してメンテナンスを生成AIに任せる
hazumirr
0
1.5k
病院の情報フローを理解して、 予約〜会計の見え方が変わった話
hazumirr
1
2k
Rubyのコード削除したい時 僕がやること
hazumirr
0
290
テーブル駆動テストと状態
hazumirr
5
2.2k
オンラインテストしようと思った その日に開始できる環境を目指して
hazumirr
0
1.1k
推薦によるプロダクト改善とマイクロサービスが噛み合った話
hazumirr
2
4.8k
ChatGPTで僕が知っていることまとめ
hazumirr
3
3.1k
プロダクトチームとどう 協業し分析環境を改善するか
hazumirr
2
1.7k
Other Decks in Programming
See All in Programming
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
190
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
210
「AI時代、配布するPythonコードをどう守るか: 難読化の実験と判断軸」 #PyconJP2026
pkshadeck
PRO
2
190
What We Talk About When We Talk About XP
m_seki
2
480
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
280
XHTMLが残したもの
yosuke_furukawa
PRO
2
680
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
200
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
不幸な GC
chencmd
0
900
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
530
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
130
Featured
See All Featured
Fireside Chat
paigeccino
43
4k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
620
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
270
The Pragmatic Product Professional
lauravandoore
37
7.4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Navigating Weather and Climate Data
rabernat
0
510
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
400
For a Future-Friendly Web
brad_frost
183
10k
Transcript
©2018 Wantedly, Inc. gRPC-web ͷ͕͍͜͜͢͝ʂ 19.Nov.2018 - Hazumi Ichijo ͱ͍͏͕͔ͨͬͨ͠
©2018 Wantedly, Inc. ࣗݾհ Ұᑍ!IB[VNJSS!SFSPTU 4FSWFS4JEF&OHJOFFSJO8BOUFEMZ (P 3BJMT 3FBDUʜ ग़ւಓ
©2018 Wantedly, Inc. ࣗݾհ Ұᑍ!IB[VNJSS!SFSPTU 4FSWFS4JEF&OHJOFFSJO8BOUFEMZ (P 3BJMT 3FBDUʜ ग़ւಓ
©2018 Wantedly, Inc. ͋͘·ͰɺαʔόʔαΠυΤϯδχΞ͔ΒΈͨ gRPC-WebͷΛ͍ͨ͠ͱࢥ͍·͢
©2018 Wantedly, Inc. grpc/grpc-web͕ϦϦʔε͞Ε·ͨ͠ Description
©2018 Wantedly, Inc.
©2018 Wantedly, Inc. gRPC-Web Λ͏ϝϦοτ
©2018 Wantedly, Inc. API Call \ lJEz lOBNFzlH31$Λಋೖ͢Δz
lBVUIPSzlSFSPTUz lEFBEMJOFzlz lBQQMJDBUJPO@UZQFzl1$8FCz ^ Server Frontend
©2018 Wantedly, Inc. API Call \ lJEz lOBNFzlH31$Λಋೖ͢Δz
lBVUIPSzlSFSPTUz lEFBEMJOFzlz lBQQMJDBUJPO@UZQFzl1$8FCz ^ Server Frontend ͜͜ͷϑΥʔϚοτԿʁ
©2018 Wantedly, Inc. API Call \ lJEz lOBNFzlH31$Λಋೖ͢Δz
lBVUIPSzlSFSPTUz lEFBEMJOFzlz lBQQMJDBUJPO@UZQFzl1$8FCz ^ Server Frontend ͜͜Կ͕ೖΔʁԿΛೖΕ͍͍ͯʁ - PC-Web or pc-web - iOS, Android, …?
©2018 Wantedly, Inc. ΤϯδχΞಉ࢜ͷίϛϡχέʔγϣϯΛͲ͏͢Δʁ "1*ͷޓੑʁ
©2018 Wantedly, Inc. gRPC Call Server Frontend message Todolist {
int64 id = 1; string name = 2; string author = 3; google.protobuf.Timestamp deadline = 4; enum ApplicationType { PC_WEB = 0; MOBILE_WEB = 1; PC_APP = 2; IOS_APP = 3; ANDROID_APP = 4; } ApplicationType application_type = 5; }
©2018 Wantedly, Inc. gRPC Call Server Frontend service TodolistService {
rpc ListTasks (ListTasksRequest) returns (ListTasksResponse) {} rpc GetTask (GetTaskRequest) returns (Todolist) {} rpc CreateTask (CreateTaskRequest) returns (Todolist) {} }
©2018 Wantedly, Inc. ࢼ͢
©2018 Wantedly, Inc. Frontend Envoy(reverse proxy) API Server http gRPC
©2018 Wantedly, Inc. https://grpc.io/docs/quickstart/web.html#what-is-happening
©2018 Wantedly, Inc. service TaskService { rpc ListTasks (ListTasksRequest) returns
(ListTasksResponse) {} rpc GetTask (GetTaskRequest) returns (Task) {} rpc CreateTask (CreateTaskRequest) returns (Task) {} rpc UpdateTask (UpdateTaskRequest) returns (Task) {} rpc DeleteTask (DeleteTaskRequest) returns (google.protobuf.Empty) {} rpc StreamTask(CreateTaskRequest) returns (stream Task){} } message Task { int64 task_id = 1; string title = 2; google.protobuf.Timestamp created_at = 3; google.protobuf.Timestamp deadline = 4; google.protobuf.StringValue note = 5; } ϝοηʔδͷఆٛ αʔϏεͷఆٛ
©2018 Wantedly, Inc. https://github.com/rerost/todolist-server https://github.com/rerost/todolist-frontend2
©2018 Wantedly, Inc. ϋϚΓ͍͢ w H31$ FOWPZ ʜ
ใ͕গͳ͍ɾ୳ͮ͠Β͍ w JNQSPCBCMFFOHHSQDXFC͕ઌʹग़͍ͯͨͷͰݕࡧ͕ͯͬͪ͜͠Ҿ͔͔ͬΓ͍͢ ੜ͞ΕΔίʔυ͕ಡΊͳ͍ʢݸਓࠩ͋Γʣ
©2018 Wantedly, Inc. let req = new ListTasksRequest(); this.client.listTasks(req, {},
(err, res) => { if (err != null) { // ԿΒ͔ͷΤϥʔॲཧ console.log(err); return; } this.setState({ tasks: res.getTasksList() }); }); let req = new CreateTaskRequest(); let task = new Task(); task.setTitle(this.state.text); req.setTask(task); this.client.createTask(req, {}, (err, res) => { if (err != null) { console.log(err); return; } this.setState({ tasks: [res, ...this.state.tasks] }); }); ίϯετϥΫλ͔ΒͰͳ͘ɺ`setXX`Ͱ͢ getterϝιου͕ࣗಈͰఆٛ͞Ε͍ͯΔ
©2018 Wantedly, Inc. /** * @fileoverview * @enhanceable * @suppress
{messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! /* eslint-disable */ var jspb = require("google-protobuf"); var goog = jspb; var global = Function("return this")(); var google_protobuf_empty_pb = require("google-protobuf/google/protobuf/empty_pb.js"); var google_protobuf_timestamp_pb = require("google-protobuf/google/protobuf/timestamp_pb.js"); var google_protobuf_wrappers_pb = require("google-protobuf/google/protobuf/wrappers_pb.js"); var google_protobuf_field_mask_pb = require("google-protobuf/google/protobuf/field_mask_pb.js"); goog.exportSymbol( "proto.com.github.rerost.todolist_server.api.CreateTaskRequest", null, global ); goog.exportSymbol( "proto.com.github.rerost.todolist_server.api.DeleteTaskRequest", null, global ); goog.exportSymbol( "proto.com.github.rerost.todolist_server.api.GetTaskRequest", null, global ); goog.exportSymbol( "proto.com.github.rerost.todolist_server.api.ListTasksRequest", null, global ); goog.exportSymbol( "proto.com.github.rerost.todolist_server.api.ListTasksResponse", null, global ); goog.exportSymbol( "proto.com.github.rerost.todolist_server.api.Task", null, global ); goog.exportSymbol( "proto.com.github.rerost.todolist_server.api.UpdateTaskRequest", null, global ); ϝοηʔδͷఆٛ /** * @fileoverview gRPC-Web generated client stub for com.github.rerost.todolist_server.api * @enhanceable * @public */ // GENERATED CODE -- DO NOT EDIT! const grpc = {}; grpc.web = require("grpc-web"); var google_protobuf_empty_pb = require("google-protobuf/google/protobuf/empty_pb.js"); var google_protobuf_timestamp_pb = require("google-protobuf/google/protobuf/timestamp_pb.js"); var google_protobuf_wrappers_pb = require("google-protobuf/google/protobuf/wrappers_pb.js"); var google_protobuf_field_mask_pb = require("google-protobuf/google/protobuf/field_mask_pb.js"); const proto = {}; proto.com = {}; proto.com.github = {}; proto.com.github.rerost = {}; proto.com.github.rerost.todolist_server = {}; proto.com.github.rerost.todolist_server.api = require("./todo_pb.js"); /** * @param {string} hostname * @param {?Object} credentials * @param {?Object} options * @constructor * @struct * @final */ proto.com.github.rerost.todolist_server.api.TaskServiceClient = function( hostname, credentials, options ) { if (!options) options = {}; options["format"] = "text"; /** * @private @const {!grpc.web.GrpcWebClientBase} The client */ this.client_ = new grpc.web.GrpcWebClientBase(options); /** * @private @const {string} The hostname */ this.hostname_ = hostname; /** * @private @const {?Object} The credentials to be used to connect * to the server αʔϏεͷఆٛ
©2018 Wantedly, Inc. H31$8FCͰ"1*पΓָ͕ʹͳΔ ͨͩ͠ɺϋϚΓϙΠϯτ݁ߏ͋Δ