Slide 1

Slide 1 text

খௗ͞Μͱ,PUMJOΛษڧͰ͖ΔαΠτΛ ,PUMJOͰ࡞Δ ʹ͜͠Γ͞ͿΖʙ!TVCSPI@

Slide 2

Slide 2 text

ࣗݾ঺հ w ʹ͜͠Γ͞ͿΖʙ ͱಉ͍೥ w גࣜձࣾ#FBS5BJM w "OESPJEΤϯδχΞ ,PUMJO+BWB ˑ w 8FCΤϯδχΞ 3BJMT3FBDU w ୲౰଎ਫ૗ɾࡾๆ݁՚ɾਅนਸ਼ر 5XJUUFS*%!TVCSPI@ ˣ/&8 ϛϦUI෱Ԭʙ

Slide 3

Slide 3 text

એ఻λΠϜ 0UPOBTIJ w ,PUMJO੡41"32-ΫϥΠΞϯτ w TVCSPIPUPOBTIJ ਫ୩ञ଄ʮઍත૗ʯ w ୲౰ͷ೔ຊञ w ළͷ৭͕߹͍͗ͯ͢ޠኮྗࣦ͏☺

Slide 4

Slide 4 text

໨࣍ ࡞ͬͨϞϊ঺հ w খௗ͞Μͱ,PUMJOΛֶ΂ΔαΠτʮখௗ͞Μͷࣗशࣨʯ w ੡࡞ͷϞνϕʔγϣϯ ࣮૷঺հ w αʔόʔαΠυ ,UPS w ϑϩϯτΤϯυ ,PUMJO+4 ·ͱΊ

Slide 5

Slide 5 text

ͦͷલʹʜ w ,PUMJOͱ͸ w +FU#SBJOT੡ɺ੩తܕ෇͚ͷΦϒδΣΫτࢦ޲ϓϩάϥϛϯάݴޠ w +7.্Ͱಈ࡞ +BWBͱ4DBMBͷதؒʹҐஔ w (PPHMF͕"OESPJEΞϓϦͷ։ൃݴޠͱͯ͠ਖ਼ࣜαϙʔτʂ w ,PUMJO+4ɾ,PUMJO/BUJWF౳ɺΫϩεϓϥοτϑΥʔϜ։ൃʹ΋ରԠ

Slide 6

Slide 6 text

,PUMJO͸͍͍ͧʜ Button button = …; button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("tag", "Clicked!") } }); ྫϘλϯΛԡ͢ͱʮ$MJDLFEʯͱදࣔ "OESPJE+BWB ˠΠϯλʔϑΣʔεఆ͕ٛ৑௕

Slide 7

Slide 7 text

,PUMJO͸͍͍ͧʜ val button: Button = ... button.setOnClickListener { v -> Log.d("tag", "Clicked!") } ྫϘλϯΛԡ͢ͱʮ$MJDLFEʯͱදࣔ "OESPJE,PUMJO ˠ4".ม׵ ΠϯλʔϑΣʔεఆٛΛϥϜμͰॻ͚Δ

Slide 8

Slide 8 text

,PUMJO͸͍͍ͧʜ ྫϦετΛηϛίϩϯͰܨ͛ͯେจࣈʹม׵ ˠҾ਺MJTUͷOVMMνΣοΫ͕໘౗ɺ๨Ε͕ͪ ˠ๨ΕͨΒ࣮ߦ࣌Τϥʔ ԯͷσόΠεͰ૸ͬͯ٬ઌͰʜ String joinAndUpperCase(List list) { if (list == null) { return ""; } return String.join(":", list).toUpperCase(); }

Slide 9

Slide 9 text

,PUMJO͸͍͍ͧʜ ྫϦετΛηϛίϩϯͰܨ͛ͯେจࣈʹม׵ ˠ/VMMڐ༰ɾඇڐ༰Λʮ ʯͰ໌ࣔɺڐ༰ͷ৔߹ίϯύΠϧΤϥʔ ˠʮMJTU KPJO5P4USJOH lz ʯͰ ɹɹɹʮMJTU͕OVMMͷ࣌͸KPJO5P4USJOHΛ࣮ߦ͠ͳ͍ʯ fun joinAndUpperCase(list: List?): String { return list?.joinToString(":")?.toUpperCase() :? "" } γϯϓϧ͔࣮ͭ༻తͳจ๏Ͱʮ+BWBͭΒ͍ʯΛղܾʂɹͦΕ͕,PUMJOʂ

Slide 10

Slide 10 text

࡞ͬͨ΋ͷ w খௗ͞Μͷࣗशࣨখௗ͞Μͱ,PUMJOΛֶ΂ΔαΠτ w (JUIVCTVCSPIPUPOBTIJLPUMJOEFW w ػೳ w ,PUMJOͷجૅతͳจ๏ղઆ w 8FC্Ͱখௗ͞ΜͱϖΞϓϩάϥϛϯά͠ͳ͕Β,PUMJOΛษڧͰ͖Δʂ w ,PUMJOΛษڧ͍ͨ͠খௗ͞ΜͱͷίϛϡΛָ͠ΊΔʂ

Slide 11

Slide 11 text

0WFSWJFX

Slide 12

Slide 12 text

0WFSWJFX w ,PUMJOͷ3&1-ίϯϙʔωϯτ w +FU#SBJOTLPUMJOQMBZHSPVOE w ࣗ༝ʹίʔυॻ͚Δɺ࣮ߦͰ͖Δ w ࣮श՝୊஬৯͍ঢ়ଶͷίʔυ w ग़ྗ w ඪ४ग़ྗPSίϯύΠϧΤϥʔ w +6OJUͷςετ݁Ռ

Slide 13

Slide 13 text

0WFSWJFX w খௗ͞Μͱͷձ࿩6* w 3&1-͔Βฤूதͷίʔυग़ྗΛऔಘ w αʔόʔʹ౤͛ͯ༻ҙͨ͠୆ࢺΛදࣔ w ਖ਼ղͷग़ྗʮͰ͖·ͨ͠ʂʯ w Τϥʔʮؒҧ͑ͪΌ͍·ͨ͠ʜʯ w ͱʹ͔͔͘Θ͍͍ʂʂʂʂʂʂʂʂ

Slide 14

Slide 14 text

ͳͥ࡞Ζ͏ͱࢥͬͨ ,PUMJO࠷ߴʂɹ,PUMJO͔Θ͍͍ʂ ৽ن։ൃ͸,PUMJOҰ୒Ͱ͢ΑͶʔ αϯϓϧίʔυͰ͢ʔ ΄΅,PUMJO "OESPJE։ൃऀ %SPJE,BJHJ ,PUMJOϑΝʔετͰߦͧ͘!*0 ,PUMJOΊͪΌͪ͘Ό޿͕͍ͬͯΔʂˠελʔτΞοϓɾϕϯνϟʔͷੈքݶఆͰ͸

Slide 15

Slide 15 text

ͳͥ࡞Ζ͏ͱࢥͬͨ ,PUMJO࠷ߴʂɹ,PUMJO͔Θ͍͍ʂ +BWBͰΑ͘ͳ͍ʁ ղઆຊগͳ͍Ͱ͢ΑͶʔ "OESPJE,PUMJOॳΊͯ΍Δͱ Ͳͬͪ΋෼͔Βͳͯͭ͘Β͍ ͦΕ͸ͦ͏ Ұา౿Έग़͠੾Εͳ͍ਓʹ΋ ʮ,PUMJO࠷ߴʂʯʮ,PUMJO͔Θ͍͍ʂʯΛ஌ͬͯ΄͍͠ʂ

Slide 16

Slide 16 text

ͳͥ࡞Ζ͏ͱࢥͬͨ ͱΓ͋͑ͣখௗ͞Μͱʮ)FMMP 8PSMEʯͯ͠Έͨ w Ṗͷ೤ҙͰશͯ,PUMJOͰ࣮૷ w ͔Θ͍͗ͨ͢ɹਓͰൃڰͨ͠ w 35͍͍Ͷ w 1͚ͩͰͳ͘ɺ,PUMJOք۾ͷਓ͔Β΋͍͍൓Ԡ খௗ͞ΜͱͷϖΞϓϩ͠ͳ͕ΒษڧͰ͖ΔαΠτ ׂͱधཁ͕͋Γͦ͏ʂɹ͋ͱ๻͕ΊͬͪΌָ͍͠

