Skip to content

Instantly share code, notes, and snippets.

View jamesreggio's full-sized avatar

James Reggio jamesreggio

View GitHub Profile
@jamesreggio
jamesreggio / react-native-ios-cookie-jar-0.50.3.patch
Created January 3, 2018 15:33
Patch to revert non-standard iOS cookie jar behavior on React Native v0.50.3
@jamesreggio
jamesreggio / react-native-xhr-default-withcredentials-0.50.3.patch
Created January 3, 2018 15:39
Patch to fix the default value of `XMLHttpRequest.withCredentials` option on React Native v0.50.3
From 15d2d187e745eed8c13e5132798de03920c39db0 Mon Sep 17 00:00:00 2001
From: James Reggio <james.reggio@gmail.com>
Date: Thu, 16 Nov 2017 19:58:31 -0500
Subject: [PATCH] make XMLHttpRequest.withCredentials default to false, per
spec
---
Libraries/Network/XMLHttpRequest.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@jamesreggio
jamesreggio / apollo-cache-hermes-overlapping-fragments-test.ts
Created January 18, 2018 00:02
Regression test for loss of data with overlapping fragments in apollo-cache-hermes
import { GraphSnapshot } from '../../../../../src/GraphSnapshot';
import { createSnapshot } from '../../../../helpers';
describe(`overlapping fragments`, () => {
let snapshot: GraphSnapshot;
beforeAll(() => {
const cyclicRefQuery = `
query {
myDetailedBar {
...DetailedBarFragment
@jamesreggio
jamesreggio / metro-minify-uglify+0.28.0.patch
Created February 28, 2018 16:08
Patch for metro-minify-uglify@0.28.0 to support Babel 7
patch-package
--- a/node_modules/metro-minify-uglify/src/minifier.js
+++ b/node_modules/metro-minify-uglify/src/minifier.js
@@ -34,7 +34,7 @@ filename)
function minify(inputCode, inputMap) {
const result = uglify.minify(inputCode, {
- mangle: { toplevel: true },
+ mangle: { toplevel: true, safari10: true },
output: {
@jamesreggio
jamesreggio / metro+0.28.0.patch
Last active February 28, 2018 19:48
Patch for metro@0.28.0 to support Babel 7
patch-package
--- a/node_modules/metro/src/babel-bridge.js
+++ b/node_modules/metro/src/babel-bridge.js
@@ -13,7 +13,7 @@
// This is a temporary migration bridge to switch between babel 6 and 7
-const IS_BABEL7 = process.env.BABEL_VERSION === '7';
+const IS_BABEL7 = true;
@jamesreggio
jamesreggio / react-native+0.53.3.patch
Created February 28, 2018 20:01
Patch for react-native@0.53.3 to support Babel 7
patch-package
--- a/node_modules/react-native/Libraries/Alert/AlertIOS.js
+++ b/node_modules/react-native/Libraries/Alert/AlertIOS.js
@@ -122,11 +122,11 @@ class AlertIOS {
'keyboardType) and the old syntax will be removed in a future version.');
var callback = type;
- var defaultValue = message;
+ var _defaultValue = message;
RCTAlertManager.alertWithArgs({
@jamesreggio
jamesreggio / error.txt
Created May 21, 2018 14:08
Repro for apollo-cache-inmemory stack overflow issue
RangeError: Maximum call stack size exceeded
at Array.forEach (native)
at merge (blob:file:///71f10210-bc6a-4c31-bb2d-281064e4b98f:64781:24)
at blob:file:///71f10210-bc6a-4c31-bb2d-281064e4b98f:64787:11
at Array.forEach (native)
at merge (blob:file:///71f10210-bc6a-4c31-bb2d-281064e4b98f:64781:24)
at blob:file:///71f10210-bc6a-4c31-bb2d-281064e4b98f:64787:11
at Array.forEach (native)
at merge (blob:file:///71f10210-bc6a-4c31-bb2d-281064e4b98f:64781:24)
at blob:file:///71f10210-bc6a-4c31-bb2d-281064e4b98f:64787:11
@jamesreggio
jamesreggio / example.js
Created June 5, 2018 18:24
MetaQuery example in reply to @gunar
const ProductsQueryWithConfigurableFragment = `
query {
products {
...ProductFragment
}
}
`;
const SlimProductFragment = `
fragment ProductFragment on Product {
@jamesreggio
jamesreggio / SFSafariViewController-radars.md
Last active August 17, 2018 05:32
Summary of bugs in SFSafariViewController affecting adoption within the Twitter iOS client

In the process of evaluating the suitability of SFSafariViewController (SFSVC) for use within the Twitter iOS client, I encountered a number of bugs with differing severities, all of which I filed as Radars in Apple's bug reporting tool. Here is my attempt to holistically document their impact on our ability to adopt SFSafariViewController as a replacement for our existing WebViews.

Highest Severity

The fundamental blocker is Radar

@jamesreggio
jamesreggio / patch-react-redux-forwardRef.sh
Last active August 24, 2018 18:35
Self-applying patch to work around react-redux#914 (invariant failures when using `connect` upon a component wrapped in `React.forwardRef`)
#!/bin/sh
###############################################################################
# USAGE
###############################################################################
# 1. Install the `react-is` package in your project with
# `npm i --save react-is` or `yarn add react-is`.
#
# 2. Place this script in the root of your repository, alongside `package.json`.
#