From 2292d2e50010cbdfd4eed86a381d434ff08dcebb Mon Sep 17 00:00:00 2001 From: Audrius Molis Date: Thu, 4 Jan 2018 22:33:13 +0200 Subject: [PATCH] Got rid of old files. Signed-off-by: Eric Dvorsak --- .gitignore | 2 + .watchmanconfig | 1 - CHANGELOG.md | 24 ------ doc/faq.md | 25 ------- doc/intro.md | 3 - doc/refactoring-guidelines.md | 130 --------------------------------- env/dev/figwheel_api.clj | 2 +- env/test/env/android/main.cljs | 25 ------- externs/.gitignore | 4 - shim.js | 22 ------ update.sh | 5 -- 11 files changed, 3 insertions(+), 240 deletions(-) delete mode 100644 .watchmanconfig delete mode 100644 CHANGELOG.md delete mode 100644 doc/faq.md delete mode 100644 doc/intro.md delete mode 100644 doc/refactoring-guidelines.md delete mode 100644 env/test/env/android/main.cljs delete mode 100644 externs/.gitignore delete mode 100644 shim.js delete mode 100755 update.sh diff --git a/.gitignore b/.gitignore index 9304b575b1..7b3ee17582 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,8 @@ index.ios.js target/ env/dev/env/config.cljs .re-natal.local +externs/ +shim.js # Generated by lein voom # diff --git a/.watchmanconfig b/.watchmanconfig deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/.watchmanconfig +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 77afa77091..0000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). - -## [Unreleased][unreleased] -### Changed -- Add a new arity to `make-widget-async` to provide a different widget shape. - -## [0.1.1] - 2016-03-23 -### Changed -- Documentation on how to make the widgets. - -### Removed -- `make-widget-sync` - we're all async, all the time. - -### Fixed -- Fixed widget maker to keep working when daylight savings switches over. - -## 0.1.0 - 2016-03-23 -### Added -- Files from the new template. -- Widget maker public API - `make-widget-sync`. - -[unreleased]: https://github.com/your-name/status-im/compare/0.1.1...HEAD -[0.1.1]: https://github.com/your-name/status-im/compare/0.1.0...0.1.1 diff --git a/doc/faq.md b/doc/faq.md deleted file mode 100644 index 66400bc22d..0000000000 --- a/doc/faq.md +++ /dev/null @@ -1,25 +0,0 @@ -# FAQ - -## Why do we use async JS calls in RN but sometimes sync calls for bots? - -(Based on answer by @roma in Slack on August 15, 2017) - -Different JS environments have different capabilities. In general we want to use async. - -**React Native** -1) RN doesn’t support sync http calls (that’s why we didn’t use sync calls with web3 when we used http provider) -2) RN doesn’t allow to make sync calls to native modules, currently we are calling CallRPC through native modules, that’s why calls can be only async - -**Dapps** - -Dapps are running in webview env which supports sync calls in some cases (only android), but we don’t support sync calls for iOS, that will not work. Mostly any call to web3 causes http request, so using sync call is a bad idea in one threaded env, in any case. So i wouldn’t use it in dapps. - -**Bots in Otto VM** - -During the last year both sync and async calls were handled by the same function and tbh that was sync call with only difference: in case when we pass callback it was called instead of returning the value. But the call was blocking. I’m not sure if it was implemented, but there was an issues about making async calls in otto really async. - -**Summary** -- Both sync and async calls are available in otto -- Only async in RN -- Only async in iOS webview -- Both async/sync in Android webview diff --git a/doc/intro.md b/doc/intro.md deleted file mode 100644 index b3702d4122..0000000000 --- a/doc/intro.md +++ /dev/null @@ -1,3 +0,0 @@ -# Introduction to status-im - -TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) diff --git a/doc/refactoring-guidelines.md b/doc/refactoring-guidelines.md deleted file mode 100644 index 94e64ca11f..0000000000 --- a/doc/refactoring-guidelines.md +++ /dev/null @@ -1,130 +0,0 @@ -This document details steps to improve codebase intelligibility. Codebase should be as simple and intuitive as possible to understand and navigate. -It goes in pair with a best practices document that will follow. - -status: RFC - -To reduce potential for regression and simplify implementation and subsequent merge into develop this refactoring can be split into multiple PRs - -# Pull request #1 Cosmetic - -This PR only moves things around and rename things so it should not introduce any behavior changes - -## Introduce new hierarchy - -Reorganize folders / rename file to match new hierarchy and match re-frame semantic. - -``` -src/status-im/ -├── components -├── data_store -├── platforms -├── protocol -├── translations -├── ui -│ └── screens -│ ├── account -│ │ ├── login -│ │ └── recover -│ │ ├── core.cljs -│ │ ├── db.cljs -│ │ ├── events.cljs -│ │ ├── subs.cljs -│ │ └── views.cljs -│ ├── contacts -│ │ └── new_contact -│ │ └── views.cljs -│ └── navigation.cljs -└── utils -``` -and -``` -resources -├── default_contacts.json -├── default_contacts_groups.json -├── images/ - | └── contacts/ -├── bots/ - | ├── browse/ - | ├── ... - | └── console/ -└── vendors/ -└── js/ -``` - -- if you have specs in a specs.cljs file move them to the db.cljs file - -## Apply code conventions - -Fix code convention according to best practices. - -https://github.com/bbatsov/clojure-style-guide -http://tonsky.me/blog/readable-clojure/ - -- Use long namespace aliases (i.e use `string` rather than `str` or `s` for `clojure.string`) -- Use `react` alias instead of directly refering to components in views - -The important thing is that by following such guidelines the way to refer to and name things should be more consistent accross the codebase. - -### Add letsubs macro in views - -#### For emacs users - -You can use the following emacs-lisp expression in your .emacs to have proper indentation with the letsubs macro - -```emacs-lisp - (put-clojure-indent 'letsubs 1) -``` - -#### For cursive users - -### Write docstring for important functions - -# Pull request #2 Functional - -## Rewrite events - -### Use fx and cofx -### Move navigation/preload-data! to navigation.cljs - -## Refactor app-db - -Make sure app-db is - -- properly normalized -- using namespaced keys -- speced -- documented. - -From @janherich - -Cases which I find problematic: - -Data under top level keys :chat-animations, :chat-loaded-callbacks, :chat-ui-props and :chats should me merged together, as they are all indexed by chat-id, I propose top level key :chat-by-id -Messages should be kept at top level key :message-by-id, every occurrence where message is referenced (for example [:chat-by-id "console" :messages] will contain collection of references to particular messages, like [:message-by-id "intro-message"] we can then either lookup data manually in subscriptions by using reference path as simple (get-in db ...) argument, or maybe even provide some automatic denormalisation where all references (links) will be replaced be referenced data in subscriptions, I'm not sure how that's feasible in reagent subscription model. - -## Rewrite subs - -Use re-frame best practices: - -- db can be used only in extraction subscriptions - - -## Write tests - -# Pull request #3 Misc - -## Consolidate namespaces - -Merge utils namespaces and reduce files number to improve code understandability. -Consolidate android and ios shared code. - -## Improve modularization - -Make sure we don't have unwanted dependencies between namespaces (i.e. re-frame usage in non ui/ namespaces) -Might require spliting files - - -## Follow re-frame patterns - -Reorganize ui code by views and follow re-frame patterns - diff --git a/env/dev/figwheel_api.clj b/env/dev/figwheel_api.clj index 535ef00430..4fa1f427e5 100644 --- a/env/dev/figwheel_api.clj +++ b/env/dev/figwheel_api.clj @@ -9,7 +9,7 @@ (fn [paths] (let [paths-set (set paths)] (-> paths-set (disj "env/dev") - (conj "env/test" "test/cljs") + (conj "test/cljs") vec))))) (defn start-figwheel diff --git a/env/test/env/android/main.cljs b/env/test/env/android/main.cljs deleted file mode 100644 index b4ca6960a6..0000000000 --- a/env/test/env/android/main.cljs +++ /dev/null @@ -1,25 +0,0 @@ -(ns ^:figwheel-no-load env.android.main - (:require [reagent.core :as r] - [status-im.android.core :as core] - [figwheel.client :as figwheel :include-macros true] - [status-im.test.handlers-stubs :refer [init-stubs]])) - -(set! js/console.disableYellowBox true) - -(enable-console-print!) - -(def cnt (r/atom 0)) -(defn reloader [] @cnt [core/app-root]) -(def root-el (r/as-element [reloader])) -(defn callback [] - (swap! cnt inc) - (status-im.ui.components.status/init-jail) - (re-frame.core/dispatch [:load-commands!])) - -(figwheel/watch-and-reload - :websocket-url "ws://10.0.3.2:3449/figwheel-ws" - :heads-up-display false - :jsload-callback callback) - -(core/init) -(init-stubs) diff --git a/externs/.gitignore b/externs/.gitignore deleted file mode 100644 index 86d0cb2726..0000000000 --- a/externs/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/shim.js b/shim.js deleted file mode 100644 index 65d986e631..0000000000 --- a/shim.js +++ /dev/null @@ -1,22 +0,0 @@ -if (typeof __dirname === 'undefined') global.__dirname = '/' -if (typeof __filename === 'undefined') global.__filename = '' -if (typeof process === 'undefined') { - global.process = require('process') -} else { - const bProcess = require('process') - for (var p in bProcess) { - if (!(p in process)) { - process[p] = bProcess[p] - } - } -} - -process.browser = false -if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer - -// global.location = global.location || { port: 80 } -const isDev = typeof __DEV__ === 'boolean' && __DEV__ -process.env['NODE_ENV'] = isDev ? 'development' : 'production' -if (typeof localStorage !== 'undefined') { - localStorage.debug = isDev ? '*' : '' -} diff --git a/update.sh b/update.sh deleted file mode 100755 index f4bab26c1f..0000000000 --- a/update.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -npm install -re-natal use-figwheel -react-native run-android