Slide 17

Slide 17 text

࣮૷ղઆ w αʔόʔαΠυ w ,UPS w ϑϩϯτΤϯυ w w ,PUMJO+4 w LPUMJOQMBZHSPVOE w SFBDISPVUFS w NBUFSJBMVJ w SFBDUTXJQFBCMFWJFXT w SFWFBMKT

Slide 18

Slide 18 text

αʔόʔαΠυ w ,UPSܰྔɾγϯϓϧͳ8FCΞϓϦέʔγϣϯϑϨʔϜϫʔΫ w ެࣜαΠτLUPSJP w "1*αʔόʔͷ։ൃ͕؆୯ʹͰ͖Δ w 3VCZͰ͍͏TJOBUSBɺ1ZUIPOͰ͍͏qBTLతͳཱͪҐஔ w ௥ՃϞδϡʔϧ͕๛෋ɺඞཁͳ͚ͩ௥Ճͯ͠࢖͏ αʔόʔϩάػೳͱ͔

Slide 19

Slide 19 text

,UPSͰ)FMMP 8PSME w ,UPS1SPKFDU(FOFSBUPSͰϓϩδΣΫτͷεέϧτϯੜ੒ ͱΓ͋͑ͣͦͷ··#VJMEԡ͢ˠ[JQ͕߱ͬͯ͘ΔͷͰղౚ

Slide 20

Slide 20 text

,UPSͰ)FMMP 8PSME w "QQMJDBUJPOLUʹϧʔςΟϯάͱϨεϙϯε௥ه fun main(args: Array): Unit = io.ktor.server.netty.EngineMain.main(args) @Suppress("unused") // Referenced in application.conf @kotlin.jvm.JvmOverloads fun Application.module(testing: Boolean = false) { routing { get("/") { call.respondText("Hello, World!”, ContentType.Text.Plain) } } } ίί

Slide 21

Slide 21 text

,UPSͰ)FMMP 8PSME w HSBEMFXSVOΛ࣮ߦˠMPDBMIPTUͰαʔόʔ্ཱ͕ͪΔ $ ./gradlew run Starting a Gradle Daemon, 1 busy and 1 stopped Daemons could not be reused, use --status for details > Task :compileKotlin … $ curl http://localhost:8080 Hello, World! ʻͰ͖·ͨ͠ʂ

Slide 22

Slide 22 text

route("/api/v1") { @Location("/{section}/{task}/task_results") data class TaskResultsParams(val section: String, val task: String, val output: String, val status: String) get { params -> val result = TaskResultService.validate(...) call.respond(HttpStatusCode.OK, result) } @Location("/{section}/{task}/start_conversations") data class StartConversationsParams(val section: String, val task: String) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } @Location("/{section}/{task}/coding_conversations") data class CodingConversationsParams(val section: String, val task: String, val code: String?) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } }

Slide 23

Slide 23 text

route("/api/v1") { @Location("/{section}/{task}/task_results") data class TaskResultsParams(val section: String, val task: String, val output: String, val status: String) get { params -> val result = TaskResultService.validate(...) call.respond(HttpStatusCode.OK, result) } @Location("/{section}/{task}/start_conversations") data class StartConversationsParams(val section: String, val task: String) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } @Location("/{section}/{task}/coding_conversations") data class CodingConversationsParams(val section: String, val task: String, val code: String?) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } } ඪ४ग़ྗͷ஋ʹର͢Δ খௗ͞Μͷฦ౴Λฦ͢"1*

Slide 24

Slide 24 text

