Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
2018-09-29.okayama.pdf
Okamuuu
September 29, 2018
Technology
0
41
2018-09-29.okayama.pdf
Okamuuu
September 29, 2018
Tweet
Share
More Decks by Okamuuu
See All by Okamuuu
2018-08-04.js-beer-bash.pdf
okamuuu
0
33
hachiojipm#72
okamuuu
0
26
チームで取り組む Singe Page Application
okamuuu
0
630
Other Decks in Technology
See All in Technology
金融スタートアップの上場準備で大事にしたマインドセット / 2022-08-04-the-mindset-in-preparing-for-ipo
stajima
0
320
私のAWS愛を聞け!ここが好きだよAmazon FSx for NetApp ONTAP
non97
0
790
Djangoで組織とユーザーの権限管理をやってみよう #devio2022
seiichi1101
0
420
増田亨さんによる 「設計の考え方とやり方」勉強会オープニング
tsuyok
0
220
PMMやプロダクト関係者と協働するために役割を整理した話 / 20220810_pdmtipslt
rakus_dev
0
120
Sysdig Secure/Falcoの活用術! ~Kubernetes基盤の脅威モデリングとランタイムセキュリティの強化~
owlinux1000
0
290
Trusted Web プロトタイプ
finengine
0
330
品質特性のすすめ
honamin09
0
180
IBM Cloud Festa Online 2022 Summer
1ftseabass
PRO
0
200
AWS CLI でやってみる ~ AWS Hands-on for Beginners ECS ハンズオン ~
kentosuzuki
1
520
Settlement simulation testing to ensure correct settlement processing
applepine1125
2
1.3k
20220803投資先CXO候補者向け 会社紹介資料_合同会社BLUEPRINT
hik
0
430
Featured
See All Featured
The Language of Interfaces
destraynor
148
21k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
107
16k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
655
120k
What's new in Ruby 2.0
geeforr
335
30k
5 minutes of I Can Smell Your CMS
philhawksworth
196
18k
Support Driven Design
roundedbygravity
87
8.6k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
212
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
19
1.2k
For a Future-Friendly Web
brad_frost
166
7.5k
Keith and Marios Guide to Fast Websites
keithpitt
404
21k
Building Flexible Design Systems
yeseniaperezcruz
310
34k
Atom: Resistance is Futile
akmur
255
20k
Transcript
Contentful を使ってみました 岡山城 天守閣 2018-09-29 okamuuu 1 / 17
あくまで個人の感想です。 2 / 17
Contentful とは? いわゆる Headless CMS です。 Contentful ButterCMS storyblok GraphCMS
など 3 / 17
CMS vs Headless CMS ざっくり説明すると Response を HTML で返すのが CMS
Response を JSON で返すのが Headless CMS わかりやすく言うと WordPress は CMS Contentful は Headless CMS 4 / 17
Contentful の特徴 型を自由に定義できる 型に沿ったオブジェクトを出し入れできる CRUD 画面が現れる REST API も生える 位置情報検索もできる
個人で開発する時にとても便利 5 / 17
Contentful を使ってみた感想 CRUD 画面が自動生成される。気持ちいい。 API にちょっと癖がある。 リレーションできない? 通信回数がN+1 にならないように工夫が必要? 6
/ 17
CRUD 画面が自動生成される 7 / 17
CRUD 画面が自動生成される users という型を管理画面で作成する この時点で CRUD 画面が用意される。 そこに user object
を追加する /entries?content_type=users で一覧取得できる 8 / 17
API にちょっと癖がある 9 / 17
API にちょっと癖がある 期待している Response { "id": 2073765716208129 "name": " 神牛前3
丁目", "state: " 東京", } 10 / 17
API にちょっと癖がある { "fields": { "id": { "en-US": 2073765716208129 },
"name": { "en-US": " 神牛前3 丁目" }, "state": { "en-US": " 東京" } }, "sys": { "id": "5KsDBWseXY6QegucYAoacS", "type": "Entry", "createdAt": "2016-12-20T10:43:35.772Z", "updatedAt": "2016-12-20T10:43:35.772Z", "revision": 1 } 11 / 17
リレーションできない? 12 / 17
リレーションできない? Entry 取得した場合、関連する型の sys.id しか取得 できない。ドキュメントには include を指定するよ うに書いているが... //
console.log(user.fields.status) { sys: { type: 'Link', linkType: 'Entry', id: '6Bw3NLBDJ6KEyOc2YwucYk' } } 13 / 17
通信回数がN+1 にならないよう にする 14 / 17
通信回数がN+1 にならないよう にする リレーションができないのであれば、の話ですが 一覧表示画面を実装するときにあえて非正規化す る場面がでてくるかも Promise.all してももっさりしがちなのでできれ ば API
の向こう側で解決したい 15 / 17
まとめ Contentful はかなり便利だった なんだけどリレーションができない? ドキュメントを分かりやすくして欲しい example がもっと欲しい Cognito と Contentful
があれば色々できる予感 16 / 17
おしまい 17 / 17