lemmy-ui/src/server
matc-pub 70e382b3d9
Rework query parsing (#2396)
* Pass parsed query params as props to components

* Pass parsed query params to fetchInitialData

* Pass router Match to fetchInitialData

* Cast individual routes to their concrete types

Adds an IRoutePropsWithFetch definition for routes with getQueryParams
or fetchInitialData to cause compiler errors when the types no longer
match.

* Don't double decode query parameters.

Problem: A search for "%ab" produces a url with "%25ab". Refreshing
the page results in URLSearchParams turning "%25ab" back into "%ab".
decodeURIComponent() then complains about "%ab" being malformed.

This removes decodeURIComponent() calls for query parameters and
composes all query strings with getQueryString(), which now uses
URLSearchParams. Query parsing already goes through getQueryParams()
which also uses URLSearchParams.

* Fix for PictrsImage when src also has query params

* Small getQueryParams cleanup
2024-03-27 09:25:59 -04:00
..
handlers Rework query parsing (#2396) 2024-03-27 09:25:59 -04:00
utils Do most of the theme handling from the Theme component (#2390) 2024-03-14 08:33:49 -04:00
index.tsx Lazy load translations and date-fns, server side support for "Browser Default" language (#2380) 2024-03-13 16:39:45 -04:00
middleware.ts Move lemmyClient generation into fetchInitialData functions. Fixes #2243 (#2260) 2023-12-05 03:07:36 +00:00