- They are doing it gradually
- They use
Noun
instead ofEntity
to name the graphql entities - So far migrated
User
andTweet
nouns - Struggled with de-duplicating response
- Plan is to migrate gradually
- They use Strato, their internal technology for virtual federated database, to power all graphql queries by plugging Strato with FB's Thrift services which provides them type safety
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {foo, bar} from '../foo-bar'; | |
import * as abc from '../util' | |
import * as https from 'https' | |
describe("asdf", () => { | |
test("foo", async () => { | |
jest.spyOn(https, 'request').mockImplementation(() => jest.fn() as any); | |
await foo('https://example.org'); | |
expect(https.request).toHaveBeenCalledWith('https://example.org'); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
angular | |
.module('app', []) | |
.config(config); | |
config.$inject = ['$provide']; | |
function config($provide) { |
- Canary Deployments: Route a subset of users to new version as part of CD process. We can leverage it for AB test and Perf testing. As an advanatge we already have RC environment. We can make it default for internal live/ combine it with Octopus-Skipper setup to put very small weights of live users and create monitors to measure exact targeted KPIs Depending on the KPI numbers we can either make it live version or roll it back. This will allow faster deployment cycle with better quality and confidence We can use the information about rollout or rollbacks as a feedback to improve the process in future https://www.infoq.com/news/2013/03/canary-release-improve-quality
RSS-heapUsed-heapAllocated memory in Node: https://www.dynatrace.com/blog/understanding-garbage-collection-and-hunting-memory-leaks-in-node-js/ V8 Garbage collection: http://jayconrod.com/posts/55/a-tour-of-v8-garbage-collection
-
Node.js, TC-39, and Modules: https://hackernoon.com/node-js-tc-39-and-modules-a1118aecf95e
-
defense-of-dot-js/proposal.md: https://github.com/dherman/defense-of-dot-js/blob/master/proposal.md
// Run docker image in interactive mode
docker run -it <image name>:<image tag>
// Run docker image in interactive mode with host port 8080 mapped to container port 80
docker run -it -p 8080:80 <image name>:<image tag>
// Run docker with the 3001 port exposed,
docker run -it --expose=3001 <image name>:<image tag>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function forEach(arr, callback, start=0) { | |
if (0 < start && start < arr.length) { | |
callback(arr[start], start, arr); | |
return forEach(arr, callback, start + 1); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A pure function to find key from object, matching a predicate | |
* similar to https://lodash.com/docs/4.17.4#findKey or Array.findIndex() | |
* @param {Object} obj: The object to find the specified key from | |
* @param {Function} fn: The predicate function | |
*/ | |
const findKey = (obj, fn) => Object.keys(obj).find(k => fn(obj[k])); | |
//Test code |
NewerOlder