import { Link } from "../routes";
import Head from "../components/head";
import Nav from "../components/nav";
import withRedux from "next-redux-wrapper";
import Header from "../components/Header";
import Button from "../components/Button";
import cookies from "next-cookies";
import Text from "../components/Text";
import _ from "lodash";
import { updateEntities, setCurrentUser, initStore } from "../redux/store";
import { getFeaturedProfiles, getCurrentUser } from "../api";
import { bindActionCreators } from "redux";
import { Router } from "../routes";
import PageFooter from "../components/PageFooter";
import withLogin from "../lib/withLogin";
import qs from "qs";
import LazyLoad from "react-lazyload";
import { buildImgSrcSet } from "../lib/imgUri";
import { buildProfileURL } from "../lib/routeHelpers";
import LoginGate, { LOGIN_STATUSES } from "../components/LoginGate";
import Divider from "../components/Divider";
import { SPACING } from "../helpers/styles";

// This is not saved in git 150x over because I don't want this repo to be huge.
(function () {
  const FeaturedProfile = ({ profile }) => {
    return (
      <Link route={buildProfileURL(profile.id)}>
        <a className="Profile">
          <img src={_.first(profile.photos)} srcSet={buildImgSrcSet(_.first(profile.photos), 250)} />
          <div className="Text">
            <div className="Title">
              <Text font="sans-serif" lineHeight="20px" weight="semiBold" size="18px" color="#000">
                {profile.name}
              </Text>
            </div>

            <div className="Tagline">
              <Text size="14px">{(profile.tagline || "").substr(0, 100)}</Text>
            </div>
          </div>
          <style jsx>{`
            .Profile {
              background-color: #ffffff;
              cursor: pointer;
              text-decoration: none;
              text-align: left;
              width: 100%;
              height: 100%;
              border-radius: 6px;
              display: flex;
              flex-shrink: 0;
              flex-grow: 0;
              flex-direction: column;
            }

            .Text {
              flex: 1;
            }

            .Profile:hover img {
              opacity: 0.85;
            }

            .Title {
              margin-top: 1rem;
              margin-bottom: 0.5rem;
            }

            .Tagline {
              margin-bottom: 1.5rem;
            }

            img {
              object-fit: cover;
              flex: 0 0 250px;
              flex-shrink: 0;
              display: flex;
              width: 250px;
              height: 250px;
              opacity: 1;
              transition: opacity 0.1s linear;
            }

            @media (max-width: 500px) {
              .Profile {
                margin-bottom: 2em;
              }
            }
          `}</style>
        </a>
      </Link>
    );
  };

  class SignupForm extends React.Component {
    constructor(props) {
      super(props);

      this.state = {
        email: this.props.email || "",
      };
    }

    setEmail = evt => this.setState({ email: evt.target.value });

    componentDidMount() {
      Router.prefetchRoute(`/sign-up/verify`);
    }

    handleSubmit = evt => {
      evt.preventDefault();

      Router.pushRoute(`/sign-up/verify?${qs.stringify({ email: this.state.email })}`);
    };

    render() {
      return (
        <form onSubmit={this.handleSubmit}>
          <input
            type="email"
            name="email"
            autoComplete="email"
            onChange={this.setEmail}
            placeholder="Your email"
            value={this.state.email}
          />
          <Button componentType="button" inline>
            CREATE MY PAGE
          </Button>

          <style jsx>{`
            form {
              display: flex;
            }

            input {
              font-size: 14px;
              padding: 14px 22px;
              border-radius: 33px;
              border-top-right-radius: 0;
              border-bottom-right-radius: 0;
              border: 1px solid #bababa;
              border-right: 0px;
              line-height: 18px;
              color: #000;
              outline: none;
              width: auto;
              display: flex;
              flex: 1;
            }

            input::-webkit-input-placeholder {
              color: #c5cbd4;
            }

            input:focus {
              border-color: #b0b0b0;
            }
          `}</style>
        </form>
      );
    }
  }

  class Homepage extends React.Component {
    constructor(props) {
      super(props);

      this.state = {
        isLoadingProfiles: true,
        profiles: [],
      };
    }

    static async getInitialProps(ctx) {
      if (ctx.isServer && ctx.req.path === "/") {
        const { currentUserId } = cookies(ctx);

        if (currentUserId) {
          ctx.res.writeHead(302, {
            Location: `${process.env.DOMAIN}/welcome`,
          });

          ctx.res.end();
          ctx.res.finished = true;
        }
      }
    }

    async componentDidMount() {
      const profileResponse = await getFeaturedProfiles();
      this.props.updateEntities(profileResponse.body);

      this.setState({
        isLoadingProfiles: false,
        profiles: profileResponse.body.data,
      });

      Router.prefetchRoute(`/lucy`);
    }

    render() {
      return (
        <div>
          <Head
            title="Apply to Date – your own game of The Bachelor(ette)"
            url={`${process.env.DOMAIN}/`}
            disableGoogle={false}
          />
          <Header />
          <article>
            <main>
              <div className="Copy">
                <img className="Logo Logo-Home" src="/static/animatedlogo.gif" />
                <div className="Copy-title">
                  <Text font="serif" size="36px" lineHeight="44px" weight="bold">
                    Your own game of The Bachelor(ette)
                  </Text>
                </div>
                <div className="Copy-body">
                  <Text size="16px" lineHeight="24px" font="sans-serif">
                    Create a page where people apply to go on a date with you. You pick the winners.
                  </Text>
                </div>

                {!this.props.currentUserId && <SignupForm />}

                <div className="AppStoreContainer">
                  <Divider height={`${SPACING.normal}px`} color="transparent" />
                  <a
                    className="AppStore AppStore--ios"
                    target="_blank"
                    href="https://itunes.apple.com/us/app/apply-to-date/id1357419725?mt=8"
                  >
                    <img src="https://devimages-cdn.apple.com/app-store/marketing/guidelines/images/badge-download-on-the-app-store.svg" />
                  </a>

                  <a
                    target="_blank"
                    className="AppStore AppStore--android"
                    href="https://play.google.com/store/apps/details?id=com.shipfirstlabs.applytodate&utm_source=homepage&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"
                  >
                    <img
                      alt="Get it on Google Play"
                      src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png"
                    />
                  </a>
                </div>
              </div>
            </main>
          </article>

          <footer>
            <div className="divider" />

            <Text size="36px" font="sans-serif" color="#000">
              Featured pages
            </Text>

            <div className="FeaturedProfiles-wrapper">
              {this.state.isLoadingProfiles && <div className="Spinner" />}
              <div className="FeaturedProfiles">
                {!_.isEmpty(this.state.profiles) &&
                  this.state.profiles.map(profile => <FeaturedProfile key={profile.id} profile={profile} />)}
              </div>
            </div>
          </footer>

          <article>
            <PageFooter center />
          </article>
          <style jsx>{`
            article {
              max-width: 710px;
              margin-left: auto;
              margin-right: auto;
              padding-left: 14px;
              padding-right: 14px;
              overflow-x: hidden;
            }

            main {
              display: flex;
              margin-top: 6rem;
              margin-bottom: 6rem;

              justify-content: center;
            }

            footer {
              display: flex;
              flex-direction: column;
              text-align: center;
              overflow-x: hidden;
            }

            .divider {
              height: 2px;
              width: 269px;
              margin-bottom: 6rem;
              margin-left: auto;
              margin-right: auto;
              background-color: #0aca9b;
            }

            .Logo-Home {
              margin-left: auto;
              margin-right: auto;
              width: 97px;
              height: 152.02px;
              margin-bottom: 28px;
            }

            .Copy {
              max-width: 710px;
              margin: 0 auto;
              text-align: center;
            }

            .Copy-body {
              margin-top: 1rem;
              margin-bottom: 2rem;
              font-weight: 200;
            }

            .FeaturedProfiles-wrapper {
              padding-top: 4rem;
              padding-bottom: 6rem;
              padding-left: 28px;
              padding-right: 28px;

              overflow-x: auto;
              width: 100vw;
            }

            .Spinner {
              display: flex;
              content: "";
              margin: 84px auto;
              height: 28px;
              width: 28px;
              animation: rotate 0.8s infinite linear;
              border: 4px solid #4be1ab;
              border-right-color: transparent;
              border-radius: 50%;
            }

            .AppStoreContainer {
              display: flex;
              justify-content: center;
              align-items: center;
            }

            .AppStore--ios img {
              width: 180px;
            }

            .AppStore--android img {
              width: 230px;
            }

            @keyframes rotate {
              0% {
                transform: rotate(0deg);
              }
              100% {
                transform: rotate(360deg);
              }
            }

            .FeaturedProfiles {
              display: grid;
              grid-column-gap: 2rem;
              grid-row-gap: 2rem;
              text-align: center;
              justify-content: center;
              margin-left: auto;
              margin-right: auto;
              grid-template-columns: 250px 250px 250px 250px;
            }

            @media (max-width: 1100px) {
              .FeaturedProfiles {
                grid-template-columns: 250px 250px 250px;
              }
            }

            @media (max-width: 900px) {
              .FeaturedProfiles {
                grid-template-columns: 250px 250px;
              }
            }

            @media (max-width: 554px) {
              .FeaturedProfiles-wrapper {
                padding-left: 14px;
                padding-right: 14px;
              }

              .AppStoreContainer {
                flex-direction: column;
              }

              .FeaturedProfiles {
                grid-auto-flow: row dense;
                grid-auto-rows: auto;
                grid-template-columns: 250px;
                grid-template-rows: 1fr;
                justify-content: center;
              }
            }
          `}</style>
        </div>
      );
    }
  }

  const HomepageWithStore = withRedux(initStore, null, dispatch =>
    bindActionCreators({ updateEntities, setCurrentUser }, dispatch),
  )(LoginGate(Homepage));
})();
l'>repl</option>
<option value='request-body-stream'>request-body-stream</option>
<option value='reserve-commands'>reserve-commands</option>
<option value='revert-5167-dylan/decode-regex-if-needed'>revert-5167-dylan/decode-regex-if-needed</option>
<option value='rfc/bun-bundler-api'>rfc/bun-bundler-api</option>
<option value='rfc/bunfig-overhaul'>rfc/bunfig-overhaul</option>
<option value='save-in-update'>save-in-update</option>
<option value='sdl'>sdl</option>
<option value='test/action'>test/action</option>
<option value='types/mock'>types/mock</option>
<option value='types/readable-stream-default'>types/readable-stream-default</option>
<option value='types/tty'>types/tty</option>
<option value='u/vjpr/zig-0.10'>u/vjpr/zig-0.10</option>
<option value='xHyroM/types/expose-Bun-Env'>xHyroM/types/expose-Bun-Env</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Unnamed repository; edit this file 'description' to name the repository.</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/ansg191/bun/about/?h=jarred/postgresql'>about</a><a href='/ansg191/bun/?h=jarred/postgresql'>summary</a><a href='/ansg191/bun/refs/?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f'>refs</a><a class='active' href='/ansg191/bun/log/src/bun.js/builtins/cpp/ReadableStreamDefaultReaderBuiltins.cpp?h=jarred/postgresql&amp;follow=1'>log</a><a href='/ansg191/bun/tree/src/bun.js/builtins/cpp/ReadableStreamDefaultReaderBuiltins.cpp?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f'>tree</a><a href='/ansg191/bun/commit/src/bun.js/builtins/cpp/ReadableStreamDefaultReaderBuiltins.cpp?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;follow=1'>commit</a><a href='/ansg191/bun/diff/src/bun.js/builtins/cpp/ReadableStreamDefaultReaderBuiltins.cpp?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;follow=1'>diff</a></td><td class='form'><form class='right' method='get' action='/ansg191/bun/log/src/bun.js/builtins/cpp/ReadableStreamDefaultReaderBuiltins.cpp'>
<input type='hidden' name='h' value='jarred/postgresql'/><input type='hidden' name='id' value='288178e94c7ca93f026c70f0b0cd4fb32c63e98f'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/ansg191/bun/log/?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;follow=1'>root</a>/<a href='/ansg191/bun/log/src?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;follow=1'>src</a>/<a href='/ansg191/bun/log/src/bun.js?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;follow=1'>bun.js</a>/<a href='/ansg191/bun/log/src/bun.js/builtins?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;follow=1'>builtins</a>/<a href='/ansg191/bun/log/src/bun.js/builtins/cpp?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;follow=1'>cpp</a>/<a href='/ansg191/bun/log/src/bun.js/builtins/cpp/ReadableStreamDefaultReaderBuiltins.cpp?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;follow=1'>ReadableStreamDefaultReaderBuiltins.cpp</a> (<a href='/ansg191/bun/log/src/bun.js/builtins/cpp/ReadableStreamDefaultReaderBuiltins.cpp?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f'>unfollow</a>)</div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/ansg191/bun/log/src/bun.js/builtins/cpp/ReadableStreamDefaultReaderBuiltins.cpp?h=jarred/postgresql&amp;id=288178e94c7ca93f026c70f0b0cd4fb32c63e98f&amp;showmsg=1&amp;follow=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>
<tr><td><span title='2022-07-05 00:54:56 -0700'>2022-07-05</span></td><td><a href='/ansg191/bun/commit/packages/bun-framework-next/server.development.tsx?h=jarred/postgresql&amp;id=ebb4f85feb4c2d064cc7a9aea94c9d8a949f4fd5&amp;follow=1'>[bun-framework-next] Bump</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>4</td><td><span class='deletions'>-5</span>/<span class='insertions'>+5</span></td></tr>
<tr><td><span title='2022-07-05 00:54:42 -0700'>2022-07-05</span></td><td><a href='/ansg191/bun/commit/bench/sqlite/download-northwind.sh?h=jarred/postgresql&amp;id=f5527c976e20cb60b977cc1b21df079f3e388cc9&amp;follow=1'>Clean up some benchmarks</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>5</td><td><span class='deletions'>-3</span>/<span class='insertions'>+102</span></td></tr>
<tr><td><span title='2022-07-04 18:06:30 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/bench/react-hello-world.node.jsx?h=jarred/postgresql&amp;id=ab7f57239d65901daf2a45951d267702578d3c67&amp;follow=1'>[bench] react hello world</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>4</td><td><span class='deletions'>-8</span>/<span class='insertions'>+220</span></td></tr>
<tr><td><span title='2022-07-04 17:36:20 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/Dockerfile?h=jarred/postgresql&amp;id=a8221356032cb8e24614b252a2deda1ab494f00e&amp;follow=1'>Update Dockerfile</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr>
<tr><td><span title='2022-07-04 17:32:19 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/misctools/headers-cleaner.js?h=jarred/postgresql&amp;id=6190dc5da51b9a79086585789dffd5cffceedbbd&amp;follow=1'>[internal] Don't need to run jsc-bindings-headers in CI</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>2</td><td><span class='deletions'>-12</span>/<span class='insertions'>+1</span></td></tr>
<tr><td><span title='2022-07-04 17:26:46 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/misctools/headers-cleaner.js?h=jarred/postgresql&amp;id=090a913660694c822b6e855dd4cc94782b02bf6a&amp;follow=1'>once more</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+4</span></td></tr>
<tr><td><span title='2022-07-04 17:23:43 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/misctools/headers-cleaner.js?h=jarred/postgresql&amp;id=db2f1019715125a1d0e830db75b794366c85c14d&amp;follow=1'>[internal] Fix build script on old node</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-0</span>/<span class='insertions'>+7</span></td></tr>
<tr><td><span title='2022-07-04 17:17:29 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/runtime.footer.bun.js?h=jarred/postgresql&amp;id=41f4302d394a6d2696a2f7b3a6ab98474270bfa5&amp;follow=1'>Handle global require("string")</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>4</td><td><span class='deletions'>-19</span>/<span class='insertions'>+30</span></td></tr>
<tr><td><span title='2022-07-04 17:17:11 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/test/bun.js/react-dom.test.tsx?h=jarred/postgresql&amp;id=91cada219bb9283189e71072cfa0ce4f6f30bc5b&amp;follow=1'>Fix case in dynamic require()</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>2</td><td><span class='deletions'>-5</span>/<span class='insertions'>+24</span></td></tr>
<tr><td><span title='2022-07-04 16:47:34 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/deps/libuwsockets.cpp?h=jarred/postgresql&amp;id=7d3459f53d095b46b327a1725600f59e5a36934c&amp;follow=1'>[internal] Fix duplicate symbol issue</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-3</span>/<span class='insertions'>+0</span></td></tr>
<tr><td><span title='2022-07-04 16:46:17 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/package.json?h=jarred/postgresql&amp;id=cf4c9912c3c1800efdc0427221b654de6f41265f&amp;follow=1'>Fix npm peer dep issue</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>2</td><td><span class='deletions'>-2</span>/<span class='insertions'>+3</span></td></tr>
<tr><td><span title='2022-07-04 16:41:16 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/bench/react-hello-world.jsx?h=jarred/postgresql&amp;id=b685cd49a6360f55ad2752c5225fad8fe2ac0f05&amp;follow=1'>[bench] Add a react ssr hello world</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>2</td><td><span class='deletions'>-0</span>/<span class='insertions'>+37</span></td></tr>
<tr><td><span title='2022-07-04 16:39:55 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/bun.lockb?h=jarred/postgresql&amp;id=9c960fcafd52d6206c958d3e7791f72c6a059632&amp;follow=1'>Update bun.lockb</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-0</span>/<span class='insertions'>+0</span></td></tr>
<tr><td><span title='2022-07-04 16:39:48 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/README.md?h=jarred/postgresql&amp;id=4acc0351cf7dbf5266f1deac9903acc44f416bcf&amp;follow=1'>Update README.md</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-15</span>/<span class='insertions'>+6</span></td></tr>
<tr><td><span title='2022-07-04 16:39:33 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/test/bun.js/resolve.test.js?h=jarred/postgresql&amp;id=2f212d1386051dfb690532f03414ff34e2381ec1&amp;follow=1'>[resolver] Add a test for self-referencing package.json exports</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-0</span>/<span class='insertions'>+44</span></td></tr>
<tr><td><span title='2022-07-04 16:39:05 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/Dockerfile.base?h=jarred/postgresql&amp;id=1e54e94cc2a2c83ba81e67eb7a54058aa0aa78ff&amp;follow=1'>Bump docker build of webkit</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr>
<tr><td><span title='2022-07-04 16:38:45 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/test/bun.js/react-dom.test.tsx?h=jarred/postgresql&amp;id=48f64bc6e5fade5410413d31d0f17e9802a3917b&amp;follow=1'>[itnernal] Cleanup some of the streams code</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>7</td><td><span class='deletions'>-792</span>/<span class='insertions'>+846</span></td></tr>
<tr><td><span title='2022-07-04 16:36:51 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/bun.js/bindings/bindings.zig?h=jarred/postgresql&amp;id=667303fc861afaa33ceb273a1e1652c7cd706879&amp;follow=1'>[internal] Add a note explaining what to do if this fails</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-0</span>/<span class='insertions'>+4</span></td></tr>
<tr><td><span title='2022-07-04 16:36:28 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/bun.js/bindings/bindings.cpp?h=jarred/postgresql&amp;id=6768db9a6e14b03980a8b9119d01c9cfd9390e83&amp;follow=1'>[jsc] Handle promise ownership (might revert this)</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-3</span>/<span class='insertions'>+8</span></td></tr>
<tr><td><span title='2022-07-04 16:35:11 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/bun.js/bindings/bindings.cpp?h=jarred/postgresql&amp;id=d516e3523b7233ebff14e62606eb75e47707f65f&amp;follow=1'>[jsc] Run JSC's deferredWorkTimer sometimes</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr>
<tr><td><span title='2022-07-04 16:34:42 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/bun.js/bindings/bindings.cpp?h=jarred/postgresql&amp;id=a6d4283986c27bb20ac2a23e827f09ba415e814a&amp;follow=1'>[jsc] Attempt to make detecting ArrayBuffer/Uint8Array faster</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-13</span>/<span class='insertions'>+128</span></td></tr>
<tr><td><span title='2022-07-04 16:34:08 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/bun.js/api/server.zig?h=jarred/postgresql&amp;id=abd9d8bcab2eb3bb33c0f1df73e71ecf188ef8f1&amp;follow=1'>[server] Clean up some of the logic for freeing ReadableStream</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-3</span>/<span class='insertions'>+30</span></td></tr>
<tr><td><span title='2022-07-04 16:33:39 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/__global.zig?h=jarred/postgresql&amp;id=430532feec153628293e9e509cafe1c7886933c0&amp;follow=1'>Update __global.zig</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>1</td><td><span class='deletions'>-4</span>/<span class='insertions'>+4</span></td></tr>
<tr><td><span title='2022-07-04 08:42:29 -0700'>2022-07-04</span></td><td><a href='/ansg191/bun/commit/src/bun.js/javascript.zig?h=jarred/postgresql&amp;id=cf5939c425ac72fef23448d0dcd68ae0aa59ef73&amp;follow=1'>[jsc] Make JSC own the memory for source code strings</a></td><td><img src='//www.gravatar.com/avatar/5145ad1d8bb861137d85da7a3e32ef36?s=13&amp;d=retro' width='13' height='13' alt='Gravatar' /> Jarred Sumner
</td><td>2</td><td><span class='deletions'>-19</span>/<span class='insertions'>+40</span></td></tr>