route("/api/v1") { @Location("/{section}/{task}/task_results") data class TaskResultsParams(val section: String, val task: String, val output: String, val status: String) get { params -> val result = TaskResultService.validate(...) call.respond(HttpStatusCode.OK, result) } @Location("/{section}/{task}/start_conversations") data class StartConversationsParams(val section: String, val task: String) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } @Location("/{section}/{task}/coding_conversations") data class CodingConversationsParams(val section: String, val task: String, val code: String?) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } } ՝୊Λදࣔͨ͠௚ޙͷ খௗ͞Μͷฦ౴Λฦ͢"1*

Slide 25

Slide 25 text

route("/api/v1") { @Location("/{section}/{task}/task_results") data class TaskResultsParams(val section: String, val task: String, val output: String, val status: String) get { params -> val result = TaskResultService.validate(...) call.respond(HttpStatusCode.OK, result) } @Location("/{section}/{task}/start_conversations") data class StartConversationsParams(val section: String, val task: String) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } @Location("/{section}/{task}/coding_conversations") data class CodingConversationsParams(val section: String, val task: String, val code: String?) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } } ฤूதͷίʔυΛड͚ͯ খௗ͞ΜͷಠΓݴΛฦ͢"1*

Slide 26

Slide 26 text

route("/api/v1") { @Location("/{section}/{task}/task_results") data class TaskResultsParams(val section: String, val task: String, val output: String, val status: String) get { params -> val result = TaskResultService.validate(...) call.respond(HttpStatusCode.OK, result) } @Location("/{section}/{task}/start_conversations") data class StartConversationsParams(val section: String, val task: String) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } @Location("/{section}/{task}/coding_conversations") data class CodingConversationsParams(val section: String, val task: String, val code: String?) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } } ϦΫΤετύϥϝʔλʔʹର͢Δ ܕόϦσʔγϣϯΛઃఆ

Slide 27

Slide 27 text

route("/api/v1") { @Location("/{section}/{task}/task_results") data class TaskResultsParams(val section: String, val task: String, val output: String, val status: String) get { params -> val result = TaskResultService.validate(...) call.respond(HttpStatusCode.OK, result) } @Location("/{section}/{task}/start_conversations") data class StartConversationsParams(val section: String, val task: String) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } @Location("/{section}/{task}/coding_conversations") data class CodingConversationsParams(val section: String, val task: String, val code: String?) get { params -> val conversation = CodingConversationService.build(...) call.respond(HttpStatusCode.OK, conversation) } } ϞδϡʔϧΛ௥Ճ͢Δ͜ͱͰ 0CKFDUˠ+40/΁ͷϚοϐϯάΛ ͋Δఔ౓ ࣗಈԽ

Slide 28

Slide 28 text

