question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rename `params` to `slugs` in load

See original GitHub issue

Describe the problem

in load function we have instead of page now parameters url and params… params is derived from url.pathname, but url has also property url.searchParams… because of that it’s kind of confusing as “params” can now refer to both parameters like ?x=value or to params like /[slug]/ … I even twice was burned on that I did “const params = url.searchParams” in load function and rewrited params object from params of load function. (see, a lot of params word in this sentence)…

Describe the proposed solution

let url be url, and params be named slugs

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Rich-Harriscommented, Feb 1, 2022

Unless we can find a name that’s unambiguously better than params, I think we probably need to keep it as-is. It was chosen because it matches req.params in Express apps, and is also used by Nuxt…

image

…and Remix:

image

It shouldn’t be the overriding consideration, but there’s value in using the same terminology as the wider ecosystem.

1reaction
didiercommented, Feb 1, 2022

Yeah, my thought process behind sections was that they are literal sections of the url. example.com/<section>/<section>, etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rename files during upload using variables
With this plugin you can construct paths from additional variables like: post title, ID, category, post author, post date and much more. How...
Read more >
Laravel: Resource Controller change parameter from ID to Slug
For Resource Routing the route parameter is the resource name, first argument, in singular form. Route::resource('categories' ...
Read more >
Django Slug Tutorial | LearnDjango.com
In this tutorial we will add slugs to a Django website. As noted in the official docs: "Slug is a newspaper term. A...
Read more >
The useQuery hook - with variables | Lift-off III - Apollo GraphQL
Use the useQuery hook to send the GET_SPACECAT query to the server. It takes a spaceCatId as a variable. Destructure the loading ,...
Read more >
wp_update_term() | Function - WordPress Developer Resources
Parameters · alias_of string. Slug of the term to make this term an alias of. Default empty string. Accepts a term slug. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found