facn2 / apolloxii Goto Github PK
View Code? Open in Web Editor NEWAutocomplete Widget
Autocomplete Widget
Maybe start with writing a test for the searchFunc
function?
We're not using these in server.js
, so we don't need to require them in there
const fs = require('fs');
const path = require('path');
Remember that for now we're still writing only ES5 on the frontend as it's not fully supported. I think it's only a case of changing const
to var
on line 26 and change the arrow function.
Improve Syntax for router and search files
Hey guys, I think it's really important to always check out your contributions and see if you're spreading the workload evenly amongst your team. I know that @KatiaAsh was having laptop issues, and so if she was working on Stefano or Vered's devices and is missing commits from her own GitHub account that's completely fine, but just something to remember that what makes us so special is that we always encourage pair programming!
For instance line 12 of router.js
Again, nice start to modularisation and seperation of concerns, but could be improved.
All the router should do is pass the (req, res) onto a handler, and then the handler does everything with it. So you have
router = (req, res) => {
if (option1)
handler1(req,res)
if (option2)
handler2(req,res)
}
Everything you need is within those request and response arguments. This then is much neater, easier to read and easier to replicate.
If for example, one person writes the router, they can always pass the (req,res)
arguments to every handler, and then whoever is making the handlers will always know to make a function with those two arguments
Really nice modularisation of all your code, but you're search function relies on the food
variable to work, so testing it you would also have to require in food - maybe pass it as a second variable to the function (JSONToSearchThrough
?) and then you've got a nice neat, easily testable function.
What's the reason behind mixing ES5 and ES6 syntax?
Some good reads:
https://medium.com/javascript-scene/javascript-es6-var-let-or-const-ba58b8dcde75
https://javascriptweblog.wordpress.com/2010/07/06/function-declarations-vs-function-expressions/
Just for the future, it's probably better to use SVG vs importing in the entire FontAwesome for better performance, on line 10:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
Keydown enter of a search takes me to 404
Cannot tab through search results
Cannot select food using key up or key down
Create the basis for the search function
Try to steer clear from vague commit messages like:
"fix somestuff in css"
"Made some small changes to router"
"changed css and handler"
"edit html and add images"
You get the idea
see Audits
A few unnecessary console.log (that's been commented out). Consider removing if it serves no purposeful function
creating files for public, src, assets ...
If I'm typing in anything followed by a space, the autocomplete words go away. It works if it has a ,
I can't use the app on mobile because it's not designed to be responsive
Add link in README to webpage
Line 6 of Search.js
Clearing input should result in clear search field - instead, I get a list of the first objects of your food directory
Add structure and main elements on index.html
Any reason why?
Write the basic content for the Readme file
see Audits
What is var resultObj = {};
meant to do? On line 6
Create and build server.js, handlers.js, router.js
What is this doing on line 24?
<i class="fa fa-send"></i></button>
Hey team, after code-reviewing I feel like your team understood the objective of this week and completed a project that outlined your understanding, really awesome job! As always, when we learn something new we tend to drop the things that we learned from weeks before (I completely understand, I've been there!) But it's good to always take the time to go back and spend some time on the stuff you might've not prioritized (for example, accessibility and tests). Cheers!
No need for path and fs in your server.js if it serves no function in there
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.