remoteinterview/zero

Code Readability Suggestions

Open

#91 opened on Nov 1, 2019

View on GitHub
 (7 comments) (0 reactions) (0 assignees)JavaScript (5,815 stars) (244 forks)batch import
help wanted

Description

First off this project is really cool and I am trying to understand it and contribute to it.

However, I am finding the codebase significantly difficult to read.

This difficulty to me seems to extend from the heavy usage of arrays to be utilized later as function arguments.

Many of the array usage stems from entryPoint andproxyLambdaRequest which in turn get pumped into a zero-process. This process boils down to 8 function arguments. This would be a ton more readable if structuring and destructuring were used instead.

Areas where the code is very difficult to read for me begin in buildManifest.js.

Which has led to comments such as:

  // get all related files (imports/requires) of this lambda
  lambdas = lambdas.map(endpoint => {
    /*
      TRYING TO FIGURE THIS OUT
      endpoint at this moment is:
        [urlPath, relativeFilePath, lambdaType]
      to become:
        [urlPath, relativeFilePath, lambdaType, [relativeFilePath, ...dependencyTreePaths]]
    */
    endpoint.push(
      [endpoint[1]].concat(dependencyTree(endpoint[2], endpoint[1]))
    );
    return endpoint;
  });

Anyway, I don't mean to be critical I just want this to be easy to help out.

Contributor guide