ϑϩϯτΤϯυ w ,PUMJO+4,PUMJOΛ+BWBTDSJQUʹτϥϯεύΠε͢ΔϑϨʔϜϫʔΫ w ඪ४ϥΠϒϥϦ w ,PUMJOˠ+4ม׵ͷ(SBEMFϓϥάΠϯ LPUMJOKT w OQN΍8FCQBDLͷίϚϯυΛ(SBEMFܦ༝Ͱ࣮ߦ͢ΔϓϥάΠϯ LPUMJOGSPOUFOEQMVHJO ʻԿ΋Θ͔Βͳ͍Ͱ͢ʜ

Slide 29

Slide 29 text

,PUMJO+4Ͳ͏࢖͏ͷ͔ w (SBEMFʹίϯύΠϧ΍8FCQBDLͷઃఆΛهड़ɺ8FCQBDLίϚϯυ࣮ߦ w HSBEMFXCVJMEˠ,PUMJOΛ+4ʹม׵8FCQBDLͷόϯυϧग़ྗ w HSBEMFXSVOˠม׵όϯυϧग़ྗ8FCQBDLαʔόʔ্ཱͪ͛ w ࠷ऴతͳ੒Ռ෺͕+4ϑΝΠϧʹͳΔ+4ͷϥΠϒϥϦࢿ࢈Λར༻Մ ʻ׬શʹཧղ͠·ͨ͠ʂ

Slide 30

Slide 30 text

+BWBTDSJQU͡Όμϝͳͷʜʁ ͳͥΘ͟Θ͟,PUMJOΛ࢖͏ʁ ܕ҆શͰॻ͖͍ͨΜͰ͢ʂ ࢖͍׳Εͨ,PUMJOͰϑϩϯτ͍ͨ͠ΜͰ͢ʂ 5ZQF4DSJQUͰे෼ͩΖ͏ʁ ͋ͱ܅ɺۀ຿Ͱ3FBDU3FEVY৮͍ͬͯΔ͠ +BWBTDSJQUॻ͚ΔͩΖ͏ʁ Θ͔Δʔʔʔ ɾТɾʆ ਖ਼௚εϐʔυͱ৘ใྔॏࢹͳΒ5ZQF4DSJQU͕࠷దղͩͱࢥ͏ʜ ຊԻ

Slide 31

Slide 31 text

,PUMJO+4͡Όͳ͖ΌμϝͳΜͩ w ͔͠͠ɺখௗ͞Μͷࣗशࣨͷ৔߹ʜ w ʮ΄΅શͯ,PUMJOͰ࡞ΒΕͨ,PUMJOษڧαΠτʯͰΞϐʔϧ͠΍͍͢ʂ w ϓϩμΫγϣϯ؀ڥͰಈ࡞͢Δ,PUMJO+4ΞϓϦͷ࣮ྫʹͳΔʂ w ,PUMJO+4ͷ࣮૷͕,PUMJOͷจ๏࢓༷Λ্खʹ࢖͍ͬͯͯษڧʹͳΔʂ w খௗ͞Μ͕ΊͬͪΌتΜͰ͘ΕΔʂʂʂ ϞνϕʔγϣϯΛอͪ΍͍͢

Slide 32

Slide 32 text

ϑϩϯτΤϯυͷ࣮૷ w ౔୆͸3FBDU3FBDI3PVUFSʹΑΔ41" w 6*ϑϨʔϜϫʔΫ͸.BUFSJBM6*Λར༻ w εϫΠϓ͢Δ6*͸SFBDUTXJQFBCMFWJFXΛར༻

Slide 33

Slide 33 text

ϑϩϯτΤϯυͷ࣮૷ w ίϛϡͷ6*͸SFWFBMKTΛར༻ w )5.-$44ͰͷεϥΠυ࡞੒ w എܠʹNQQOHΛදࣔ w ηϦϑ࿮͸ؤுͬͯ$44ͰτϨʔε w ࡞ͬͨεϥΠυΛJGSBNFʹຒΊࠐΜͰදࣔ

Slide 34

Slide 34 text

ϑϩϯτΤϯυͷ࣮૷ w Ͳ͏΍ͬͯ,PUMJOͰॻ͍ͯΔͷ w 3FBDU+FU#SBJOT͕ϥούʔϥΠϒϥϦΛఏڙ LPUMJOSFBDU class App extends React.Component { render() { return (
Welcome to React with Kotlin
) } } class App : RComponent() { override fun RBuilder.render() { div("title") { +"Welcome to React with Kotlin" } } } 3FBDU ,PUMJO+4

Slide 35

Slide 35 text

ϑϩϯτΤϯυͷ࣮૷ w ͦͷଞ!+T.PEVMFΞϊςʔγϣϯΛ࢖ͬͯ,PUMJOͷੈքʹΠϯϙʔτ w ྫSFBDUTXJQFBCMFWJFXT @JsModule("react-swipeable-views") private external val reactSwipeableViewModule: dynamic fun test() { reactSwipeableViewModule.default.onChangeIndex = { ... } } +4ϥΠϒϥϦΛΠϯϙʔτ PO$IBOHF*OEFYʹ ؔ਺ϦςϥϧΛ୅ೖ

Slide 36

Slide 36 text

ϑϩϯτΤϯυͷ࣮૷ w ͦͷଞ!+T.PEVMFΞϊςʔγϣϯΛ࢖ͬͯ,PUMJOͷੈքʹΠϯϙʔτ w ྫSFBDUTXJQFBCMFWJFXT @JsModule("react-swipeable-views") private external val reactSwipeableViewModule: dynamic fun test() { reactSwipeableViewModule.default.onChangeIndex = { ... } } EZOBNJDܕʜʁ

