react-snippets
page.js
Our great sponsors
react-snippets | page.js | |
---|---|---|
8 | 4 | |
307 | 7,660 | |
- | 0.2% | |
0.0 | 0.0 | |
almost 2 years ago | 10 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.
react-snippets
- Show HN: WebSockets with Request and Response in JavaScript
-
Show HN: React Routing in 120 lines (including comments)
I updated the repo for this (and credited you in the code). If you have time, please feel free to review & improve as looks like quite a few people are using the code now: https://github.com/ashok-khanna/react-snippets/blob/main/Rou...
-
Hacker News top posts: May 13, 2022
Show HN: React Routing in 120 lines\ (27 comments)
- Routing in 120 Lines (including comments)
- Routing in React in 120 Lines (including. how-to guide)
page.js
-
Show HN: React Routing in 120 lines (including comments)
I've used a lot of routers and my favorite is still page.js[1]. It hasn't been updated in years. But it's small, is Express-compatible (i.e. server/client routes can use the same code), and, more importantly, is hackable. I'll never use a router tied to a certain framework again (react, nextjs, etc.) because you trade flexibility for perceived convenience (e.g. using folder structure as route structure, or React component tree as route structure). But it's a terrible trade-off that paints you into a corner later, IMO. Routing can get really niche and site-dependent, so having it fully under your control is worth it.
-
Dynamic routes using vanilla HTML CSS JS?
Use a simple routing library like pages.js, but in this case I feel it might be overkill.
-
[AskJS] Are there any framework agnostic routing libraries that are well supported?
I've used Page.js for a couple of SPA projects. It was last updated a couple of years ago. The documentation isn't the best, but the client-side router does its job.
-
Building a blog with Svelte: Dynamic imports For Svelte components
We're using onMount to trigger the dynamic import when this component is first rendered. My blog uses page.js as a router, so these dynamic imports are triggered by page transitions, but the logic is the same.
What are some alternatives?
MagLit - 🔥 MagLit - Privacy Respecting Encrypted Link Shortener with Password Protection and Torrent Magnet Links support
director - a tiny and isomorphic URL router for JavaScript
todomvc - Helping you select an MV* framework - Todo apps for React.js, Ember.js, Angular, and many more
crossroads - JavaScript Routes
universal-router - Universal routing both for backend and frontend
pathjs - Simple, lightweight routing for web browsers
awesome-go-orms - ORMs for Go, most starred on GitHub.
frontexpress - An Express.js-Style router for the front-end
tokay - Tokay is a programming language designed for ad-hoc parsing, inspired by awk.
navaid - A navigation aid (aka, router) for the browser in 850 bytes~!
wouter - 🥢 A minimalist-friendly ~2.1KB routing for React and Preact
SPApp - Single Page Application micro framework. Views, routes and controllers in 60 lines of code