Make querystring available in load()
#2290
Labels
feature / enhancement
New feature or request
p2-nice-to-have
SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Describe the problem
The
page.query
in theload
function is a instance ofURLSearchParams
which is fine for cases that use standard queries.However there are many commonly used ways to use the query of a URL that do not work well with
URLSearchParams
.Using comma separated values for example is a commonly used practice that can fail with
URLSearchParams
.Consider the following example:
The output is clearly not the same and it is impossible to get the correct value from the instance of
URLSearchParams
.The input should be interpreted as a array of length 2 with the contents
articles
,cats,dogs
but it gets interpreted as a array of length 3 with the valuesarticles
,cats
,dogs
.Describe the proposed solution
Pass a
page.querystring
property with the unparsed querystring alongside withpage.query
to the load function.Alternatives considered
On the client the
location.search
can be used instead ofpage.query
but this is not available on the server.Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: