c1dcd7a764
This commit is the foundational step to start using malli (https://github.com/metosin/malli) in this project. Take in consideration we will only be able to realize malli's full power in future iterations. For those without context: the mobile team watched a presentation about malli and went through a light RFC to put everyone on the same page, among other discussions here and there in PRs. To keep things relatively short: 1. Unit, integration and component tests will short-circuit (fail) when inputs/outputs don't conform to their respective function schemas (CI should fail too). 2. Failed schema checks will not block the app from initializing, nor throw an exception that would trigger the LogBox. Exceptions are only thrown in the scope of automated tests. 3. There's zero performance impact in production code because we only instrument. Instrumentation is removed from the compiled code due to the usage of "^boolean js.goog/DEBUG". 4. We shouldn't expect any meaningful slowdown during development. **What are we instrumenting in this PR?** Per our team's agreement, we're only instrumenting the bare minimum to showcase 2 examples. - Instrument a utility function utils.money/format-amount using the macro approach. - Instrument a quo component quo.components.counter.step.view/view using the functional approach. Both approaches are useful, the functional approach is powerful and allow us to instrument anonymous functions, like the ones we pass to subscriptions or event handlers, or the higher-order function quo.theme/with-theme. The macro approach is perfect for functions already defined with defn. **I evaluated the schema or function in the REPL but nothing changes** - If you evaluate the source function, you need to evaluate schema/=> or schema/instrument as well. - Remember to *var quote* when using schema/instrument. - You must call "(status-im2.setup.schema/setup!)" after any var is re-instrumented. It's advisable to add a keybinding in your editor to send this expression automatically to the CLJS REPL, or add the call at the end of the namespace you are working on (similar to how some devs add "(run-tests)" at the end of test namespaces). **Where should schemas be defined?** For the moment, we should focus on instrumenting quo components, so define each function schema in the same namespace as the component's public "view" var. To be specific: - A schema used only to instrument a single function and not used elsewhere, like a quo component schema, wouldn't benefit from being defined in a separate namespace because that would force the developer to constantly open two files instead of one to check function signatures. - A common schema reused across the repo, like ":schema.common/theme" should be registered in the global registry "schema.registry" so that consumers can just refer to it by keyword, as if it was a built-in malli schema. - A common schema describing status-go entities like message, notification, community, etc can be stored either in the respective "src/status_im2/contexts/*" or registered globally, or even somewhere else. This is yet to be defined, but since I chose not to include schemas for them, we can postpone this guideline. |
||
---|---|---|
.clj-kondo | ||
.dependabot | ||
.github | ||
.lsp | ||
.vscode | ||
android | ||
ci | ||
doc | ||
fastlane | ||
ios | ||
modules/react-native-status | ||
nix | ||
resources | ||
scripts | ||
src | ||
test | ||
test-resources | ||
translations | ||
.buckconfig | ||
.carve_ignore | ||
.dockerignore | ||
.env | ||
.env.e2e | ||
.env.jenkins | ||
.env.nightly | ||
.env.release | ||
.envrc | ||
.eslintrc.js | ||
.flowconfig | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.nycrc | ||
.prettierignore | ||
.prettierrc.js | ||
.watchmanconfig | ||
.zprintrc | ||
LICENSE.md | ||
Makefile | ||
README.md | ||
RELEASES.md | ||
VERSION | ||
app.json | ||
babel.config.js | ||
binding.gyp | ||
default.nix | ||
index.js | ||
metro.config.js | ||
package.json | ||
react-native.config.js | ||
shadow-cljs.edn | ||
shell.nix | ||
status-go-version.json | ||
supervisord.conf | ||
yarn.lock |
README.md
Status - a Mobile Ethereum Operating System
Join us in creating a browser, messenger, and gateway to a decentralized world. Status is a free (libre) open source mobile client targeting Android & iOS built entirely on Ethereum technologies. That's right, no middlemen and go-ethereum
running directly on your device.
Why?
We believe in a medium of pure free trade, economies with fair, permission-less access and a world without intermediaries. We want to create policies that can exist between friends or scale globally, we want to communicate securely and be uninhibited by legacy systems.
We want to take responsibility for our data, and the way we conduct ourselves privately and promote this way of life to a mass audience.
We want deep insights into our own economies so we can make informed, data-driven decisions on how to make our lives better. The Ethereum blockchain, Smart Contracts, Swarm and Whisper provide us with a path forward.
If this interests you, help us make Status a reality - anyone can contribute and we need everyone at any skill level to participate.
How to Contribute?
Go straight to the docs and choose what interests you:
-
Developer Developers are the heart of software and to keep Status beating we need all the help we can get! If you're looking to code in ClojureScript or Golang then Status is the project for you! We use React Native and there is even some Java/Objective-C too! Want to learn more about it? Start by reading our Developer Introduction which guides you through the technology stack and start browsing beginner issues. Then you can read how to Build Status, which talks about managing project dependencies, coding guidelines and testing procedures. Check out our coding guidelines.
-
Community Management Metcalfe's law states that the value of a network is proportional to the square of the number of connected users of the system - without community Status is meaningless. We're looking to create a positive, fun environment to explore new ideas, experiment and grow the Status community. Building a community takes a lot of work but the people you'll meet and the long-lasting relationships you form will be well worth it, check out our Mission and Community Principles
-
Specification / Documentation John Dewey once said, "Education is not preparation for life; education is life itself ". Developers and Designers need guidance and it all starts from documentation and specifications. Our software is only as good as its documentation, check out our docs and see how you can improve what we have.
-
Blog Writing Content is King, keeping our blog up to date and informing the community of news helps keep everyone on the same page.
-
Testers It's bug-hunting season! Status is currently under active development and there is sure to be a bunch of learning, build status from scratch or if an android user checks out our nightly builds. You can shake your phone to submit bug reports, or start browsing our Github Issues. Every bug you find brings Status closer to stable, usable software for everyone to enjoy!
-
Security Status is a visual interface to make permanent changes on the Blockchain, it handles crypto-tokens that have real value and allows 3rd party code execution. Security is paramount to its success. You are given permission to break Status as hard as you can, as long as you share your findings with the community!
-
Evangelism Help us spread the word! Tell a friend right now, in fact, tell everyone - yell from a mountain if you have to, every person counts! If you've got a great story to tell or have some interesting way you've spread the word about Status let us know about it in our chat
Give me Binaries!
You can get our Beta builds for both Android and iOS on our website, through our nightly builds, or by building it yourself.
Core Contributors
Special thanks to @adrian-tiberius. Without the dedication of these outstanding individuals, Status would not exist.
Contact us
Feel free to email us at support@status.im.
License
Licensed under the Mozilla Public License v2.0