{"id":23028499,"url":"https://github.com/push-based/ngx-speculative-link","last_synced_at":"2025-04-17T08:47:19.467Z","repository":{"id":268242341,"uuid":"902546007","full_name":"push-based/ngx-speculative-link","owner":"push-based","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-13T21:45:45.000Z","size":250,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-29T06:04:49.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/push-based.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-12T19:25:43.000Z","updated_at":"2025-03-06T01:50:57.000Z","dependencies_parsed_at":"2024-12-15T14:05:00.358Z","dependency_job_id":"99c49713-2a89-477d-ae72-894ad196a3cb","html_url":"https://github.com/push-based/ngx-speculative-link","commit_stats":null,"previous_names":["push-based/ngx-speculative-link"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/push-based%2Fngx-speculative-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/push-based%2Fngx-speculative-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/push-based%2Fngx-speculative-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/push-based%2Fngx-speculative-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/push-based","download_url":"https://codeload.github.com/push-based/ngx-speculative-link/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249326685,"owners_count":21251755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-15T14:01:33.030Z","updated_at":"2025-04-17T08:47:19.440Z","avatar_url":"https://github.com/push-based.png","language":"TypeScript","readme":"# NgxSpeculativeLink\n\nAn Angular implementation of [Speculative Rules API](https://developer.mozilla.org/en-US/docs/Web/API/Speculation_Rules_API) \ninspired by [quicklink](https://github.com/GoogleChromeLabs/quicklink) and [ngx-quicklink](https://github.com/mgechev/ngx-quicklink).\n\n**IMPORTANT**\nThis is currently in its discovery phase, there will be changes to the underlining implementation and its APIs.\n\n## How it works\n\nNgxSpeculativeLink attempts so improve the performance of future navigation with preloading, prefetching and pre-rendering. \n\nUnder the hood it uses an IntersectionObserver to identify which links are in the viewport and are potential future navigations.\nThen using pattern matching we identify the routes connected to the link, preload the routes and execute a preResolverFunction when it enters the viewport.\n\n## Usage\n\nProvide the Speculative Link Preloading Strategy to the router:\n\n```ts\nexport const appConfig: ApplicationConfig = {\n    providers: [\n        // ... other providers\n        provideRouter(appRoutes, withSpeculativeLinkPreloading()),\n    ],\n};\n```\n\nAdd Speculative Link Functionality to an element:\n\n```html\n\u003ca href='/path' speculativeLink='/home'\u003e\u003c/a\u003e\n```\n\nAdd preResolver functionality to a route:\n\n```ts\nconst route: Route = {\n    path: ':event',\n    data: {\n        preResolver: (linkData: PreResolver) =\u003e {\n            // Executed in the injection context of the route or the root\n            inject(HomeResolver).preloadData(linkData);\n        }\n    }\n}\n```\n","funding_links":[],"categories":["Third Party Components"],"sub_categories":["Router"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpush-based%2Fngx-speculative-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpush-based%2Fngx-speculative-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpush-based%2Fngx-speculative-link/lists"}