Slide 37

Slide 37 text

EZOBNJDܕͷ᠘ w EZOBNJD,PUMJOͰ+4ͷΦϒδΣΫτΛͦͷ··ѻ͑Δܕ // { foo: 'foo', bar: { hoge: '111' } }をKotlinで扱う場合 val jsObject: dynamic = js("{ foo: 'foo', bar: { hoge: '111' } }") print(jsObject["foo"]) // => 'foo' print(jsObject["bar"]["hoge"]) // => 111 jsObject["aaa"]["bbb"] = "add from kotlin" print(jsObject["aaa"]["bbb"]) // => add from kotlin

Slide 38

Slide 38 text

EZOBNJDܕͷ᠘ w EZOBNJD,PUMJOͰ+4ͷΦϒδΣΫτΛͦͷ··ѻ͑Δܕ // { foo: 'foo', bar: { hoge: '111' } }をKotlinで扱う場合 val jsObject: dynamic = js("{ foo: 'foo', bar: { hoge: '111' } }") print(jsObject["foo"]) // => 'foo' print(jsObject["bar"]["hoge"]) // => 111 jsObject["aaa"]["bbb"] = "add from kotlin" print(jsObject["aaa"]["bbb"]) // => add from kotlin KT ʜ ϝιου,PUMJOίʔυதʹੜͷ+4ίʔυΛ௚઀ॻ͚Δϝιου

Slide 39

Slide 39 text

EZOBNJDܕͷ᠘ w EZOBNJD,PUMJOͰ+4ͷΦϒδΣΫτΛͦͷ··ѻ͑Δܕ // { foo: 'foo', bar: { hoge: '111' } }をKotlinで扱う場合 val jsObject: dynamic = js("{ foo: 'foo', bar: { hoge: '111' } }") print(jsObject["foo"]) // => 'foo' print(jsObject["bar"]["hoge"]) // => 111 jsObject["aaa"]["bbb"] = "add from kotlin" print(jsObject["aaa"]["bbb"]) // => add from kotlin ଘࡏ͢ΔΩʔͷ஋Λऔͬͯ͘Δ

Slide 40

Slide 40 text

EZOBNJDܕͷ᠘ w EZOBNJD,PUMJOͰ+4ͷΦϒδΣΫτΛͦͷ··ѻ͑Δܕ // { foo: 'foo', bar: { hoge: '111' } }をKotlinで扱う場合 val jsObject: dynamic = js("{ foo: 'foo', bar: { hoge: '111' } }") print(jsObject["foo"]) // => 'foo' print(jsObject["bar"]["hoge"]) // => 111 jsObject["aaa"]["bbb"] = "add from kotlin" print(jsObject["aaa"]["bbb"]) // => add from kotlin ଘࡏ͠ͳ͍Ωʔͷ஋Λ +4ʹ͍ۙจ๏Ͱ୅ೖͰ͖ͯ͠·͏

Slide 41

Slide 41 text

EZOBNJDܕͷ᠘ w EZOBNJD,PUMJOͰ+4ͷΦϒδΣΫτΛͦͷ··ѻ͑Δܕ // { foo: 'foo', bar: { hoge: '111' } }をKotlinで扱う場合 val jsObject: dynamic = js("{ foo: 'foo', bar: { hoge: '111' } }") print(jsObject["foo"]) // => 'foo' print(jsObject["bar"]["hoge"]) // => 111 jsObject["aaa"]["bbb"] = "add from kotlin" print(jsObject["aaa"]["bbb"]) // => add from kotlin ΍ͩʜมͩͶ ,PUMJOΛɺ,PUMJOΛॻ͍ͯͨ͸ͣͳͷʹʜ ͍͔ͭΒ+BWBTDSJQUॻ͍ͯͨΜͩΖ͏ʜ ʜͰ΋ʜࢲʜͨͩʜࢲʜΈΜͳͱʜ

Slide 42

Slide 42 text

