Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
案件にVaporを採用した所感
Search
omochimetaru
June 07, 2018
Programming
4
450
案件にVaporを採用した所感
omochimetaru
June 07, 2018
Tweet
Share
More Decks by omochimetaru
See All by omochimetaru
型推論のちょっと深い話
omochi
1
460
Swiftの型推論を学ぼう | Let's Learn About Type Inference in Swift
omochi
4
6.2k
[スクリプト] Swiftの型推論を学ぼう
omochi
2
410
Swift6のprotocol
omochi
6
1.2k
SwiftSyntaxをうまく使おう
omochi
2
340
今から使えるSwiftとC++の新しいinterop手法
omochi
0
430
CSFixとラベルマッチ
omochi
0
400
Swiftのmodifyアクセサとコルーチン
omochi
0
770
Swiftのオーバーロード選択のスコア規則12種類
omochi
3
410
Other Decks in Programming
See All in Programming
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
160
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
170
はじめての Go * WASM *OCR
sgash708
1
110
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
140
Domain-Driven Design (Tutorial)
hschwentner
13
22k
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.6k
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
180
CloudNativePGを布教したい
nnaka2992
0
120
15分で学ぶDuckDBの可愛い使い方 DuckDBの最近の更新
notrogue
3
760
ABEMA iOS 大規模プロジェクトにおける段階的な技術刷新 / ABEMA iOS Technology Upgrade
akkyie
1
220
未経験でSRE、はじめました! 組織を支える役割と軌跡
curekoshimizu
1
170
「個人開発マネタイズ大全」が教えてくれたこと
bani24884
1
270
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
328
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Fireside Chat
paigeccino
35
3.2k
Docker and Python
trallard
44
3.3k
Designing for humans not robots
tammielis
250
25k
Designing Experiences People Love
moore
140
23k
Building Adaptive Systems
keathley
40
2.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
134
33k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Transcript
Ҋ݅ʹvaporΛ࠾༻ͨ͠ ॴײ omochimetaru @ 1
ࣗݾհ omochimetaru झຯ: SwiftίϯύΠϥ גࣜձࣾQoncept http://qoncept.co.jp ө૾ղੳ, ΞϓϦ։ൃͳͲ 2
ࣗݾհ swift-developers-japan @ Discord https://medium.com/swift-column/discord-ios-20d586e373c0 [06/11] ͓ཹक൪Ͱ͍͍͚ͭͯΔΜʂWWDCΰϦΰϦΩϟ ονΞοϓձ https://connpass.com/event/89868/ [06/22]
Θ͍Θ͍swiftc #3 https://iosdiscord.connpass.com/event/87509/ 3
डୗͷΞϓϦҊ݅ iOSΞϓϦ + APIαʔό + ཧ༻CMS نখ͞Ί 4
ಥ؏εέδϡʔϧ αʔόαΠυΛPHPͰ֎ Ұஈམ 5
APIαʔόΛSwift/VaporͰ php࣮Λஔ͖͑ͨɻ ࠓͷ • vapor3ܥϕʔλ • ಉ྅ͷ @t-ae ͱڞಉͰ࡞ۀ •
αʔό, ΫϥΠΞϯτΓସ͑த 6
ߏ docker-compose • nginx(SSL) • mysql • php(api + cms)
• phpMyAdmin • vapor ΠϝʔδެࣜखॱͰ 7
։ൃ XcodeͰ࣮ߦ DBsshϙʔτϑΥϫʔυͯ͠ςεταʔόΛซ༻ 8
ίʔυͷڞ༗ • piyo-common: ڞ௨෦ύοέʔδ CarthageͱSwiftPM • piyo-iOS: iOS import PiyoCommon
• piyo-vapor: vapor import PiyoCommon 9
ಛʹAPI ݩʑͷ࣮ public struct APIMeGetRequest: APIRequestProtocol, Encodable {} αʔόʔଆͰDecodableΛՃ extension
APIMeGetRequest: Decodable {} γϦΞϥΠζCodableʹҰͯ҆͠ఆ 10
API ϋϯυϥՃͯ͠Routerʹొ public protocol APIRequestHandler: APIRequestProtocol { static func handle(request:
Request) throws -> Future<ResponseType> } ͜ͷลͷαϯϓϧ https://github.com/t-ae/vapor-api-example 11
Ϟσϧͱ͔ϢʔςΟϦςΟڞ༗ Ұ෦ͷܕ͕ͳ͍ͷͰذͯࣗ͠࡞ #if Vapor public struct GLKVector2 { public var
x: Float public var y: Float public init(_ x: Float, _ y: Float) { self.x = x self.y = y } } #endif 12
Xcode։ൃ vapor෦࣮͕ͲΜͲΜ͑Δ σόοΨͰࢭΊΕεϨουϋϯυϦϯάΘ͔Δ SwiftPMͰνΣοΫΞτ͞ΕͯΔͷͰͦͷͰมߋՄೳ 13
Future ඇಉظͰૣͦ͏(ະܭଌ) Swiftͷܕࢧԉ͕͋ΔͷͰॻ͖͍͢ async/awaitָ͠Έ https://forums.swift.org/t/concurrency-async-await-actors/6499 14
ࠔͬͨ͜ͱ • ֆจࣈ(utf8mb4)ରԠ https://github.com/vapor/mysql/pull/159 • ϩʔΧϧλΠϜ, λΠϜκʔϯରԠ https://github.com/vapor/fluent/issues/464 • RowܕࢦఆͰͷSELECT
https://github.com/vapor/fluent/issues/363 15
ࠔͬͨ͜ͱ • Ϗϧυ࣌ͷڥݕग़ https://github.com/vapor/vapor/issues/1701 • Connection: close ϋϯυϦϯά vs file_get_contents
(ௐࠪத) • Linuxϓϩηεͷσόοά (ͦΕͰLLDBͳΒɾɾɾ) 16
ࠔͬͨ͜ͱ ඞཁͳͱ͜ΖϑΥʔΫͯ͠ରԠ 17
·ͱΊ ΊͬͪΌ͍͍ υΩϡϝϯτ͕ͳͯ͘ιʔε͕ಡΊΕ͍͍ ଟ͍ɺίϯτϦϏϡʔλ૿͑ͯ΄͍͠ 18