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
Dart Macrosに願いを [YOUTRUST x ゆめみ Flutter LT会@渋谷 #4]
Search
tatsubee
December 08, 2023
0
330
Dart Macrosに願いを [YOUTRUST x ゆめみ Flutter LT会@渋谷 #4]
tatsubee
December 08, 2023
Tweet
Share
More Decks by tatsubee
See All by tatsubee
SwiftPM マルチモジュール構成への第一歩
shoryuyamamoto
0
1.1k
TCA with UIKit [TCAでわいわいLT会]
shoryuyamamoto
1
370
riverpodを理解したい
shoryuyamamoto
0
54
pixiv-iosを破壊したい #pixivmeetup
shoryuyamamoto
0
950
キャッチアップ!The Composable Architecture
shoryuyamamoto
1
310
Featured
See All Featured
Making Projects Easy
brettharned
109
5.5k
Being A Developer After 40
akosma
66
580k
A Philosophy of Restraint
colly
197
16k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
8
1.3k
How STYLIGHT went responsive
nonsquared
92
4.8k
Designing with Data
zakiwarfel
96
4.8k
Automating Front-end Workflow
addyosmani
1357
200k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
The Cult of Friendly URLs
andyhume
74
5.7k
A Tale of Four Properties
chriscoyier
152
22k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
123
39k
Transcript
Presented by 辰べえ 2023.11.04 Presented by 辰べえ Dart Macrosに願いを
自己紹介 • 23新卒 • 福岡生まれ 福岡育ち 東京在住 • 最近やっていること ◦
お絵描き ◦ テニス ◦ iOS 辰べえ iOSエンジニア 自己紹介 • 23新卒 • 福岡生まれ 福岡育ち 東京在住 • 最近やっていること ◦ お絵描き ◦ テニス ◦ iOS 辰べえ iOSエンジニア 2
build_runner使っていますか? 3
build_runnerとは Dartでコードを生成するためのパッケージ build_runnerを活用して作られたパッケージの例 • json_serializable • freezed • openapi_generator などなど 4
build_runnerの課題 • コマンドの実行が必要 _fvm flutter pub run build_runner build –delete-conflicting-outputs_
◦ Hot Reloadの生産性を損ねる • xxx.g.dartが生成されてしまう • コマンドを実行してエラーが出るまで構文のミス に気付けない 5
課題を解決する(かもしれない) Dartの新機能 → 6
7 Dart Macros
Dart Macrosとは Dartで議論が進められている言語機能 https://github.com/dart-lang/language/blob/main/working/macros macroアノテーションをつけることで、コンパイル時 に対応したコードを生やすことができる build_runnerでできることが、より快適にできる 8
Dart Macrosの存在する未来 9
Dart Macrosの存在する未来 • Hot Reloadするだけでほしいコードが生える • 自動生成されたコードはいい感じに隠される ◦ 見たいときにはコードを表示できる •
静的解析で構文のミスを見つけられる 10
(おまけ1) Swift Macrosの活用例 11
12 Swift Macrosの活用例
(おまけ2) 宣伝 13
より快適なFlutterライフを! 14 [宣伝] Flutter Advent Calendar 9日目
より快適なFlutterライフを! 15