2018 Refactor Plans
Background
Discussion on prioritizing infrastructural improvements to the CMPD Explorers Christmas Project applications based on what we learned in 2017.
What wasn't great
FE/BE | Category | What | Explanation | Notes |
---|---|---|---|---|
Both | Organization | Inconsistent file / directory naming | With the combination of time constraints & diverse backgrounds, cmpd was never allowed to adopt standard conventions for naming or project structure. This has added to the complexity of the project making it hard for existing devs to work across different areas and for new devs to quickly become productive. | |
Both | Organization | No standard validation pattern | There is currently no standard pattern for how validation errors are handled on the server side (what errors to throw, logging, library use, etc.) | |
Both | Architecture | Build process is Inconsistent from backend to frontend | The build process for the FE relies on webpack while the BE does not. Having a streamlined build system means that the two processes don't have to be developed separately. | |
Both | Architecture | Flowtype | Flowtype performance is bad, particularly when using tools like VS Code or even the terminal. The solution of disabling flow actually leads to an even worse developer experience than not using it at all. | |
Both | Architecture | Missing conventions for things like logging, validation, file naming, etc. | ||
BE | Architecture | Lack of back end framework |
| |
BE | Architecture | Code and service separation | Routing logic and business logic are mixed together. This is a code smell, and by not decoupling the two we are marrying ourselves to express long-term. |
|
Discussion Points
FE/BE | Category | What | Explanation | Notes |
---|---|---|---|---|
Both | Architecture | Removing flowtype and migrating our type checking to TypeScript | Using flow makes sense on the front-end but not the back-end. It would make even less sense to use two different static typing languages for each. Flow has good React support but TypeScript has better JS community support by a wide margin. Compared to flow, TypeScript has
|
|
BE | Architecture | Back end framework examination | Implementing node best practices will definitely go a long way to improve the architecture and project structure of the application, but we could do better. We should examine some of the popular frameworks that are extensions or alternatives to express. |
|
FE | Architecture | FE General Refactor |
| |
FE | Architecture | Build Configuration | Currently, we rely on create-react-app which offers us a zero configuration setup at the cost of vendor lock-in. Should explore fuse-box and webpack as alternatives to this approach. | |
FE | Architecture | Bootstrap Replacement | Bootstrap isn't a particularly good mobile framework. It is still pretty heavy, and many of it's components are not reflective of mobile UI trends (switches being a perfect example). There are several alternatives that are equally popular in the community. We should examine them. | |
FE | Architecture | React Alternative | We currently only plan to build CMPD as a web app. Since there is no plan to target other platforms, we should examine the benefits of using a much slimmer alternative, preact. This will greatly reduce the bundle size of the application...
| This will greatly reduce the bundle size of the application, allowing us to experiment more with libraries that may enhance its capabilities. |
FE | Architecture | State Management | We currently have no pattern for managing global state. There's inherently nothing wrong with an application that explicitly uses setState and smart components, but we should examine whether or not there's a better pattern for managing state. |
|
FE | Architecture | Data Fetching | There isn't much benefit to using axios, which was created prior to the implementation of fetch. We should examine using a library that offer advantages in terms of size gains or enhancements. | Use fetch or apollo-client (thru apollo-link-rest) |
Both | Testing | Replacing existing test setup and adding tests | ||
BE | Architecture | Separation of code using additional services |
| |
Both | Architecture | Implement Node Best Practices | A major goal for 2018 should be to implement the best practices for a node application that are not currently implemented:
| This is not an exhaustive list, but rather a list of some of the important areas where the existing app may be lacking. |
Confirmed Action Items
TBD