profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/captbaritone/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Jordan Eldredge captbaritone @facebook Alameda, CA https://jordaneldredge.com JavaScript dork.

1j01/98 492

💿 Web-based Windows 98 desktop recreation █████▓█▓▓▒▓▒▒░▒░░░🗕︎🗗︎🗙︎

captbaritone/codeception-mailcatcher-module 105

Test emails in your Codeception acceptance tests

captbaritone/better-indent-support-for-php-with-html 49

This script allows you to indent HTML sections in PHP files

captbaritone/awesome-atwoods-law 14

A curated list of applications reimplemented in JavaScript

afahim/eslint-plugin-underscore-lodash-compatibility 9

Make sure your code can use underscore and lodash interchangeably.

aaronabramov/haste_map 6

jest-haste-map fork written in rust

captbaritone/butterchurn 3

Butterchurn is a WebGL implementation of the Milkdrop Visualizer

captbaritone/clusterfach-py 3

A recommendation engine

captbaritone/album-cover-generator 2

Randomly generated album covers

captbaritone/acorn 1

A small, fast, JavaScript-based JavaScript parser

issue commentfacebook/relay

Hack Idea: Runtime Relay Compiler

The idea would be to allow people to try it out in their own app without needing to setup the compiler or Babel transform.

For trying out a demo app we have https://codesandbox.io/s/relay-sandbox-nxl7i?file=/src/TodoApp.tsx

Good point about the pain of spinning up a server being a big pain point. Are there any public GraphQL servers that have permissive CORS headers?

captbaritone

comment created time in 6 days

push eventcaptbaritone/webamp

The Stranjer

commit sha 8f773f6362ba1337f3431f7727da7151ca6762b2

