Skip to content

ModusCreateOrg/react-london-2022

Repository files navigation

React Advanced London 2022 | Workshop

MIT Licensed Powered by Modus_Create

A Tale of Two Codebases

Sample game - A Tale of Two Codebases

Use the latest React features to clean up your code game… and our game code.

Anybody can write code that "works." But what makes the best engineers stand out is their ability to create solutions that are clear, concise, testable and easy to understand and maintain. Join us as we explore some of React’s most powerful tools for well-architected solutions by starting with a suboptimal game codebase and refactoring it using industry best practices such as custom hooks, higher-order components (HOCs) and contexts.

Getting Started

git clone https://github.com/ModusCreateOrg/react-london-2022.git
cd react-london-2022
npm i
npm start

How it works

We've written a simple village game for your enjoyment, and we've written it BADLY. Follow along during our workshop at React Advanced London 2022 to see how we use React best practices to make the code oh-so-GOOD.

Agenda

  1. Introduction of the initial implementation and description of its issues.
    We glance over the initial state of the code and explain why the "but it works" approach is undesirable.
  2. Presentation of the tools available to improve the code base.
    List out custom hooks, HOC, context and a quick intro about them and what are the benefits of using them.
  3. The mindset behind architecting clean solutions and refactoring.
    How to think a few steps ahead and architect clean and maintainable solutions from the get-go.
  4. High level passthrough of the code and creation of the plan.
    We go over the actual code and create the plan of action.
  5. Extraction of code into utility functions.
    Find identical or similar code and create helper/utility functions, global or component-level.
  6. Extraction of state and effects into custom hooks.
    Find identical or similar states and effects and create global or component-level custom hooks.
  7. Grouping behavior into HOC.
    Extract common behaviors into HOCs.
  8. Creation of root level context and child components cleanup.
    Clean up communication between components by using a root level context.
  9. Result overview and discussion of possible future improvements.
    We take a step back and bask in the glory of our great work.
  10. How to keep your code clean, rules to follow and limitations to impose.
    A few notes on how to maintain control over your code.

Developing

Open the code in your favorite IDE. Run the setup script above to launch the app and keep it side-by-side on your screen with the code.

Prerequisites

Contributing

See Contribution Guidelines and Code of Conduct.

About the Presenter

Principal Consultant / Software Engineer, Modus Create

Michael Tintiuc

Michael is a full-stack engineer and designer with over a decade of commercial experience in multiple web and mobile technologies. An advocate and frequent contributor to open source software, Michael is the author of the ionic/vue library which allows developers all over the world to write Ionic mobile apps using the Vue framework. In his free time, he enjoys game development, contributing to Open Source, hardware modding and creating projects in new languages.


Modus Create

Modus Create is a digital product consultancy. We use a distributed team of the best talent in the world to offer a full suite of digital product design-build services; ranging from consumer facing apps, to digital migration, to agile development training, and business transformation.

Modus Create

This project is part of Modus Labs.

Modus Labs

Licensing

This project is MIT licensed.

Assets created by ARMM1998 and licensed under Creative Commons 0

About

React Advanced London 2022 Workshop

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published