All Projects → mgechev → Ngx Hover Preload

mgechev / Ngx Hover Preload

🖱 Preload Angular lazy-loaded routes on mouse over

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Ngx Hover Preload

Garie
Open source web performance
Stars: ✭ 484 (+243.26%)
Mutual labels:  web-performance
Browser Perf
Performance Metrics for Web Browsers
Stars: ✭ 930 (+559.57%)
Mutual labels:  web-performance
Surf N Perf
Micro-library for gathering web page performance data
Stars: ✭ 89 (-36.88%)
Mutual labels:  web-performance
Guess Next
🔮 Demo application showing the integration of Guess.js with Next.js
Stars: ✭ 528 (+274.47%)
Mutual labels:  web-performance
Guess
🔮 Libraries & tools for enabling Machine Learning driven user-experiences on the web
Stars: ✭ 6,762 (+4695.74%)
Mutual labels:  web-performance
Awesome Mobile Web Development
All that you need to create a great mobile web experience
Stars: ✭ 1,046 (+641.84%)
Mutual labels:  web-performance
Perfjankie
Checking browser rendering performance regression
Stars: ✭ 343 (+143.26%)
Mutual labels:  web-performance
Puppeteer Webperf
Automating Web Performance testing with Puppeteer 🎪
Stars: ✭ 1,392 (+887.23%)
Mutual labels:  web-performance
Pagespeed Score
DEPRECATED - use GoogleChrome/lighthouse-ci instead
Stars: ✭ 18 (-87.23%)
Mutual labels:  web-performance
Quicklink
⚡️Faster subsequent page-loads by prefetching in-viewport links during idle time
Stars: ✭ 9,176 (+6407.8%)
Mutual labels:  web-performance
V Lazy Image
Lazy load images using Intersection Observer, apply progressive rendering and css animations.
Stars: ✭ 563 (+299.29%)
Mutual labels:  web-performance
Awesome Pagespeed Metrics
⚡Metrics to help understand page speed and user experience
Stars: ✭ 585 (+314.89%)
Mutual labels:  web-performance
Assassin
Assassin is a decentralized database that uses background threads to kill slow JavaScript.
Stars: ✭ 57 (-59.57%)
Mutual labels:  web-performance
Mozjpeg
Improved JPEG encoder.
Stars: ✭ 4,738 (+3260.28%)
Mutual labels:  web-performance
Protractor Perf
E2E test framework to check for performance regressions in Angular apps
Stars: ✭ 95 (-32.62%)
Mutual labels:  web-performance
Prerender.js
Fast webpages for all browsers.
Stars: ✭ 411 (+191.49%)
Mutual labels:  web-performance
Aurelia
Aurelia 2, a standards-based, front-end framework designed for high-performing, ambitious applications.
Stars: ✭ 995 (+605.67%)
Mutual labels:  web-performance
Kabarvirus
KabarVirus.com: cepat (PageSpeed 100), ringan (10 KB)
Stars: ✭ 109 (-22.7%)
Mutual labels:  web-performance
Keepfast
🏇 A model driven framework for the evaluation web page performance
Stars: ✭ 99 (-29.79%)
Mutual labels:  web-performance
Time Slicing
Break down long tasks into smaller tasks, avoid blocking the main process.
Stars: ✭ 74 (-47.52%)
Mutual labels:  web-performance

mgechev

ngx-hover-preload

This package exports a PreloadingStrategy, which will preload a lazy-loaded route on mouse over a corresponding router link.

Alternatives

Other preloading strategies:

  • ngx-quicklink - Preloads the modules associated with all links visible in the viewport. Quicklink does more aggressive preloading compared to ngx-hover-preload, which makes it more network and CPU intensive.
  • Guess.js - Most advanced preloading strategy, which uses predictive prefetching. At build-time Guess.js compiles a data analytics model and includes it in your production bundle, so that at runtime after each navigation Guess.js prefetches only the modules that are likely to be needed next. Guess.js works particularly well with ngx-hover-preload, because if the prediction was wrong the preloading mechanism gracefully fallbacks to hover.

Example

Example is available here.

Usage

Install the module:

yarn add ngx-hover-preload

Import the HoverPreloadModule in your AppModule and your lazy-loaded modules to ensure the required directives are available:

// ...
import { HoverPreloadModule } from 'ngx-hover-preload';

@NgModule({
  declarations: [
    // ...
  ],
  imports: [
    // ...
    HoverPreloadModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Make sure you import the HoverPreloadModule in all lazy-loaded modules in which you want to have this functionality available

Don't forget to set the HoverPreloadStrategy as your preloadStrategy:

// ...
import { HoverPreloadStrategy } from 'ngx-hover-preload';

@NgModule({
  // ...
  imports: [RouterModule.forRoot(routes, { preloadingStrategy: HoverPreloadStrategy })],
})
export class AppModule {} // or AppRoutingModule

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].