Slide 1

Slide 1 text

react-nativeͷΞϓϦͰ fl ow-typed͔ΒTypeScriptʹ Ҡߦ͢ΔࡍʹऔΓ૊Μͩ͜ͱ mrtry 2021/11/10

Slide 2

Slide 2 text

ࣗݾ঺հ • ͱΒ͍(@mrtry) • Yamamoto Shinnosuke • גࣜձࣾJMDC (tech lead)

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

react-nativeͱ͸ • ReactͰ͍ΖΜͳPlatformͷΞϓϦέʔγϣϯ͕ͭ͘ΕΔ͘Μ • ͍͍ͩͨwebͱಉ͡ςϯγϣϯͰϞόΠϧΞϓϦͷ࣮૷͕Ͱ͖Δ

Slide 5

Slide 5 text

Hello, world

Slide 6

Slide 6 text

Ϧιʔε଍Γͳ͍͚ͲϞόΠϧΞϓϦ΄͍͠ʂ • WebϑΝʔετͰαʔϏεϦϦʔεͨ͠ • ۀ຿ҕୗͷਓ(1໊)ʹ͓ئ͍͠ɺΞϓϦΛޙ௥͍Ͱग़ͨ͠

Slide 7

Slide 7 text

Ϧιʔε଍Γͳ͍͚ͲϞόΠϧΞϓϦ΄͍͠ʂ • ձࣾʮΞϓϦͷPV૿͖͔͑ͯͨΒɺ։ൃνʔϜ࡞ͬͯ಺੡͍ͨ͠ʯ • ࢲʮԶ͕Ұਓ໨ʹͳΔʂʂʂʂʂʂ̍̍̍̍ʯ

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

fl ow-typed 
 + JavaScript ౰࣌ɺTS࠾༻͸গͳΊͩͬͨ

Slide 10

Slide 10 text

ͭΒ͍

Slide 11

Slide 11 text

ϥΠϒϥϦʹ fl ow-typedͷܕ͍ͭͯͳ͍

Slide 12

Slide 12 text

อक͕೉͍͠ • ϥΠϒϥϦಋೖͨ࣌͠ʹյΕ͕ͪ & ຐվ଄͕ͪ͠ • react-nativeͷΞοϓσʔτͰઃఆյΕ͕ͪ • ͪΌΜͱߋ৽ͯ͠ͳ͍ͱES6ͱ͔࢖͑ͳ͍

Slide 13

Slide 13 text

fl ow-typedΛTypeScriptʹ͢Δઓ͍͕࢝·ͬͨ

Slide 14

Slide 14 text

Ҡߦͷखॱ

Slide 15

Slide 15 text

Ҡߦͷखॱ 1. σΟϨΫτϦઓུΛݟ௚ͨ͠ 2. ConverterͰશίʔυΛTSԽͨ͠ 3. खಈͰίϯύΠϧΤϥʔΛ௵͍ͯ͘͠

Slide 16

Slide 16 text

σΟϨΫτϦઓུΛݟ௚ͨ͠

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

