Got rid of old files.

Signed-off-by: Eric Dvorsak <eric@dvorsak.fr>
This commit is contained in:
Audrius Molis 2018-01-04 22:33:13 +02:00 committed by Eric Dvorsak
parent b8ddc2b16b
commit 2292d2e500
No known key found for this signature in database
GPG Key ID: 932AC1CE5F05DE0C
11 changed files with 3 additions and 240 deletions

2
.gitignore vendored
View File

@ -52,6 +52,8 @@ index.ios.js
target/
env/dev/env/config.cljs
.re-natal.local
externs/
shim.js
# Generated by lein voom
#

View File

@ -1 +0,0 @@
{}

View File

@ -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

View File

@ -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 doesnt support sync http calls (thats why we didnt use sync calls with web3 when we used http provider)
2) RN doesnt allow to make sync calls to native modules, currently we are calling CallRPC through native modules, thats why calls can be only async
**Dapps**
Dapps are running in webview env which supports sync calls in some cases (only android), but we dont 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 wouldnt 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. Im 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

View File

@ -1,3 +0,0 @@
# Introduction to status-im
TODO: write [great documentation](http://jacobian.org/writing/what-to-write/)

View File

@ -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

View File

@ -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

View File

@ -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)

4
externs/.gitignore vendored
View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

22
shim.js
View File

@ -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 ? '*' : ''
}

View File

@ -1,5 +0,0 @@
#!/bin/sh
npm install
re-natal use-figwheel
react-native run-android