Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
はじめてのTypeScript × はじめてのChrome拡張 / frontend_lt t...
Search
rs_tukki
February 21, 2022
Programming
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
はじめてのTypeScript × はじめてのChrome拡張 / frontend_lt typescript and chrome-extension
rs_tukki
February 21, 2022
More Decks by rs_tukki
See All by rs_tukki
設計初心者のための「伝わる」フロー図 / How to draw a communicative flow diagram for beginners
rs_tukki
1
890
Twelve-Factor Appで読み解く、モダンなアプリの理想とレガシーなアプリの現実 / Rakus Meetup Tokyo 5 Twelve Factor App
rs_tukki
4
2.5k
Other Decks in Programming
See All in Programming
Jetpack Compose Mechanisms
skydoves
3
820
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
The Rails Doctrine Decade
koic
2
590
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
APNsからLive Activityを開始する話
yumnumm
0
170
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
Workers Cache を知る
syumai
0
360
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
640
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
Featured
See All Featured
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
67k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
So, you think you're a good person
axbom
PRO
2
2.2k
Side Projects
sachag
456
43k
30 Presentation Tips
portentint
PRO
1
430
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Amusing Abliteration
ianozsvald
1
350
Transcript
はじめてのTypeScript × はじめてのChrome拡張 2022/02/16(水) フロントエンドLT会 - vol.6 #frontendlt 株式会社ラクス 矢須健太
自己紹介 • 矢須健太(@rs_tukki) 株式会社ラクス Androidアプリ開発担当 (4月で)新卒6年目
Java/JavaScript/Kotlin Spring Boot/Apache Cordova • 趣味 旅行/野球観戦 etc.. Youtube巡り
今回の話題
何分初心者なので
TypeScriptとは • Microsoftが開発したプログラミング言語 • AltJs(そのままでは使用できず、コンパイルすることで JavaScriptとして使用できる言語)の一種 • メリット1:静的型付け言語(=型が存在する) • メリット2:JavaScriptのモダンな機能を使える
• メリット3:JavaScriptを拡張した言語であるため、 JavaScriptからほぼそのまま移行可能
Chrome拡張とは • Google Chromeの機能を追加・強化するアドオン • 主にフロント側の技術(html/CSS/JavaScript)で動作する • Chrome ウェブストアから様々な拡張機能をDL可能
以前作成したChrome拡張 • https://qiita.com/rs_tukki/items/9de350e6276c40f54fc4 • ただし、これはただのJquery
何故TypeScript? • なんかかっこいいから • 今後、よりスタンダードな開発言語になっていくから Webフロントエンドの開発現場では採用増加傾向 弊社でも9年物のプロダクトをTypeScript移行した事例あり
https://speakerdeck.com/eichisanden/trouble-free-typescript- migration また、ReactNativeでのモバイルアプリ開発や Node.jsを利用したサーバサイド開発でも広がりを見せる • →TypeScriptが使えて当たり前!な状況が来るかも……
ミニマムなChrome拡張の構成
manifest.json
TypeScriptの環境構築 • 開発環境 Visual Studio Code(VSCode) スクリプト言語の開発に特化したソースコードエディタ
比較的簡単にTypeScriptの実行環境を構築できる Node.js(npm) TypeScriptそのものや環境構築用の依存ライブラリの導入に使う Webpack JavaScriptのモジュールバンドラ TypeScriptをJavaScriptにコンパイルしたり、 リリース用のモジュールを作成したりするのに使う
TypeScriptの環境構築 • package.json
TypeScriptの環境構築 • tsconfig.json
TypeScriptの環境構築 • webpack.config.json
実装(script.ts)
作成した拡張機能の適用 • コマンド実行 npm install npx webpack
作成した拡張機能の適用
動作確認 • https://github.com/rs-tukki/youtube-contents-coloring • https://www.youtube.com/feed/subscriptions
まとめ • Chrome拡張は(やることを選べば)思ったより簡単 サイトによってはDOM操作が極悪だったりも • TypeScriptは思ったより難しい…… イメージとしてはJavaに対するKotlinのような立ち位置?
コンパイルできる環境を整えるのが一苦労 とはいえ型の違いがコーディング中に一発で分かるため便利 (静的型付け言語ならではのメリット) • TypeScript学習のスタートとして拡張機能を作るのはあり 皆もChrome拡張、やろう!
ご清聴ありがとうございました。 • 参考: https://qiita.com/rs_tukki/items/9de350e6276c40f54fc4 https://codezine.jp/article/detail/15148 https://qiita.com/GRGSIBERIA/items/b8cd4a2b3635d1bb0391
https://qiita.com/ryokkkke/items/390647a7c26933940470 https://numb86-tech.hatenablog.com/entry/2020/07/11/160159 https://qiita.com/tetradice/items/b89a5dd41fcebf96379e https://qiita.com/ginokinh/items/d4e1a9134c215d0ea701 https://goworkship.com/magazine/how-to-webpack/ https://blog.chick-p.work/chrome-extensions-typescript/ https://qiita.com/SoraKumo/items/5d92b15d06778458f5e1 https://reviews.f-tools.net/Add-On/Jisaku-Tuika.html