page.js
crossroad
Our great sponsors
page.js | crossroad | |
---|---|---|
4 | 5 | |
7,665 | 31 | |
0.2% | - | |
0.0 | 0.0 | |
10 months ago | over 1 year 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.
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.
[1] https://github.com/visionmedia/page.js
-
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.
crossroad
-
What are your favorite, must-have packages when you're creating a project?
https://crossroad.page/ (1.74kb) routing, similar to React Router
-
React Router 6.4 Release
Seeing the direction React Router was taking (even before they started mixing things with data loading/management), I wrote a small alternative https://crossroad.page/ that only does routing but does it following modern React best practices:
-
Show HN: React Routing in 120 lines (including comments)
1kb is likely a lot more than what is shown here; I made a "tiny" but very complete React Router package which is very complete and minified+gzip it's just 1.8kb https://crossroad.page/
-
Not Another Framework
The author claims to "learn JS/HTML", but the first example is importing a custom component called Link with who knows what inside, which I find especially ironic because I made a small library[1] for routing in React where links are just links:
Login
[1] https://crossroad.page/
-
Ask HN: What are you using for public documentation these days?
I have an unfinished side project called Documentation Page:
https://documentation.page/
It's "unfinished" because I'd need to integrate payments and do all the accounting on my side (non-trivial as an individual living in Japan), but otherwise it's worked pretty well for my own projects.
It parses your Github Repo (according to https://documentation.page/documentation#getting-started) to generate the website. It can be a single readme.md file (for smaller projects), a folder called "documentation", or you can configure it otherwise. Some examples hosted by Documentation Page:
- statux.dev: simple single-page docs and website, menu config in https://github.com/franciscop/statux/blob/master/documentati.... Similar to form-mate.dev & vector-graph.com
- react-test.dev: split into multiple pages, you specify the folder and it'll automatically merge the markdown files. See config https://github.com/franciscop/react-test/blob/master/documen...
- crossroad.page: has an landing page, but that is not officially supported (yet). See the configs in https://github.com/franciscop/crossroad/blob/master/document...
What are some alternatives?
director - a tiny and isomorphic URL router for JavaScript
hookrouter - The flexible, and fast router for react that is entirely based on hooks
crossroads - JavaScript Routes
universal-router - Universal routing both for backend and frontend
pathjs - Simple, lightweight routing for web browsers
manconvert - Convert troff-style man pages to doxygen source or formatted HTML
frontexpress - An Express.js-Style router for the front-end
typesense-docsearch-scraper - A fork of Algolia's awesome DocSearch Scraper, customized to index data in Typesense (an open source alternative to Algolia)
navaid - A navigation aid (aka, router) for the browser in 850 bytes~!
one-app-router - ✨Declarative routing for One App forked from React Router 3
SPApp - Single Page Application micro framework. Views, routes and controllers in 60 lines of code
davis.js - RESTful degradable JavaScript routing using pushState