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.

Extending the demo app to have parameterized routes

See original GitHub issue

Describe the problem

I’ve often wished the Sveltekit demo app was a little more full-featured. Right now it has 3 pages with fixed URLs and that’s it. I wish it had a route with path params in it, and even better, links between the same route using different params, to exercise afterNavigation.

Right now I’m dealing with a bug related to afterNavigation and live reload in the dev server, and having a more complete demo app would be a nice starting point for a repro case.

Describe the proposed solution

What if each TODO had its own detail page, and links to the previous and next todo.

Alternatives considered

Maybe instead of extending the existing TODO demo app, we should add a second “kitchen sink” demo app that exercises all the features?

Importance

nice to have

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
dummdidummcommented, Nov 1, 2022

Coming back to this, I’m not sure if I’d want the demo app to become more fully-featured than it is now. Where would that end? How would we add them to the demo in a way that makes sense? At what point this is just overlap with the tutorial which will touch on all these parts? I’m thinking it’s better to instead update the realworld repo to the newest version once we are done with the other things, and possibly also making that movies app.

1reaction
luisgabrielmcommented, Apr 8, 2022

Hello @antony , I agree with you that adding a detailed page for the TODO app might be extending the demo more than it was originally intended.

I would like to bring my point of view to the discussion of a new demo app.

IMO a good demo project has 2 goals:

  • Sell the framework and have people interested in studying it further;
  • Be a good starting point / tutorial / cheat sheet for new users.

So I think in the case of SvelteKit that means the demo app should:

  • Showcase the main features of the framework;
  • Be clear, direct and easy to understand;
  • Always be compatible with the latest stable version;
  • Be plug and play (not require additional config or .env set up).

List of main Svelte/Sveltekit features that we might include in the demo app (not trying to be super detailed or complete here, just bringing some ideas):

  • Reactivity / bindings (bind:vale etc.)
  • layouts
  • filesystem routing (and dynamic routes)
  • stores
  • lifecycle management (onMount etc.)
  • svelte file syntax (including css scopes)
  • animations / transitions
  • typescript support
  • hooks
  • events (on:hover, on:click etc.)
  • SSR
  • pages vs endpoints
  • accessibility support

An idea for a new app that comes to mind is to: Use a public API, that doesn’t require a key, to create a “showcase” website. E.g. use Nasa, The Met, PokeAPI to create a “planet explorer”, “art catalogue” or a “Pokedex”.

I thought about these APIs because they’re easy to use, public and not directly related to any big tech player like Microsoft or Google.

The demo could have a home page showing many items and a details page using dynamic routing, utilizing SSR, animations, stores etc.

A big downside to this approach is that if any of these APIs have a major change or starting using private keys the demo would need to be redone. Even though I don’t think that’ll happen it’s a possibility.

What are your thoughts about it? Cheers ✌️

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Router DOM: How to handle routing in web apps
To demonstrate how React Router DOM works, we'll create an example React app. You can find an interactive demo on CodeSandbox.
Read more >
Step 31: Routing with Parameters - Documentation - Demo Kit
We register an internal callback function _onObjectMatched that will be executed when the route is hit, either by clicking on the item or...
Read more >
Routing in ASP.NET Core - Microsoft Learn
Routing is responsible for matching incoming HTTP requests and dispatching those requests to the app's executable endpoints.
Read more >
Composability System · Backstage Software Catalog and ...
There is also a primitive called component data, which helps keep the structure of the app more declarative. There are also RouteRef s...
Read more >
Passing Parameters to Route - Angular 13+ - YouTube
We have learned how to define a route in angular using Angular Routing. In a route we can also pass a parameter whose...
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