Make ./deploy.sh executable (#1117)

view details

push time in 6 days

PR merged captbaritone/webamp

Make ./deploy.sh executable

This is a codeless pull request, if you can believe that. It changes ./deploy.sh to be executable right out the gate. I had to chmod +x ./deploy.sh before running it here, and I think that's less than ideal.

+0 -0

0 comment

1 changed file

TheStranjer

pr closed time in 6 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha 5cfebda18c8403b6a0091041e2b3f7f520c56cf2

Don't purge component tailwind classes

view details

push time in 7 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha 801c37d35177f0b20b660f4e7f38146a292971f4

Hide some projects which either fell offline or don't seem worth promoting

view details

Jordan Eldredge

commit sha 5322a911524ef91e3c4e35914d30be23b4bd1739

Clean up projects page

view details

Jordan Eldredge

commit sha 259211a8dd9b751374a0d373d23f95770dec839e

Update avatar

view details

Jordan Eldredge

commit sha e324d1440329431558ffc5a6bf2b6ea0c276917c

Add post description

view details

Jordan Eldredge

commit sha 008055c8fb19d94fe82fb49334618db440e7584f

Indicate selected page

view details

Jordan Eldredge

commit sha 2da17acab2196945aa9d89172b3be808b7538468

Copy js for nextjs site

view details

Jordan Eldredge

commit sha 4cb0070b184dd08359caef740f86b8521c9f24c0

Remove unused CSS

view details

Jordan Eldredge

commit sha 890e4ceebb96cb82621ccc3c6acfb4dca693ea65

Enable tailwind purge

view details

Jordan Eldredge

commit sha f96543da84a49aa364ef9d02ff6eeb55b6ac9aa6

Ignore static files copied into nextjs

view details

Jordan Eldredge

commit sha a5a36d9c7e0f689061dfb5f953948da06cf80663

Expose favicon to nextjs

view details

push time in 7 days

pull request commentcaptbaritone/webamp

Turn 'status' CSS class into 'webamp-status'

Thanks! I'll cut a release tonight or tomorrow.

TheStranjer

comment created time in 7 days

push eventcaptbaritone/webamp

The Stranjer

commit sha 32ab0d0d1a48887a26e795dcd79c5af15e779978

Turn 'status' CSS class into 'webamp-status' (#1116)

view details

push time in 7 days

PR merged captbaritone/webamp

Turn 'status' CSS class into 'webamp-status'

This is my first attempt at replacing the status CSS class of the <div> within main-window to webamp-status. It appears to work, and it certainly fixed the problem for me when I uploaded my local build onto my site, but this naturally merits some code review.

Background For Those Unaware: There was a weird bug I encountered when I tried to run a copy of this with soapbox-fe, written by @alexgleason, which precluded me from dragging the main window around on the page. This addresses that... and, hopefully, breaks nothing else.

+11 -11

2 comments

3 changed files

TheStranjer

pr closed time in 7 days

pull request commentcaptbaritone/webamp

Turn 'status' CSS class into 'webamp-status'

I think there's one more place to catch: https://github.com/captbaritone/webamp/blob/master/packages/webamp/js/components/Skin.tsx#L113

TheStranjer

comment created time in 7 days

issue commentfacebook/relay

Hack Idea: Runtime Relay Compiler

@poteto made a great point internally, that this is basically a solution in search of a problem. It presupposes that build tooling setup is a meaningful impediment to adoption, which may or may not actually be true. Additionally, there are many other impediments (poor documentation generally for example) which this would not help address.

So one thing that I'd appreciate the communities feedback on is: Do you have any reason to believe/doubt that build tooling setup is a significant impediment to people trying out, and eventually adopting Relay?

captbaritone

comment created time in 7 days

issue openedfacebook/relay

Hack Idea: Runtime Relay Compiler

In this issue I'm proposing an in-browser version of the Relay compiler which could allow people to try out Relay (with some restrictions) without needing to setup Babel transform or compiler. I'm curious to hear from the community how valuable (or not) and option like this would be given the limitations.


Motivation: We believe that Relay’s main impediment to broader OSS adoption, and thus broader industry impact is the complexity of the initial setup. The largest part of this is the requirement that new users must get the compiler and Babel transform working for their code base before they even start to try Relay. If we could allow users to try Relay’s APIs first and only configure the compiler and Babel transform after/if they are convinced of its value, we could increase our industry impact.

Hypothesis If a user can abide by the following restrictions, we can support most of Relay’s existing APIs.

  1. All graphql tagged template literals must be in the module scope
  2. Schema must be available at runtime
  3. No TypeScript/Flow support
  4. No code is lazily loaded*

Summary: We could provide a new NPM module which exposes a custom graphql tagged template literal which collects module scoped GraphQL strings and — right before we begin rendering — transforms them to Relay runtime modules using a Wasm version of the compiler.

Proposed Implementation

We create a new NPM module which exposes a graphql tagged template and a compile(schema: string) function. The new module maintains a module scope registry (map object) from each GraphQL document string to that document’s runtime object. When the graphql tagged template is called it immediately creates an empty object (to be mutated later), adds it to the registry and returns that empty object.

After all modules have been loaded, but before we start to render — for example right before the initial render of the app — the user must call the new module’s compile(schema) function.

When the compile(schema) function is called, it collects up all the documents that have been seen so far and the schema string and calls a method on a Wasm version of the compiler. The compiler returns an array of strings (one for each document, in the same order), each string contains the JavaScript for that document’s runtime module. Those modules are eval()ed and the resulting module is merged into the empty object (Object.assign()) created by the call to the graphql tagged template.

The result is that the in-browser compiler would have access to all GraphQL documents and by the time any of the Relay runtime data is read by Relay, it would be available.

Rough Code for the New Module:

import * as wasm from 'relay-compiler-playground';

const DOCUMENT_MAP = {};

function graphql(args) {
  const text = args[0];
  const runtimeValue = {};
  DOCUMENT_MAP[text] = runtimeValue;
  return runtimeValue;
}

export function compile(schema) {
  const docs = [];
  const runtimes = [];
  for (const [doc, runtime] of Object.entries(DOCUMENT_MAP)) {
    docs.push(doc);
    runtimes.push(runtime);
  }
  const compiled = wasm.compile(schema, docs);
  compiled.forEach((runtime, i) => {
    Object.assign(runtimes[i], runtime);
  });
}

export default graphql;

A Component Using the New Module

import { useLazyLoadQuery } from 'react-relay/hooks';
import graphql from 'NEW_MODULE'; // Differet import
import Issues from './Issues';
import React from 'react';

// Only constraint: We define the query in module scope
const QUERY = graphql`
  query HomeRootIssuesQuery($owner: String!, $name: String!) {
    repository(owner: $owner, name: $name) {
      ...Issues_repository
    }
  }
`;

export default function HomeRoot() {
  const data = useLazyLoadQuery(QUERY, {
    owner: 'facebook',
    name: 'relay',
  });
  const { repository } = data;

  return <Issues repository={repository} />;
}

A Project Root Using the New Module

import React from 'react';
import ReactDOM from 'react-dom';
import { RelayEnvironmentProvider } from 'react-relay/hooks';
import RelayEnvironment from './RelayEnvironment';
import HomeRoot from './HomeRoot';

// These three lines can be removed once
// you upgrade to the real compiler
import { compile } from 'NEW_MODULE';
import SCHEMA from './schema';
compile(SCHEMA);

ReactDOM.createRoot(document.getElementById('root')).render(
  <RelayEnvironmentProvider environment={RelayEnvironment}>
    <React.Suspense fallback={'Loading...'}>
      <HomeRoot />
    </React.Suspense>
  </RelayEnvironmentProvider>,
);

Arguments In Favor

Features of this proposal:

  1. Can be implemented as a separate module and does not involve any changes to the Relay Runtime
  2. Upgrading to the real compiler — once you have the build-time stuff setup — is just a matter of changing how you import the graphql tagged template and removing the runtime call to compile(schema)

Arguments Against

Reasons we might not want to consider this proposal:

  1. Part of Relay’s value proposition is the entrypoints-like behavior where code and data are loaded in parallel. This is not possible to implement without lazy loading component code and thus would not work with this simple proposal. (That said, it may be possible to allow lazy loaded components by rerunning the compiler after each entrypoint is loaded)
  2. Relay features which create non-type imports/require calls in the runtime module would not work, and it may be difficult to communicate that limitation.
  3. Compiler errors would need to be presented in the console and could not point directly to file/line numbers
  4. Optimizations like lazy module evaluation would break this approach

Overall, the limitations of this setup might be too complex to communicate via documentation or runtime checks.

created time in 7 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha 81c0fc8e2a63201c3e717768e45d542b899bc930

Enable trailing slashes

view details

push time in 7 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha c81683d00bf7edfe4284d23aa5c473e9b30f0472

Try to fix redirects again (add a few more)

view details

push time in 7 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha 8ca37f7cc67b763bcc6c03c31a57b517b3df74cd

Upgrade nextjs and try to fix rewrites

view details

push time in 7 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha 501f37bfc0f93397b6095c9c16a31204d78abf80

Move next.config.js home

view details

push time in 8 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha c94e633e4b40ab360916a5953e71c5a6de3c8426

Delete old

view details

push time in 8 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha d713f6e3b76ddcb13bbb3518e4e3021ac4731156

Try adding back next.config.js

view details

push time in 8 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha c43ea9887303ce946fec68431883ea3685e2a2eb

Update caniuse

view details

Jordan Eldredge

commit sha 68a42fc7d12d1895a0196a65b091498f1a86450b

Try moving next.config.js

view details

push time in 8 days

push eventcaptbaritone/jordaneldredge.com

Jordan Eldredge

commit sha 0fa31fb57970faed54fc088054c89a38bba1d54c

Clean up project links

view details

Jordan Eldredge

commit sha 044446119815fd3dba483af5c6d92f3b4fa1ca80

Update contacts

view details

Jordan Eldredge

commit sha 24190849efc5418b1c98b36019874db6328b93ba

Update about page

view details

Jordan Eldredge

commit sha 0eddd663536391eb91c817790a15fc85fd96695d

Try proxy rewrite

view details

Jordan Eldredge

commit sha 598a881ef7ab69b39036f2dd07e3a9c83263743b

Add DateString component

view details

push time in 8 days

fork captbaritone/relay-examples

A collection of sample Relay applications

fork in 8 days

push eventcaptbaritone/webamp

Jordan Eldredge

commit sha 3b09d2f8b1fa72239f12f59aba66a386ec45e817

Pixelated rendering for modern skins

view details

push time in 11 days

push eventcaptbaritone/webamp

Jordan Eldredge

commit sha be2361906fbd0668e8c6425e0175eb4c408bba4c

For ui resources with duplicate ids, last value wins

view details

push time in 11 days

push eventcaptbaritone/webamp

Jordan Eldredge

commit sha 40e3231568b6472089b835fe22a37695a12c59d5

Format and import GuiObj

view details

Jordan Eldredge

commit sha 38df61fbd2741b8521909ee1b95f15ff1d8bccc7

Add lint rule for maki types

view details

Jordan Eldredge

commit sha 9fd8206e1fa8ffd12e878b0f41ff8f83f05a7d72

Cleanup

view details

Jordan Eldredge

commit sha 262ce28fcd5b13cf0ba413d0be2a37e48a465d1a

Ignore extracted files

view details

push time in 11 days

push eventcaptbaritone/relay

Jordan Eldredge

commit sha 9604d50be9257a74f2367226d5252d3a4ba346d1

Update website to indicate community chat has moved from Slack to Discord

view details

push time in 13 days

PR opened facebook/relay

Update website to indicate community chat has moved from Slack to Discord

My understanding is the the Slack server is moving to Discord, and I think it makes sense to move with them.

Screen Shot 2021-07-15 at 2 19 11 PM

+3 -8

0 comment

1 changed file

pr created time in 13 days

create barnchcaptbaritone/relay

branch : discord

created branch time in 13 days

issue commentfacebook/docusaurus

🐛 Prerendering fails when dependency includes `new URL('empty.js', import.meta.url);`

Thank you for this @slorber! (sorry for the very slow reply). I was able to get it working using this approach! I very much appreciate you taking the time to work with me to unravel this.

captbaritone

comment created time in 13 days

issue closedvim-awesome/vim-awesome

What happened to the server?

What happended to the server? I can't ping vimawesome.com anymore.

closed time in 13 days

TornaxO7

issue commentvim-awesome/vim-awesome

What happened to the server?

Site seems back up for me.

TornaxO7

comment created time in 13 days

issue commentvim-awesome/vim-awesome

What happened to the server?

I'm not sure who owns (owned?) the domain. Maybe @sophiebits?

TornaxO7

comment created time in 19 days