AntiEvictionBoston / Maps

Maps highlighting eviction and displacement in Boston, using leaflet.js and React.
GNU Affero General Public License v3.0
6 stars 0 forks source link

Story URLs shared on Facebook strip the hash string #88

Open heybenji opened 8 years ago

heybenji commented 8 years ago

Soo... downside of not using the pretty react-router stuff... if you share a story URL in Facebook, it just strips the hash entirely out, so you can't share a specific story.

Two solutions:

  1. Easier: Use hashbang #! syntax rather than just #. See: http://stackoverflow.com/questions/29600877/facebook-share-url-having-hash
  2. Harder: Set up a server and do routing right
alicewriteswrongs commented 8 years ago

raaa that's annoying, like dammit facebook we're using react and react-router and you're not going to play nicely with it?

alicewriteswrongs commented 8 years ago

anyway, I think 1 could be doable, I'd need to poke into whether react-router supports that quickly, 2 isn't too hard overall but we'd need to re-implement the navigation menu. that would be the main lift, setting up a quick express server and deployment to Heroku would probs only take an hour or so.

alicewriteswrongs commented 8 years ago

ah seems like hash bang urls are supported in react-router: https://github.com/reactjs/react-router/commit/a89f65c045db76b2947cdba73569946b679bc514 https://github.com/reactjs/react-router/issues/601

alicewriteswrongs commented 8 years ago

ah looks like that commit never made it's way into master.

here's a SO answer that might give us a solution: https://stackoverflow.com/questions/25086832/how-to-stop-in-browser-with-react-router/32122395#32122395

heybenji commented 8 years ago

If we could get Google crawling compliance and Facebook sharing in one go, that would be awesome. I don't fully understand the stack overflow thread, but the main thing is we'd need to handle incoming paths in the Google crawling format that my SO link talked about.

alicewriteswrongs commented 8 years ago

I'll have some time this evening to work on this, I can try out the solution in the SO thread.

alicewriteswrongs commented 8 years ago

unfortunately the solution in that SO post isn't compatible with the version of react-router we're using, I'm not exactly sure when it would have worked but it's sourcing files that aren't there anymore :(

alicewriteswrongs commented 8 years ago

I've done some searching and can't really find an easy solution to this. In my mind if it comes down to writing our own history library for react-router (or refactoring to use something other than react-router) we're getting to the point where it would be easier to just throw together a quick nodejs app.

not sure though, @heybenji what are your thoughts?