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
パッケージのバージョンを一気に上げてつらかった話
Search
clngn
September 22, 2018
0
170
パッケージのバージョンを一気に上げてつらかった話
clngn
September 22, 2018
Tweet
Share
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Git: the NoSQL Database
bkeepers
PRO
431
65k
The Pragmatic Product Professional
lauravandoore
36
6.8k
A Tale of Four Properties
chriscoyier
160
23k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Mobile First: as difficult as doing things right
swwweet
223
9.9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Optimizing for Happiness
mojombo
379
70k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
Building an army of robots
kneath
306
45k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
The Invisible Side of Design
smashingmag
301
51k
Transcript
パッケージのバージョンを一気に上げてつらかった話 @clngn
つらかったこと1: lintが落ちる
基本は‑‑fix できないものも結構ある 一気にやってしまうとcommitがひどいことになる レビュアーの死 ‑> eslintの‑‑ruleオプションを使って地道に確認しつつ潰していく ‑> git diffの‑‑name‑onlyオプションでパイプを繋いだりして工夫する $
git diff --name-only src | xargs $(npm bin)/eslint --rule '"indent": [1, 4]' --no-eslintrc --parser babel-eslint --fix
つらかったこと2: テストが落ちる
window.document以下を上書きしている テストの実行順やディレクトリ指定で結果が変わる ‑> テストランナーのbefore/afterフックでwindowオブジェクトを戻すようにする stub,mockをちゃんと使えてない sinon restore忘れ、spy,stub,mockの使い分け ‑> 実コードと合わせて知見をドキュメントにまとめて共有 この辺の概念は資料だけで理解しづらいのでフォローアップをちゃんとする
ライブラリの挙動が変わった enzymeのlifecycleなど ちゃんとドキュメントを読む
つらかったこと3: react‑router v4
v2 ‑> v4 ‑> がんばりましょう https://github.com/ReactTraining/react‑router/blob/master/packages/react‑ router/docs/guides/migrating.md props.params ‑> props.match.paramsとか
複雑なルーティングをpath‑to‑regexpに直す ‑> 設計段階でシンプルなルーティングを意識する
おしまい