svelte-spa-router
polka
svelte-spa-router | polka | |
---|---|---|
17 | 7 | |
1,477 | 5,342 | |
- | - | |
5.7 | 4.4 | |
about 1 month ago | about 2 months ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
svelte-spa-router
- Svelte 4 Released
- UI kits, form validation, SPA routing. Why basic libraries are so hard to find.
- Svelte-spa-router: Router for SPAs using Svelte 3
-
[Q] Can I use sveltekit with rust?
But the choice depends on the type of application though. If your routes are not dynamic (not using variables within route) then you can use static site generation (SSG) which will generate the various html files. Otherwise you need to use the same file (index.html#my/dynamic/route/5). To my knowledge svelteKit doesn't support hash-based routes. You might be able to configure routing without it, but if you need that, you me be better off to use svelte with svelte-spa-router and not sveltekit.
-
Thoughts on Svelte
https://github.com/ItalyPaleAle/svelte-spa-router seems good too.
but it's not official, and Svelte project seems careless for client routing, instead it tries to convince everyone use its SSR-first kit, that "can do CSR too", which means you have to carry the whole SSR code base and its documentation into your CSR project totally unnecessarily.
I get it Vercel needs SSR for its business, I don't get it why it keeps selling everyone that "my SSR-first framework is great for CSR SPA too", it is NOT, not at all.
-
SvelteKit worth?
For a simple static site you can just use svelte with svelte-spa-router. If you want SSG, use Astro, it's a lot more mature than SvelteKit.
-
How do i make the Nav links work in Svelte?
Svelte SPA Router - You need a router. NextJS, which you have experienced in, comes with a router.
-
Some front-end web technologies you should be aware of as a newcomer 🧐
Svelte SPA Router
-
svelte-spa-router not registating external hash change
I am using Keycloak for logging into my app and svelte-spa-router for hash based routing inside my SPA. After successful login, Keycloak should redirect back to http://localhost:1234/#/myRoute . However, Keycloak appends some suffixes to this route. The route ends up looking something like this: http://localhost:1234/#/myRoute&state=hexstring&session_state=hexstring... etc As I defined my route (inside routes.js) as /myRoute , the router fails to parse the URL returned by keycloak. Looking at the source code I noticed that keycloak changes the URL back to the "clean" parameterless URL: http://localhost:1234/#/myRoute using a call to window.location.replaceState . Unfortunately, this call does not get reflected in the spa-routers internal svelte store (i.e. $location).
-
My Evaluation of SvelteKit for Full-Stack Web App Development
How does Routify compare with svelte-spa-router[1]? I really like svelte-spa-router for a simple SPA, though I think a lot of SPA routers don't always handle state well.
[1] https://github.com/ItalyPaleAle/svelte-spa-router
polka
-
Serving static files with Node.JS
Express.js, with its long-lived version 4 is famous for its somewhat low performance. Other projects like fastify or polka have benchmarks outperforming Express.js. I don’t know why Express is slower, maybe because of regex processing of routes? If you’re using parametric routes like /users/:userid/entity and have no regexp routes, then replacing Express.js with fastify or polka will add a performance boost to your app. They are not direct replacements, but you can convert code if you really need that boost. In the article below benchmarks shows huge improvement, but in reality, your code will be a limiting factor to your app performance, and you are unlikely notice any improvement.
-
My Evaluation of SvelteKit for Full-Stack Web App Development
- once released and popular, they cease getting frequent updates
Now, yes this is a generalization. It doesn't apply to all of their packages, and not at the same point in time. But there is a pattern there. Some quick diving into the author's Github account, and their more popular repos shows the pattern. It's also clear that this was a choice made by a Svelte contributor to use their own package for "official" support in Svelte Kit.
When it comes to polka itself, I just don't get why a maturing framework like Svelte would choose something whose only real advantage lies in micro-benchmarking porn [1]. Speculation aside, I'm surprised the Svelte team didn't look at that choice through a lens of higher scrutiny. Koa would have been an infinitely better choice in my personal opinion, and there are several community-driven setups [2][3] for it.
[1] https://github.com/lukeed/polka#benchmarks
[2] https://github.com/kaladivo/svelte-kit-koa-boilerplate
[3] https://blog.logrocket.com/sapper-svelte-tutorial-2021/
-
What are some packages that you used to solve problems that you encountered while developing applications?
Check out polka if you haven’t. It’s far leaner, and faster.
-
Looking For Light Weight Node API Framework
polka link
-
Deploying Sapper application to Deta.sh
Sapper, by default, uses polka as the server. I decided to use express instead.
-
Multitenancy in Next.js
Learn something new every day. This is awesome I could probably use polka instead of express.
What are some alternatives?
svelte-routing - A declarative Svelte routing library with SSR support
SvelteKit - web development, streamlined
svelte-routify-windi-vite - Svelte Starter template with Routify file-based router, WindiCSS Tailwind compiler and Vite
fastify - Fast and low overhead web framework, for Node.js
awesome-sveltekit - Awesome examples of SvelteKit in the wild
serve-static - Serve static files
electron-sveltekit - Electron and SvelteKit integration
tinyhttp - 🦄 0-legacy, tiny & fast web framework as a replacement of Express
svelte-starter-kit - Svelte with brilliant bells and useful whistles
fastify-static - Plugin for serving static files as fast as possible
routify - Automated Svelte routes
Express - Fast, unopinionated, minimalist web framework for node.