EZOBNJDܕͷ᠘ w FYUFSOBMम০ࢠ,PUMJOͷΠϯλʔϑΣʔεͱ+4ͷΦϒδΣΫτΛࣗಈͰ Ϛοϐϯάͯ͘͠ΕΔम০ࢠ external interface TestObject { var foo: String var bar: TestChildObject } external interface TestChildObject { var hoge: String } val jsObject: TestObject = js("{ foo: 'foo', bar: { hoge: '111' } }") print(jsObject.foo) // => 'foo' print(jsObject.bar.hoge) // => 111 5ZQF4DSJQUͷܕఆٛϑΝΠϧͱ ໾ׂ͸ಉ͡

Slide 43

Slide 43 text

EZOBNJDܕͷ᠘ @JsModule("react-swipeable-views") private external val reactSwipeableViewModule: dynamic external interface ReactSwipeableProps : RProps { var index: Int var disabled: Boolean var onChangeIndex: (Int, Int, ChangeReason) -> Unit var onSwitching: (Int, String) -> Unit } fun ReactSwipeableProps.onChangeIndex(block: (Int, Int?, ReasonType?) -> Unit) { onChangeIndex = { index: Int, indexLatest: Int, reason: ChangeReason -> block(index, indexLatest, ReasonType.valueOf(reason.reason)) } }

Slide 44

Slide 44 text

EZOBNJDܕͷ᠘ @JsModule("react-swipeable-views") private external val reactSwipeableViewModule: dynamic external interface ReactSwipeableProps : RProps { var index: Int var disabled: Boolean var onChangeIndex: (Int, Int, ChangeReason) -> Unit var onSwitching: (Int, String) -> Unit } fun ReactSwipeableProps.onChangeIndex(block: (Int, Int?, ReasonType?) -> Unit) { onChangeIndex = { index: Int, indexLatest: Int, reason: ChangeReason -> block(index, indexLatest, ReasonType.valueOf(reason.reason)) } } ʮPO$IBOHF*OEFYʹؔ਺ϦςϥϧΛ୅ೖʯΛ ,PUMJOͬΆ͘ॻ͚ΔΑ͏ʹ֦ͨ͠ுؔ਺

Slide 45

Slide 45 text

.BUFSJBM6*ͱͷಆ͍ w .BUFSJBM6*Ҏ֎ͷϥΠϒϥϦ w ͦ΋ͦ΋খ͍͞ˠߦຬͨͳ͍͘Β͍ͷܕఆٛؔ਺ఆٛͰ0, w .BUFSJBM6* w Λ௒͑Δ6*ίϯϙʔωϯτΛ࣋ͭ w ܧঝؔ܎͕͋ͬͨΓɺ,PUMJO+4ͷ࣮૷Λਂ۷Βͳ͍ͱ࢖͑ͳ͔ͬͨΓ w ϥούʔϥΠϒϥϦ࡞੒ɺ࢖͑ΔΑ͏ʹˠTVCSPILPUMJONBUFSJBMVJ

Slide 46

Slide 46 text

ͦͯ͠ʜ ,PUMJO཰ͷ,PUMJOษڧαΠτ͕஀ੜ ͡Όͳ͍ͷʜλΠτϧ࠮ٗͳͷʜ Ұ෦ϕλॻ͖ͯ͠Δ$44΍+4Λ,PUMJOͰ ੜ੒͢Ε͹ཧ࿦্ୡ੒Մೳ͔ͩΒʜ

Slide 47

Slide 47 text

·ͱΊ w ,PUMJO཰ʹ͍ۙ8FCαΠτΛṖͷ೤ҙͰ࡞ͬͨ w ,UPS͸͙͢ʹ৮ΕΔʂ w ,PUMJO+4͸,PUMJOʹ׳Ε͔ͯΒ৮Δͱ୔ࢁͷൃݟ͕͋Δʂ w ,PUMJO͸͘͢͝ྑ͍ݴޠ w ʮ+BWBͭΒ͍ʯͷଟ͘Λղফɺ։ൃऀͷੜ࢈ੑʹେ͖͘د༩ w ,PUMJO'FTU݄೔։࠵ ෼࿮$G1ఏग़ࡁ

Slide 48

Slide 48 text

)BWFBOJDF,PUMJO XJUI,PUPSJ