Skip to content

Instantly share code, notes, and snippets.

@karanjthakkar
karanjthakkar / notes.md
Last active September 24, 2018 11:31
Notes from React Native EU

Turbo Modules

  • The current native modules (aka bridge modules) architecture has some flaws:
    • There is no way to defer its initalization to the future since the native modules registry needs to compute methods of all native modules at runtime.
    • Inbuilt (inside react native core) or custom (written by user) native modules cannot be stripped from final build if unused
    • Currently, synchronously calling native module methods is possible but is not really recommended because Chrome Debugger does not support it
  • Turbo modules (react-native-community/discussions-and-proposals#11) solves most of these problems:
    • There is an idea in the proposal to generate Obj C/Java classes using native module shape defined with flow types (or potentially any type system, like typescript) at build time. This removes the initialization step completely since the native code already knows the shape of the native module.
  • As such, native modules that are not used in user land code wi
@karanjthakkar
karanjthakkar / detox-ios.log
Created September 20, 2018 20:17
Detox Xcode10 install error
This file has been truncated, but you can view the full file.
User defaults from command line:
IDEDerivedDataPathOverride = /Users/karanthakkar/Library/Detox/ios/3b8bf121e33a47a46e6d2ca92c7d743d2d56b3cf/DetoxBuild
Build settings from command line:
BUILD_DIR = /Users/karanthakkar/Library/Detox/ios/3b8bf121e33a47a46e6d2ca92c7d743d2d56b3cf/DetoxBuild/Build/Products
note: Using new build system
note: Planning build
note: Constructing build description
WriteAuxiliaryFile /Users/karanthakkar/Library/Detox/ios/3b8bf121e33a47a46e6d2ca92c7d743d2d56b3cf/DetoxBuild/Build/Intermediates.noindex/Detox.build/Release-iphoneos/DetoxFramework.build/Script-3941F4F61DC6203000F23DAC.sh (in target: DetoxFramework)
@karanjthakkar
karanjthakkar / base64-image.txt
Created May 5, 2017 20:53
Base64 image encoded data from headless chrome
/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAJYAlgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+eL/hYV3ev57XKgkglcL0z657/wCfQdLY/EK5dWVbhcKAAMKcn9OlfmPY/GKWNsPcEr0xuPX3B/l2Nd5pHxesxKjte4B+8pJGcjjJ6dicD/Gv5zxHBGYwjzexnp8PLa19F5tfdffc/rPA+IGUTaj7enqlzOfLFX0/G3T19T9HYPHDBXBnVpMe3fJJ/X68Vl3P
@karanjthakkar
karanjthakkar / keystate.js
Created November 9, 2016 04:53
Khalid keystate example
/*eslint fp/no-unused-expression: 0, fp/no-nil: 0 */
const Keystate = {
rightPressedKey: false,
leftPressedKey: false,
spacePressedKey: false,
rPressedKey: false,
addListeners: function() {
document.addEventListener("keyup", e => {
if (e.keyCode === 37) {
Keystate.leftPressedKey = false;
{
"name": "crowdfire",
"version": "1.0.2",
"description": "Growth partner",
"private": true,
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
@karanjthakkar
karanjthakkar / template.hbs
Created July 30, 2015 12:40
List View Helper Template
{{each-view-user-item users
primaryAction='follow'
twitterLeftSubDetails='tweets,followers,following'
twitterRightSubDetails='whitelist,reply,addToList'
instagramLeftSubDetails='whitelist'
instagramRightSubDetails=''
}}
@karanjthakkar
karanjthakkar / helper.js
Last active August 29, 2015 14:26
List View Helper
import Ember from 'ember';
import BaseProperties from 'crowdfire/mixins/base-properties';
export function eachViewUserItem(params, hash) {
let users = params[0],
string = users.reduce((prev, user) => {
string = '<button>One button instance</button>';
return `${prev}${string}`;
});
@karanjthakkar
karanjthakkar / main.js
Created May 19, 2014 06:43
A modified version of camden.kittens brackets extension (can close the modal dialog using the 'x' symbol in top right corner)
/*
* Copyright (c) 2013 Jonathan Rowny. All rights reserved.
* http://www.jonathanrowny.com
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions: