Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b669db5c45 | ||
|
|
92c39f4e69 | ||
|
|
c960d6e264 | ||
|
|
7db514ba4a | ||
|
|
a94e0a8c98 | ||
|
|
d3394197a2 | ||
|
|
8ec7e07662 | ||
|
|
56d0913d4b | ||
|
|
a3ce2aa578 | ||
|
|
446d71063c | ||
|
|
b1aec54e4c | ||
|
|
cb19a31a5f | ||
|
|
0890b1b1b5 | ||
|
|
2191f68883 | ||
|
|
d1941fe002 | ||
|
|
540e5be290 | ||
|
|
7e47057b2e | ||
|
|
86d5a3c4e6 | ||
|
|
6975d6ac48 | ||
|
|
e8ced0a714 | ||
|
|
c5d74dc758 | ||
|
|
4fe2ccaa84 | ||
|
|
d042f40e69 | ||
|
|
58d20967ae | ||
|
|
6858884c83 | ||
|
|
78621207e1 | ||
|
|
d3b4f60848 | ||
|
|
694591ad5c | ||
|
|
e8682ccbf6 | ||
|
|
3973e886f8 | ||
|
|
7e8f1fac8a | ||
|
|
77ddd8688f | ||
|
|
62945205a0 | ||
|
|
adc458d8ff | ||
|
|
b4bb9c50fa | ||
|
|
19526508f2 | ||
|
|
a17efa7299 | ||
|
|
c7bc16608a | ||
|
|
3c9ad509cd | ||
|
|
eea55b22d7 | ||
|
|
7efd1e5d6b | ||
|
|
b264d25b69 | ||
|
|
03f501ca7b | ||
|
|
6598873343 | ||
|
|
a60235abf3 | ||
|
|
b5a8f0a127 | ||
|
|
7d0dfec22c | ||
|
|
51fa99affa | ||
|
|
369aed389c | ||
|
|
10d9c34559 | ||
|
|
8ccf2d1596 |
@@ -5,7 +5,6 @@ project-board:
|
||||
min-reviewers: 1
|
||||
tested-pr-label-name: 'Tested - Issues'
|
||||
contributor-column-name: 'CONTRIBUTOR'
|
||||
to-rebase-column-name: 'TO REBASE'
|
||||
review-column-name: 'REVIEW'
|
||||
test-column-name: 'E2E Tests'
|
||||
|
||||
|
||||
@@ -218,23 +218,18 @@ release-android: keystore build-android ##@build Build signed Android APK
|
||||
|
||||
release-ios: export TARGET := ios
|
||||
release-ios: export BUILD_ENV ?= prod
|
||||
release-ios: watchman-clean ##@build Build release for iOS release
|
||||
@git clean -dxf -f target/ios && \
|
||||
$(MAKE) jsbundle-ios && \
|
||||
xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration Release -destination 'generic/platform=iOS' -UseModernBuildSystem=N clean archive
|
||||
release-ios: watchman-clean ios-clean jsbundle ##@build Build release for iOS release
|
||||
xcodebuild \
|
||||
-scheme StatusIm \
|
||||
-configuration Release \
|
||||
-workspace ios/StatusIm.xcworkspace \
|
||||
-destination 'generic/platform=iOS' \
|
||||
-UseModernBuildSystem=N clean archive
|
||||
|
||||
jsbundle-android: SHELL := /bin/sh
|
||||
jsbundle-android: export TARGET := android
|
||||
jsbundle-android: export BUILD_ENV ?= prod
|
||||
jsbundle-android: ##@jsbundle Compile JavaScript and Clojurescript into app directory
|
||||
# Call nix-build to build the 'targets.mobile.android.jsbundle' attribute and copy the.js files to the project root
|
||||
nix/scripts/build.sh targets.mobile.android.jsbundle && \
|
||||
mv result/*.js ./
|
||||
|
||||
jsbundle-ios: export TARGET := ios
|
||||
jsbundle-ios: export BUILD_ENV ?= prod
|
||||
jsbundle-ios: ##@jsbundle Compile JavaScript and Clojure into index.ios.js
|
||||
yarn shadow-cljs release mobile
|
||||
jsbundle: SHELL := /bin/sh
|
||||
jsbundle: export BUILD_ENV ?= prod
|
||||
jsbundle: ##@build Build JavaScript and Clojurescript bundle for iOS and Android
|
||||
nix/scripts/build.sh targets.mobile.jsbundle
|
||||
|
||||
#--------------
|
||||
# status-go lib
|
||||
@@ -365,6 +360,7 @@ component-test: ##@test Run component tests once in NodeJS
|
||||
yarn shadow-cljs compile component-test && \
|
||||
jest --config=test/jest/jest.config.js
|
||||
|
||||
#--------------
|
||||
# Other
|
||||
#--------------
|
||||
|
||||
@@ -373,6 +369,10 @@ geth-connect: ##@other Connect to Geth on the device
|
||||
adb forward tcp:8545 tcp:8545 && \
|
||||
build/bin/geth attach http://localhost:8545
|
||||
|
||||
ios-clean: SHELL := /bin/sh
|
||||
ios-clean: ##@prepare Clean iOS build artifacts
|
||||
git clean -dxf -f target/ios
|
||||
|
||||
android-clean: export TARGET := gradle
|
||||
android-clean: ##@prepare Clean Gradle state
|
||||
git clean -dxf -f ./android/app/build; \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
@@ -49,7 +49,6 @@ pipeline {
|
||||
stage('Prep') {
|
||||
steps {
|
||||
script {
|
||||
utils.doGitRebasePR()
|
||||
utils.symlinkEnv()
|
||||
println("Build Number: ${utils.genBuildNumber()}")
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
@@ -48,7 +48,6 @@ pipeline {
|
||||
stage('Prep') {
|
||||
steps {
|
||||
script {
|
||||
utils.doGitRebasePR()
|
||||
utils.symlinkEnv()
|
||||
println("Build Number: ${utils.genBuildNumber()}")
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
@@ -41,13 +41,6 @@ pipeline {
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Prep') {
|
||||
steps {
|
||||
script {
|
||||
utils.doGitRebasePR()
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Checks') {
|
||||
parallel {
|
||||
stage('Lint') {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-jenkins-lib@v1.7.3'
|
||||
library 'status-jenkins-lib@v1.7.8'
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
|
||||
@@ -365,6 +365,43 @@ dispatch.
|
||||
(str "Hello " username)]])
|
||||
```
|
||||
|
||||
### Registering effects
|
||||
|
||||
When registering re-frame effects (`reg-fx`), prefer to expose a data-only
|
||||
interface because that will allow event handlers to stay pure.
|
||||
|
||||
For instance, if an effect needs a `on-success` callback, allow it to receive a
|
||||
*re-frame event vector*. This approach is used by us in the [json-rpc/call
|
||||
effect](src/status_im2/common/json_rpc/events.cljs), but also by third-party
|
||||
effects, such as https://github.com/Day8/re-frame-http-fx. For the complete
|
||||
rationale, see [PR #15936](https://github.com/status-im/status-mobile/pull/15936).
|
||||
|
||||
### Using the effect `:json-rpc/call`
|
||||
|
||||
Prefer the pure version of `:json-rpc/call` (no callbacks).
|
||||
|
||||
```clojure
|
||||
;; not as good
|
||||
(rf/defn accept-contact-request
|
||||
{:events [:activity-center.contact-requests/accept]}
|
||||
[_ contact-id]
|
||||
{:json-rpc/call
|
||||
[{:method "wakuext_acceptContactRequest"
|
||||
:params [{:id contact-id}]
|
||||
:on-success #(rf/dispatch [:sanitize-messages-and-process-response %])
|
||||
:on-error #(rf/dispatch [:activity-center.contact-requests/accept-error contact-id %])}]})
|
||||
|
||||
;; better
|
||||
(rf/defn accept-contact-request
|
||||
{:events [:activity-center.contact-requests/accept]}
|
||||
[_ contact-id]
|
||||
{:json-rpc/call
|
||||
[{:method "wakuext_acceptContactRequest"
|
||||
:params [{:id contact-id}]
|
||||
:on-success [:sanitize-messages-and-process-response]
|
||||
:on-error [:activity-center.contact-requests/accept-error contact-id]}]})
|
||||
```
|
||||
|
||||
### Registering event handlers
|
||||
|
||||
Events must always be declared with the `utils.fx/defn` macro. Also, don't use
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
import "node-libs-react-native/globals";
|
||||
import "./app/index.js";
|
||||
import "./result/index.js";
|
||||
|
||||
@@ -55,12 +55,12 @@ The [`nix/scripts/shell.sh`](./scripts/shell.sh) script is essentially a wrapper
|
||||
|
||||
# Building
|
||||
|
||||
We will use the `make jsbundle-android` target as an example of a derivation you can build using Nix:
|
||||
We will use the `make jsbundle` target as an example of a derivation you can build using Nix:
|
||||
|
||||
1. `make jsbundle-android` is called by developer
|
||||
2. `make` calls `nix/scripts/build.sh targets.mobile.android.jsbundle`
|
||||
3. [`build.sh`](/nix/scripts/build.sh) calls `nix-build --attr targets.mobile.android.jsbundle` with extra arguments
|
||||
4. `nix-build` builds the derivation from [`nix/mobile/android/jsbundle/default.nix`](/nix/mobile/android/jsbundle/default.nix)
|
||||
1. `make jsbundle` is called by developer
|
||||
2. `make` calls `nix/scripts/build.sh targets.mobile.jsbundle`
|
||||
3. [`build.sh`](/nix/scripts/build.sh) calls `nix-build --attr targets.mobile.jsbundle` with extra arguments
|
||||
4. `nix-build` builds the derivation from [`nix/mobile/jsbundle/default.nix`](/nix/mobile/jsbundle/default.nix)
|
||||
|
||||
The same can be done for other targets like `targets.mobile.android.release`.
|
||||
Except in that case extra arguments are required which is why the [`scripts/release-android.sh`](/scripts/release-android.sh) is used in the `make release-android` target.
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
{ pkgs, deps, callPackage, mkShell
|
||||
, status-go, androidPkgs, androidShell }:
|
||||
, jsbundle, status-go, androidPkgs, androidShell }:
|
||||
|
||||
let
|
||||
# Import a jsbundle compiled out of clojure codebase
|
||||
jsbundle = callPackage ./jsbundle { };
|
||||
|
||||
release = callPackage ./release.nix { inherit jsbundle status-go; };
|
||||
in {
|
||||
# TARGETS
|
||||
inherit release jsbundle;
|
||||
rec {
|
||||
release = callPackage ./release.nix {
|
||||
inherit jsbundle status-go;
|
||||
};
|
||||
|
||||
shell = mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
|
||||
@@ -46,7 +46,7 @@ in stdenv.mkDerivation rec {
|
||||
root = path;
|
||||
include = [
|
||||
"package.json" "yarn.lock" "metro.config.js" "babel.config.js"
|
||||
"resources/.*" "translations/.*" "src/js/.*"
|
||||
"resources/.*" "translations/.*" "src/js/.*" "index.js"
|
||||
"modules/react-native-status/android.*" "android/.*"
|
||||
envFileName "VERSION" "status-go-version.json" "react-native.config.js"
|
||||
];
|
||||
@@ -94,8 +94,10 @@ in stdenv.mkDerivation rec {
|
||||
# Export all vars from .env file
|
||||
export $(cut -d= -f1 .env)
|
||||
|
||||
# Copy index.js and app/ input files
|
||||
cp -ra --no-preserve=ownership ${builtJsBundle}/* ./
|
||||
# Symlink React Native entrypoint.
|
||||
cp -Lr ${builtJsBundle} ./result
|
||||
pwd
|
||||
find -L result
|
||||
|
||||
# Copy android/ directory
|
||||
mkdir -p ./android/build
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
let
|
||||
fastlane = callPackage ./fastlane { };
|
||||
|
||||
jsbundle = callPackage ./jsbundle { };
|
||||
|
||||
android = callPackage ./android {
|
||||
inherit jsbundle;
|
||||
status-go = status-go.mobile.android;
|
||||
};
|
||||
|
||||
@@ -26,5 +29,5 @@ in {
|
||||
};
|
||||
|
||||
# TARGETS
|
||||
inherit android ios fastlane;
|
||||
inherit android ios fastlane jsbundle;
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
{ secretsFile ? "" }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "status-mobile-build-jsbundle-android";
|
||||
name = "status-mobile-jsbundle";
|
||||
src =
|
||||
let path = ./../../../..;
|
||||
let path = ./../../..;
|
||||
# We use builtins.path so that we can name the resulting derivation,
|
||||
# otherwise the name would be taken from the checkout directory,
|
||||
# which is outside of our control inherit path;
|
||||
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
|
||||
ignoreVCS = false;
|
||||
include = [
|
||||
"VERSION" "BUILD_NUMBER" "scripts/version/.*"
|
||||
"src/.*" "shadow-cljs.edn" "index.js"
|
||||
"src/.*" "shadow-cljs.edn"
|
||||
# I want to avoid including the whole .git directory
|
||||
".git/HEAD" ".git/objects" ".git/refs/heads/.*"
|
||||
# shadow-cljs expects these for deps resolution
|
||||
@@ -77,6 +77,6 @@ stdenv.mkDerivation {
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r index.js app $out/
|
||||
cp -r result/* $out/
|
||||
'';
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
"@react-native-community/blur": "git+https://github.com/status-im/react-native-blur#refs/tags/v4.3.3-status",
|
||||
"@react-native-community/cameraroll": "git+https://github.com/status-im/react-native-cameraroll.git#refs/tags/v4.0.4-status.0",
|
||||
"@react-native-community/clipboard": "^1.2.2",
|
||||
"@react-native-community/hooks": "^2.5.1",
|
||||
"@react-native-community/hooks": "^3.0.0",
|
||||
"@react-native-community/masked-view": "^0.1.6",
|
||||
"@react-native-community/netinfo": "^4.4.0",
|
||||
"@react-native-community/push-notification-ios": "^1.4.1",
|
||||
|
||||
|
Before Width: | Height: | Size: 307 B |
|
Before Width: | Height: | Size: 382 B |
|
Before Width: | Height: | Size: 282 B |
|
Before Width: | Height: | Size: 381 B |
|
Before Width: | Height: | Size: 772 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 505 B |
|
Before Width: | Height: | Size: 654 B |
|
Before Width: | Height: | Size: 630 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 294 B |
|
Before Width: | Height: | Size: 469 B |
|
Before Width: | Height: | Size: 560 B |
|
Before Width: | Height: | Size: 816 B |
|
Before Width: | Height: | Size: 736 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 695 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 736 B |
|
Before Width: | Height: | Size: 1002 B |
|
Before Width: | Height: | Size: 625 B |
|
Before Width: | Height: | Size: 853 B |
|
Before Width: | Height: | Size: 503 B |
|
Before Width: | Height: | Size: 684 B |
|
Before Width: | Height: | Size: 246 B |
|
Before Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 464 B |
|
Before Width: | Height: | Size: 547 B |
|
Before Width: | Height: | Size: 646 B |
|
Before Width: | Height: | Size: 838 B |
|
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 421 B |
|
Before Width: | Height: | Size: 502 B After Width: | Height: | Size: 595 B |
|
Before Width: | Height: | Size: 353 B |
|
Before Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 462 B |
|
Before Width: | Height: | Size: 727 B |
|
Before Width: | Height: | Size: 883 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 367 B |
|
Before Width: | Height: | Size: 509 B |
|
Before Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 416 B |
|
Before Width: | Height: | Size: 279 B |
|
Before Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 592 B |
|
Before Width: | Height: | Size: 771 B |
|
Before Width: | Height: | Size: 630 B |
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 383 B |
|
Before Width: | Height: | Size: 493 B |
|
Before Width: | Height: | Size: 824 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 628 B |
|
Before Width: | Height: | Size: 848 B |
|
Before Width: | Height: | Size: 470 B |
|
Before Width: | Height: | Size: 740 B |
|
Before Width: | Height: | Size: 486 B |
|
Before Width: | Height: | Size: 689 B |
|
Before Width: | Height: | Size: 652 B |
|
Before Width: | Height: | Size: 895 B |
|
After Width: | Height: | Size: 618 B |
|
After Width: | Height: | Size: 798 B |
|
After Width: | Height: | Size: 657 B |
|
After Width: | Height: | Size: 1016 B |
|
Before Width: | Height: | Size: 684 B After Width: | Height: | Size: 647 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 916 B |
|
After Width: | Height: | Size: 549 B |
|
After Width: | Height: | Size: 816 B |
|
After Width: | Height: | Size: 607 B |
|
Before Width: | Height: | Size: 595 B After Width: | Height: | Size: 231 B |
|
After Width: | Height: | Size: 752 B |
|
Before Width: | Height: | Size: 782 B After Width: | Height: | Size: 242 B |
|
After Width: | Height: | Size: 702 B |
|
After Width: | Height: | Size: 1005 B |
|
After Width: | Height: | Size: 420 B |
|
After Width: | Height: | Size: 533 B |
|
After Width: | Height: | Size: 458 B |
|
After Width: | Height: | Size: 609 B |