turingschool-projects / lookingForFrontEnd

A job search app built with React
https://looking-for.herokuapp.com/
5 stars 5 forks source link

Revert back to browserHistory #75

Closed saylerb closed 8 years ago

saylerb commented 8 years ago

Fixes #71

Reverting back to using browserHistory instead of hashHistory.

I was banging my head against the wall today trying to get this to work, and I finally came around to playing with the express server. It seems like changing the route from "/" to "*" fixed everything.

I also tried to convert some of the server code to ES6 in anticipation of Lucy's style guide, but I couldn't use export default app at the bottom instead of module.exports = app. Not sure why.

I tested this using nodemon as well as using web-pack-server. It seems to correctly support opening a new tab to view the detail page, as well as correctly opens a new tab when clicking "View job posting" on the detail page.

I haven't wrote any automated tests for this, since I'm still pretty new to routing in react. Suggestions for how to test this are welcome!

To 'test' this branch:

  1. Pull Down the branch
  2. Check running on nodemon server (npm start)
    • Navigate to localhost:8080/
    • click "view details" on one of the jobs OR try to open "view details" in a new tab.
    • Does the detail page load correctly? If yes, view job posting.
    • Does a new tab open with the external job posting?
  3. Check running on webpack-dev server (npm run dev)
    • Navigate to http://localhost:8080/webpack-dev-server/
    • click "view details" on one of the jobs OR try to open "view details" in a new tab.
    • Does the detail page load correctly? If yes, click "view job posting".
    • Does a new tab open with the external job posting?
saylerb commented 8 years ago

I've pushed this up to a staging heroku application here https://afternoon-plains-39747.herokuapp.com/ , and it seems to be working smoothly. I had to remove a let variable declaration, since Heroku complained. The changes are now production-ready. @robbiejaeger

robbiejaeger commented 8 years ago

I loaded the staging app and could not reproduce the bug - so it looks good to me.