Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacement for bad pull request on branch separate-NETWORKS #143

Closed
wants to merge 1 commit into from

Conversation

Bill-Kunj
Copy link
Collaborator

Move deploy, propose, and NETWORKS into individual files.

@Bill-Kunj Bill-Kunj added the ui UI / UX label May 21, 2021
@Bill-Kunj Bill-Kunj requested a review from dckc May 21, 2021 18:37
@Bill-Kunj Bill-Kunj changed the title Replacement for branch separate-NETWORKS Replacement for bad pull request on branch separate-NETWORKS May 21, 2021
@Bill-Kunj Bill-Kunj requested a review from pfabre31 May 21, 2021 19:57
Copy link
Contributor

@dckc dckc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Replacement for branch separate-NETWORKS" is phrased in terms of ephemera (a branch name). Commit messages are part of the permanent history of the project.

Please use a commit message that explains the purpose of the commit. I don't understand the purpose of this commit / PR.

But I found at least one or two things that should change.

.catch((err) => {
console.log(proposeCount, err);
if (proposeCount < 7) {
setTimeout(propose, 10000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setTimeout is ambient authority.

* @param { string } adm
* @returns {net}
*/
function makeNetwork(pattern, obs, val, adm) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the purpose of the makeNetwork function? It doesn't seem to have any benefit over writing out the object literal.

listenAtDeployId,
} from 'rchain-api';

import m from 'mithril';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m includes ambient authority, IIRC.

/**
* @typedef {string} hostname
*
* @type {{ localhost: net, testnet: net, demo: net, rhobot: net, mainnet: net}} NETWORKS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the syntax is:

/** @type {...} */
const NETWORKS = ...

Comment on lines +81 to +84
Object.entries(NETWORKS).find(
([_name, net]) => {
if (hostname.indexOf(net.hostPattern) >= 0) return net;
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this call to Object.entries supposed to do? It looks like a noop.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completely agree, I don't actually know what that code was written for

/**
* @returns {string[]}
*/
export function networkNames() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

networkNames might make sense if the purpose were to abstract the representation of NETWORKS, but NETWORKS is exported, so I don't understand what this function is for.

@pfabre31
Copy link
Collaborator

Hi @dckc, thanks for this review. Indeed I think there has been a misunderstanding on the purpose of this PR.

First, I'd like to say that none of the code blocks that you commented was written by me. All I did was fixing a bunch of bugs on this branch, after @Bill-Keuntje let us know it would be interesting to include the refactoring work of this branch into our branch ballot-ui. And honestly I'm not sure I am the best person to do this refactoring work as I just discovered the code and that there are still a lot of things I don't quite understand. Maybe the person who started this refactoring ? Do you think there is still a lot to do ?
Don't get me wrong, I am super motivated to work on this, I am just trying to find the way to be the most efficient. And I do believe that this is by working on UI/UX. Now as this UI/UX should be based on a refactoring, I wonder what the next step is. Maybe we should set up a call to discuss it.

@Bill-Kunj
Copy link
Collaborator Author

This PR is a first step to allow multiple UIs to be developed for various rgov projects/features using the same code and at the same time avoid the inevitable conflicts/dependencies in participate.js (which is the development interface).

@Bill-Kunj
Copy link
Collaborator Author

@dckc @jimscarver @w2vy @David405 @pfabre31
Shall we abandon this effort and continue with what we have (which works)?

@Bill-Kunj
Copy link
Collaborator Author

Given no active response, this is abandoned. Opening new issue to refactor participate.js #217

@Bill-Kunj Bill-Kunj closed this Jul 2, 2021
@Bill-Kunj Bill-Kunj deleted the refactor-participate branch July 2, 2021 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui UI / UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants