Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a paragraph about URL encoding #83

Open
lelabo-m opened this issue Jan 15, 2024 · 2 comments
Open

Add a paragraph about URL encoding #83

lelabo-m opened this issue Jan 15, 2024 · 2 comments

Comments

@lelabo-m
Copy link
Contributor

Picking the package, I took time to read the docs to know if I should encode the content passed to $path.
Please let me know if I am wrong, but I found no information on the subject.

From the Motivations page, I believe this feature was part of the package.
After a quick dive into the source, I found that it was indeed the case.

I believe it should be mentioned clearly in the docs somewhere.
Should I make a PR for this kind of change (in the future)?

@ethanniser
Copy link
Owner

encoding / decoding is all handled by the library (internally with JSON.stringify and encodeURIComponent, and then conversely JSON.parse and decodeURIComponent before being passed to whatever zod validator you provide)

if you think it would be helpful to have a note explaining this process in the docs I can definitely add it

@lelabo-m
Copy link
Contributor Author

Maybe it is just me, I am still a junior in frontend and unfamiliar with all the commons...
But genuinely, after a video about this problem recently, my first question was "Do I still need to encode my params? It does not say otherwise".
But having seen the features from Tanstack, I had the intuition it was builtin in the solution, just not mentioned.

One line somewhere to clearly state it is handled would be enough.

But, as a newbie, to be clear, I would add a bullet in the Motivations page, in your How does next-typesafe-url solve these problems? and also add a section in Groundwork to reflect the addition to your claims.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants