CodeWritingCow / NYC-restaurant-inspection-records

Web application for searching New York City restaurant inspection records
http://www.nycfoodsafety.org
1 stars 3 forks source link

Replace Handlebars with React #41

Open CodeWritingCow opened 5 years ago

CodeWritingCow commented 5 years ago

As @omenwolf suggests, we can replace Handlebars.js with React, converting the website into a single-page application. The goal is to reduce server requests for site rendering.

jeffslofish commented 5 years ago

I would like to help with this.

jeffslofish commented 5 years ago

I made an initial react version here: https://github.com/jeffslofish/NYC-restaurant-inspection-records/tree/react (make you use the react branch), for your consideration. It has basic functionality but could definitely be improved. The UI is slightly different right now, but I believe that can be fixed.

It is fetching data from the server but I couldn't get my api token to work, so I am not using that. It does query the server based on restaurant name and borough though.

CodeWritingCow commented 5 years ago

Hi @jeffslofish, thank you for offering to help! There's a git branch for this issue. Please see what we're working on at react-base. My colleague @omenwolf has converted most of the homepage into React. We're working on other parts of the website. It'd be great if you can help!

A couple comments:

jeffslofish commented 5 years ago

Hooks allow you to use only functional components which are simpler than class components.

I created pull request #46 which uses the existing react-base branch and adds search results to it.

I welcome any comments and suggestions.