News for hackers. Stuff that matters.
Re:Using React, Redux and SSR to acommodate users without Ja... by ohlookabird on Sunday June 07, 2020 @03:12AM (#23445422)
> URL as the 'global state'

Are there still (browser) limits on how long such a URL can be? Would it e.g. be possible to store a text of 50.000 words in the URL alone?

Re:Using React, Redux and SSR to acommodate users without Ja... by londons_explore on Sunday June 07, 2020 @03:32AM (#23445497)
Well you could always store the state in a database serverside and give the client some token to look up the state...
Re:Using React, Redux and SSR to acommodate users without Ja... by wereHamster on Sunday June 07, 2020 @08:01AM (#23446767)
Ah the good old JSESSIONID…
Re:Using React, Redux and SSR to acommodate users without Ja... by zodiakzz on Sunday June 07, 2020 @04:54AM (#23445874)
You can submit a form on click with an HTTP POST method - without any JavaScript. Doesn't make sense to cram so much data in a URL.
Re:Using React, Redux and SSR to acommodate users without Ja... by csiegert on Sunday June 07, 2020 @09:43AM (#23447269)
But then you don’t keep the state in the URL.
Re:Using React, Redux and SSR to acommodate users without Ja... by city41 on Sunday June 07, 2020 @11:17AM (#23447964)
Modern browsers support very long URLs. Chrome supports URLs up to 2mb for example. Probably makes sense to think about the impact on users before using such long URLs, I have found it confuses people, and can also make sharing things on social media impossible.
Re:Using React, Redux and SSR to acommodate users without Ja... by WrtCdEvrydy on Sunday June 07, 2020 @12:14PM (#23448379)
You wouldn't cram the entire state into it, but you would cram enough data to be able to recreate your state (ie, an API-backed application might store the parameters required to make API calls)