{"id":20509645,"url":"https://github.com/aminnairi/solid-web-history","last_synced_at":"2026-04-20T19:31:55.248Z","repository":{"id":232758565,"uuid":"785115413","full_name":"aminnairi/solid-web-history","owner":"aminnairi","description":"Web API History implementation in Solid","archived":false,"fork":false,"pushed_at":"2024-04-12T21:06:55.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-10-23T11:41:59.574Z","etag":null,"topics":["api","history","router","solidjs","web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aminnairi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-11T08:19:50.000Z","updated_at":"2024-04-12T18:09:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c97eff2-4591-4912-b604-952d1a5f0541","html_url":"https://github.com/aminnairi/solid-web-history","commit_stats":null,"previous_names":["aminnairi/solid-web-history"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aminnairi/solid-web-history","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fsolid-web-history","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fsolid-web-history/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fsolid-web-history/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fsolid-web-history/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aminnairi","download_url":"https://codeload.github.com/aminnairi/solid-web-history/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminnairi%2Fsolid-web-history/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","history","router","solidjs","web"],"created_at":"2024-11-15T20:25:49.038Z","updated_at":"2026-04-20T19:31:55.218Z","avatar_url":"https://github.com/aminnairi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# solid-web-history\n\nWeb API History implementation in Solid\n\n## Features\n\n- Written in TypeScript for maximum safety\n- Type safety when pushing a new route so that you don't push a removed or unknown route\n- Type safety when defining a page so that you don't use an unknown route parameter\n- Simple and expressive API \n- Easier times testing parameterized page\n- Functional and declarative style of programming\n\n## Requirements\n\n- Node\n- NPM\n\n## Installation\n\nComing soon...\n\n## Usage\n\n### Create a page definition\n\n```bash\nmkdir --parent src/history/pages/users\ntouch src/history/users/user.tsx\n```\n\n```typescript\nimport { Suspense, lazy } from \"solid-js\";\nimport { createWebHistoryRoute } from \"../../../library/history\";\nimport { PageLoader } from \"../../../components/loader\";\n\nconst UserPage = lazy(() =\u003e import(\"../../../pages/users/user\"));\n\nexport const { goToPage: goToUserPage, page: userPage } = createWebHistoryRoute(\"/users/:user\", ({ user }) =\u003e (\n  \u003cSuspense fallback={\u003c PageLoader /\u003e}\u003e\n    \u003cUserPage user={user} /\u003e\n  \u003c/Suspense\u003e\n))\n```\n\n### Create a page view\n\n```bash\nmkdir --parent src/pages/users\ntouch src/pages/users/user.tsx\n```\n\n```typescript\nimport { createMemo } from \"solid-js\";\nimport { InferPageProps } from \"../../library/history\";\nimport { webHistorySearchParameters } from \"../../history\";\nimport { userPage } from \"../../history/pages/users/user\";\n\nexport default function UserPage({ user }: InferPageProps\u003ctypeof userPage\u003e) {\n  const theme = createMemo(() =\u003e webHistorySearchParameters().get(\"theme\"));\n\n  return (\n    \u003ch1\u003eUser#{user} page with theme {theme()}\u003c/h1\u003e\n  );\n}\n```\n\n### Create a web history\n\n```bash\ntouch src/history/index.ts\n```\n\n```typescript\nimport { createWebHistory } from \"../library/history\";\nimport NotFoundPage from \"../pages/not-found\";\nimport { homePage } from \"./pages/home\";\nimport { aboutPage } from \"./pages/about\";\nimport { userPage } from \"./pages/users/user\";\n\nexport const { WebHistoryView, webHistorySearchParameters } = createWebHistory({\n  fallback: NotFoundPage,\n  pages: [\n    homePage,\n    aboutPage,\n    userPage\n  ]\n});\n```\n\n### Use the WebHistoryView\n\n```typescript\nimport { WebHistoryView } from \"./history\";\nimport { goToAboutPage } from \"./history/pages/about\";\nimport { goToHomePage } from \"./history/pages/home\";\nimport { goToUserPage } from \"./history/pages/users/user\";\n\nexport function App() {\n  return (\n    \u003c\u003e\n      \u003cul\u003e\n        \u003cli onClick={() =\u003e goToHomePage({})}\u003e\n          \u003cbutton\u003e\n            Home\n          \u003c/button\u003e\n        \u003c/li\u003e\n        \u003cli onClick={() =\u003e goToAboutPage({})}\u003e\n          \u003cbutton\u003e\n            About\n          \u003c/button\u003e\n        \u003c/li\u003e\n        \u003cli onClick={() =\u003e goToUserPage({ user: \"123\" })}\u003e\n          \u003cbutton\u003e\n            User#123\n          \u003c/button\u003e\n        \u003c/li\u003e\n      \u003c/ul\u003e\n      \u003cWebHistoryView /\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n### Use the search parameters\n\n```typescript\nimport { createMemo } from \"solid-js\";\nimport { InferPageProps } from \"../../library/history\";\nimport { webHistorySearchParameters } from \"../../history\";\nimport { userPage } from \"../../history/pages/users/user\";\n\nexport default function UserPage({ user }: InferPageProps\u003ctypeof userPage\u003e) {\n  const theme = createMemo(() =\u003e webHistorySearchParameters().get(\"theme\"));\n\n  return (\n    \u003ch1\u003eUser#{user} page with theme {theme()}\u003c/h1\u003e\n  );\n}\n```\n\n## Code of conduct\n\nSee [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md).\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](./CONTRIBUTING.md).\n\n## Security\n\nSee [`SECURITY.md`](./SECURITY.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminnairi%2Fsolid-web-history","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminnairi%2Fsolid-web-history","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminnairi%2Fsolid-web-history/lists"}