ࡉ෼Խ͞Εͯͳ͍ 
 Component 😇 σΟϨΫτϦ௚ʹ͍ͬͺ͍ ࠶ར༻͋·Γ͞Εͯͳ͍ ap p !"" component s # !"" AnimatedProgressCircle.j s # !"" AnnounceItemView.j s # !"" BarChart.j s # !"" CaloriePieChartPanelView.j s # !"" CarouselView.j s # !"" Chart.j s # !"" ChartTabBar.j s # !"" ChartView.j s # !"" DailyRecordBloodGlucoseView.j s # !"" DailyRecordBloodPressureView.j s # !"" DailyRecordBodyFatPercentageView.j s # !"" DailyRecordBodyTemperatureView.j s # !"" DailyRecordHeartRateView.j s # !"" DailyRecordHistoryView.j s # !"" DailyRecordListItemView.j s # !"" DailyRecordMealView.j s # !"" DailyRecordSleepView.j s # !"" DailyRecordWaistView.j s # !"" DailyRecordWeightView.j s # !"" DateInputTable.j s # !"" DateSpecificationBar.j s # !"" GoalWeightBar.j s # !"" HealthNewsItemView.j s # !"" InputButtonView.j s # !"" InputFooter.j s # !"" InputTable.j s # !"" KeyboardSpace.j s # !"" LineChart.j s # !"" LoginFormTable.j s # !"" MainTabBar.j s # !"" MealGridImageView.j s # !"" MealInputImageView.j s # !"" MealSectionHeader.j s # !"" MyDataTabBar.j s # !"" PepUpDatePicker.android.j s # !"" PepUpDatePicker.ios.j s # !"" PepUpDatePickerProps.j s # !"" PepUpSituationPicker.android.j s # !"" PepUpSituationPicker.ios.j s # !"" PickerInputTable.j s # !"" PieChartPanel.j s # !"" ProgressCircle.j s # !"" SleepBarChart.j s # !"" SortableListItem.j s # !"" StepPieChartPanelView.j s # !"" SummaryPanel.j s # !"" SummaryView.j s # !"" TextInputForTcomb.j s # %"" ValidateFormComponent.j s !"" container s # !"" DailyRecordChartSelectionScreen.j s # !"" DailyRecordDetailScreen.j s # !"" DailyRecordIconsView.j s # !"" DailyRecordInputScreen.j s # !"" DailyRecordMealDetailScreen.j s # !"" DailyRecordMealScreen.j s # !"" DailyRecordPreferenceScreen.j s # !"" GoalPreferenceScreen.j s # !"" HomeScreen.j s # !"" IndicatorView.j s # !"" InputStackNavigatorScreen.j s # !"" LicenseScreen.j s # !"" LoginIDConfigScreen.j s # !"" LoginScreen.j s # !"" MainTabNavigatorScreen.j s # !"" MealCamera.j s # !"" MealCameraRoll.j s # !"" MealEditScreen.j s # !"" MealInputScreen.j s # !"" MealPhotoTabNavigatorScreen.j s # !"" MedicineNotebookConfigScreen.j s # !"" MyDataDailyRecordScreen.j s # !"" MyDataMedicineHistoryScreen.j s # !"" MyDataMedicineNotebookScreen.j s # !"" MyDataTabNavigatorScreen.j s # !"" NotificationConfScreen.j s # !"" OtherMenusScreen.j s # !"" PasswordConfigScreen.j s # !"" PepUpRootNavigatorScreen.j s # !"" PepUpStackNavigatorScreen.j s # !"" PepUpWebView.j s # !"" ProfileCameraRoll.j s # !"" ProfileScreen.j s # !"" QrCameraScreen.j s # !"" SetupLocaleScreen.j s # !"" StartScreen.j s # !"" TermsOfUseView.j s # %"" TwoFactorAuthenticationScreen.js

Slide 19

Slide 19 text

Fat Component 😇 render : 15L͙Β͍ ϩδοΫ: 400L͙Β͍

Slide 20

Slide 20 text

σΟϨΫτϦઓུΛݟ௚ͨ͠ • 1σΟϨΫτϦ͋ͨΓͷϑΝΠϧ਺͕͑͛ͭͳ͍ • ֤छ࣮૷΋Fat Component 
 → TypeScriptԽͨ͠ͱ͖ʹɺࠩ෼ಡΉͷͭΒͦ͏ → ࠩ෼Λݟ΍͘͢͢ΔͨΊɺσΟϨΫτϦઓུΛݟ௚ͨ͠

Slide 21

Slide 21 text

sr c !"" asset s !"" component s # !"" legac y # !"" page s # %"" uipart s !"" domain s # !"" common s # !"" object s # %"" service s !"" locale s !"" routes %"" store s !"" action s !"" reducer s !"" statu s %"" storage s ap p !"" action s !"" asset s !"" component s !"" container s !"" cor e !"" locale s !"" model s !"" reducer s !"" saga s %"" storage #FGPSF"GUFS

Slide 22

Slide 22 text

