タグ

ブックマーク / overreacted.io (7)

  • npm audit: Broken by Design — overreacted

    Security is important. Nobody wants to be the person advocating for less security. So nobody wants to say it. But somebody has to say it. So I guess I’ll say it. The way npm audit works is broken. Its rollout as a default after every npm install was rushed, inconsiderate, and inadequate for the front-end tooling. Have you heard the story about the boy who cried wolf? Spoiler alert: the wolf eats t

    efcl
    efcl 2021/07/11
    devDependenciesとして使うツールにおけるnpm auditの報告のほとんどがReDoSの脆弱性になってしまっている問題について。 本番で動くdependenciesのみをチェックする`npm audit --production`、公開するパッケージをインライン化する方法と
  • What Are the React Team Principles? — overreacted

    What Are the React Team Principles?December 25, 2019 During my time on the React team, I’ve been lucky to see how Jordan, Sebastian, Sophie and other tenured team members approach problems. In this post, I’m distilling what I learned from them into a few high-level technical principles. These principles aren’t meant to be exhaustive. This is my personal attempt to formalize observations about how

    efcl
    efcl 2019/12/31
    Reactコアチームの原則 APIの前にUIでプロトタイピングして、抽象化を探す。 複雑さをReactd絵九州する、エスケープハッチを用意して観測する、理論を信用する
  • useEffect完全ガイド

    あなたは Hooks を使って複数のコンポーネントを書きました。ちょっとしたアプリも作ったことがあるでしょう。満足もしている。API にも慣れて、その過程でコツも掴んできました。しかも重複したロジックを転用できるよう Custom Hooks を作り、同僚に自慢して見たり。 でも useEffect を使う度、いまいちピンときません。class のライフサイクルとは似ているけど、何かが違う。そしていろんな疑問を抱き始めます。 🤔 componentDidMount を useEffect で再現する方法は? 🤔 useEffect 内で正確に非同期処理を行う方法とは? []ってなに? 🤔 関数をエフェクトの依存関係として記すべき? 🤔 非同期処理の無限ループがたまに起こるのはなぜ? 🤔 古い state か props がエフェクト内にたまに入るのはなぜ? 私も Hooks を使

    efcl
    efcl 2019/11/24
    A Complete Guide to useEffectの翻訳
  • Algebraic Effects for the Rest of Us

    Have you heard about algebraic effects? My first attempts to figure out what they are or why I should care about them were unsuccessful. I found a few pdfs but they only confused me more. (There’s something about academic pdfs that makes me sleepy.) But my colleague Sebastian kept referring to them as a mental model for some things we do inside of React. (Sebastian works on the React team and came

    efcl
    efcl 2019/07/22
    JavaScript風味の言語でのAlgebraic Effectsのポイント解説。 try-catch and throw的に上に伝搬するだけじゃなくて、それを`haddle`することができ`resume`して処理を戻すことができることで、メインの処理の分離、割り込みを差し込める点
  • A Complete Guide to useEffect — overreacted

    You wrote a few components with Hooks. Maybe even a small app. You’re mostly satisfied. You’re comfortable with the API and picked up a few tricks along the way. You even made some custom Hooks to extract repetitive logic (300 lines gone!) and showed it off to your colleagues. “Great job”, they said. But sometimes when you useEffect, the pieces don’t quite fit together. You have a nagging feeling

    efcl
    efcl 2019/03/12
    React Hooksの`useEffect`の動作や使い方、よくある質問について
  • Why Do React Hooks Rely on Call Order? - Overreacted

    At React Conf 2018, the React team presented the Hooks proposal. If you’d like to understand what Hooks are and what problems they solve, check out our talks introducing them and my follow-up article addressing common misconceptions. Chances are you won’t like Hooks at first: They’re like a music record that grows on you only after a few good listens: When you read the docs, don’t miss the most im

    efcl
    efcl 2018/12/14
    ReactのHooksがなぜ呼び出し順に依存しているかについて。
  • How Does React Tell a Class from a Function?

    Consider this Greeting component which is defined as a function: function Greeting() { return <p>Hello</p>; } React also supports defining it as a class: class Greeting extends React.Component { render() { return <p>Hello</p>; } } (Until recently, that was the only way to use features like state.) When you want to render a <Greeting />, you don’t care how it’s defined: // Class or function — whate

    efcl
    efcl 2018/12/04
    Reactが関数とクラスで書かれたコンポーネントを呼び分ける必要があるため、内部でどのように判別しているかについての解説
  • 1