status-im / swarms

Swarm Home. New, completed and in-progress features for Status
92 stars 31 forks source link

Improve developer experience on status-react #9

Closed yenda closed 6 years ago

yenda commented 6 years ago

Preamble

Idea: DEV#008
Title: Improve developer experience on status react
Status: Draft
Created: 2017/11/10

Summary

Improve developer experience on status react by making necessary refactoring, implementing developer features and supporting clojurescript tooling development.

Vision

The current developper experience with status-react has a few rough edges. Our goal is to identify and eliminate them in order to improve the developper experience and get new people onboard more easely.

We shall also improve the clojurescript tools that we are using for status-react to make sure they stay updated and match our expectations.

Making our project more developer-friendly is the best way to get new contributors !

Swarm Participants

Requirements

  1. the app can be started in a specific state with a configuration file
  2. the developper environment can be launched with a single command
  3. add profiling to re-frisk
  4. react-native update
  5. finish re-frame refactoring
  6. Refactor db usage
  7. Remove derived data from app-db
  8. Fix Node is already running error when connecting to an account
  9. Document the debug server
  10. Get devtools to work
  11. Sponsor clojurescript development

Goals & Implementation Plan

Minimum Viable Product

Goal Date: 2017-11-24 Description:

Iteration 1..N

Goal Date: 2017-11-24 Description: Requirement 1 and 4 should be done + as much of 5-10 as possible

Goal Date: 2017-11-01 Description: Requirement 2 should be done + as much of 5-10 as possible

Goal Date: 2017-12-08 Description: Requirement 3 should be done + as much of 5-10 as possible

Post-Mortem

Copyright

Copyright and related rights waived via CC0.

yenda commented 6 years ago

I pledge focus 40h/w. (20 if desktop idea starts next week)

alwx commented 6 years ago

I already started working on re-frame refactoring (which means removing u/side-effects! and making everything more consistent and idiomatic) and db refactoring (related task is https://github.com/status-im/status-react/issues/2341). So I would certainly like to continue.

I pledge focus of 0.5.

yenda commented 6 years ago

I will update this comment with new user stories as they come up to unclog the OP

User stories

1. The app can be started in a specific state with a configuration file (developer feature)

As a developer I want to be able to start the application with a specific configured state a configuration file should allow me to choose the account, the screen and the initial app-db I want to work with.

I can see this also being useful for onboarding, a new developper could quickly get to work on a feature if we provide him with the configuration file and mockup of the feature he has to work on. It can also be used for open bounties, where a configuration file can help reproduce the bug consistently.

Current situation

As a developper I have to login and go to the screen I am working on manually everytime I restart the application If the data is deleted I also have to recover the account and add contacts, messages and so on to recover the state I was working on.

2. The developper environment can be launched with a single command (clojurescript tooling)

As a developper I want to be able to start working on the app with a single command such as lein android-dev, lein ios-dev or lein desktop-dev.

Current situation

As a developper even after setting up all the project dependencies I still need to run multiple commands on different terminals before I can get started. It can be scripted but these scripts are hardly portable and there might be better alternatives.

yenda commented 6 years ago

Requirements

1. add profiling to re-frisk

There is already re-frame-trace that offers such functionnality for a web re-frame app with an embedded profiling view. I started a discussion with someone who extracted the profiling part without the UI and is interested in integrating with re-frisk remote:

https://github.com/Day8/re-frame-trace/issues/75

2. the app can be started in a specific state with a configuration file

see user story 1

3. the developper environment can be launched with a single command

see user story 2

4. react-native update

Already in progress, see https://github.com/status-im/status-react/pull/2217 Urgent - Need help to update iOS

related issues to fix:

5. finish re-frame refactoring

This is important because right now the mix of old/new style of events is confusing and the old style is harder to test. It will enable the next step which is to have way more tests

6. Refactor db usage

There is currently a mix of synchronous and asynchronous db updates as well of coeffect abuse in our codebase. We should discuss how to unify the way we do db updates as well as eventually make deeper changes to the data-store namespaces

More details here: https://github.com/status-im/status-react/issues/2307

7. Remove derived data from app-db

We should not duplicated fields in the app-db, subscription are cached, map lookups have a negligeable cost, so duplicating a field to make it "more accessible" is just a potential source of potential inconsistency and additional refactoring burden

8. Fix Node is already running error when connecting to an account

This is annoying because a figwheel reload is basically useless. It will be even more important once we can start the app where we want because we can then fix the red screen and figwheel reload get us back there without any further action. But until this is fixed it won't be possible when trying to connect to an account after a red screen and figwheel reload, I always get this node is already running error when connecting to an account

9. Document the debug server

10. Get devtools to work

Currently it never get passed the login because it is too slow

11. Sponsor clojurescript tooling development

We could sponsor development of tools that are useful for us such as re-natal or boot-react-native to improve their progress.

The simplest solution is to sponsor re-natal development to make sure it keeps up-to-date with react-native, and makes updates smoother. The alternative is to sponse boot-react-native which might be more promising, also touching requirement 3.

janherich commented 6 years ago

I pledge focus 40h/w

flexsurfer commented 6 years ago

It would be good to have 1) log and highlight calls to jail in re-frisk, we should keep our eyes on these calls 2) show event in re-frisk events list before this event will be handled, and show timer, and color from green to red

I pledge focus 10h/w

yenda commented 6 years ago

@flexsurfer nice idea, regarding the tracing could you have a look at https://github.com/Day8/re-frame-trace/issues/75 and see how we can collaborate with that dev ?

0xc1c4da commented 6 years ago

I'd like code comments to be a large part of this.

jeluard commented 6 years ago

👍 for code comments!

Also good names (functions and arguments), codebase structure, short functions and great tests go a long way. Comments are still necessary for context, bigger ideas, workaround, ..

oskarth commented 6 years ago

Request: Include https://github.com/status-im/status-react/issues/1923 in scope. It isn't mentioned in list but to me this is very much a part of developer experience (estimate 20h-40h total lost to this in terms of devs upgrading/downgrading and discussion/confusion around this).

oskarth commented 6 years ago

I noticed this swarm is lacking someone in Testing & Evaluation, which is something we want for each swarm. @yenda do you have one and this is just not captured or what's up?

asemiankevich commented 6 years ago

I am in @oskarth

oskarth commented 6 years ago

@yenda Do you think we could update the Goals & Implementation Plan section so it is more up to date? It's fine if it means cutting scope/things being delayed or whatever, as long as it somewhat accurately captures state of things.

nastya commented 6 years ago

Testing & Evaluation: @nastya

Hi all! What is this all about and why have I been mentioned here? This is the first time I hear about this project. Also see #61 (same).

oskarth commented 6 years ago

@nastya Sorry about this! @asemiankevich uses "Nastya" as nick on our internal Slack, hence we sometimes write this on Github too by mistake. Please ignore.

naghdy commented 6 years ago

@yenda. What do you think about closing this as it hasn't really taken hold? Creating a powerful tool for our developers is important, and we should tackle this once we have a stable and working app.

yenda commented 6 years ago

@naghdy sure actually most of it has been done now