sr c !"" asset s !"" component s # !"" legac y # !"" page s # %"" uipart s !"" domain s # !"" common s # !"" object s # %"" service s !"" locale s !"" routes %"" store s !"" action s !"" reducer s !"" statu s %"" storage s ap p !"" action s !"" asset s !"" component s !"" container s !"" cor e !"" locale s !"" model s !"" reducer s !"" saga s %"" storage #FGPSF"GUFS

Slide 23

Slide 23 text

src/component s !"" page s # !"" Hom e # # !"" index.tsx //Page૬౰ # # !"" template.tsx //Template૬౰ # # !"" stories.ts x # # %"" uiparts //Organisms૬౰ # # !"" ArticleLis t # # !"" NotificationIco n # # !"" ImportantNotifications   # # %"" … # %"" … %"" uiparts // Atoms/Molecules૬౰ !"" Butto n !"" Tex t !"" … ࠷ۙͷσΟϨΫτϦߏ੒

Slide 24

Slide 24 text

͍ͭͰʹɺΑ͔ͬͨ͜ͱ🥳 • Fat Component͕ੜ·Εʹ͘͘ͳͬͨ • ద੾ͳେ͖͞ͷComponentͷج४͕Ͱ͖ͨ • UI Componentͷʮ࢖͍·Θ͠౓߹͍ʯ͕Θ͔Γ΍͘͢ͳͬͨ • ൚༻తͳ΋ͷ: uipartsҎԼ • ઐ༻తͳ΋ͷ: pages/uipartsҎԼ

Slide 25

Slide 25 text

sr c !"" asset s !"" component s # !"" legac y # !"" page s # %"" uipart s !"" domain s # !"" common s # !"" object s # %"" service s !"" locale s !"" routes %"" store s !"" action s !"" reducer s !"" statu s %"" storage s ap p !"" action s !"" asset s !"" component s !"" container s !"" cor e !"" locale s !"" model s !"" reducer s !"" saga s %"" storage #FGPSF"GUFS

Slide 26

Slide 26 text

ࠩ෼௥͑ͦ͏ͳؾ͕͖ͯͨ͠

Slide 27

Slide 27 text

ConverterͰશίʔυΛTSԽͨ͠

Slide 28

Slide 28 text

ConverterͰશίʔυΛTSԽͨ͠ zxbodya/ fl owts Λ࢖ͬͯɺͻͱ·ͣશ෦ίʔυTSԽͨ͠

Slide 29

Slide 29 text

खಈͰίϯύΠϧΤϥʔΛ௵ͯ͘͠

Slide 30

Slide 30 text

खಈͰίϯύΠϧΤϥʔΛ௵ͯ͘͠ • ؾ߹ɺࠜੑɺ΍͍͖ͬͯ 💪 • null / unde fi ned ͷෆ੔߹͕͍ͬͺ͍Ͱͨ 🙏 • ͜ͷ࡞ۀ͚ͩͰɺͲΕ͚ͩTSͷ͋Γ͕ͨΈΛײ͔ͨ͡…🥺 • ίϯύΠϧΤϥʔղফʹ౒ΊɺϦϑΝΫλϦϯά͸͠ͳ͍ • όάͬͨ࣌ʹ໎ٶೖΓ͠΍͍͢ͷͰɺҰ୴͖͋ΒΊΔ

Slide 31

Slide 31 text

̍ϲ݄͙Β͍ઓͬͨ

Slide 32

Slide 32 text

ແࣄ΍Γ͖ͬͨ

Slide 33

Slide 33 text

Α͔ͬͨ͜ͱ🥳 • ϥΠϒϥϦͷίʔυʹܕ͕ͭ͘Α͏ʹͳͬͨ • react-nativeͷupdate͕͠΍͘͢ͳͬͨ • ͢΂ͯͷϑΝΠϧͰܕνΣοΫͰ͖ΔΑ͏ʹͳͬͨ • IDE͕ΊͬͪΌॿ͚ͯ͘ΕΔΑ͏ʹͳͬͨ

Slide 34

Slide 34 text

No content