Questions tagged [lazy-loading]

For programming questions about "lazy loading", a design pattern that defers initialization of an object until the point at which it is needed.

Lazy loading is a commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program's operation if properly and appropriately used. The opposite of lazy loading is Eager Loading.

5918 questions
2
votes
1 answer

[React Webpack]: Module not found: Error: Can't resolve 'src/views/UserList' in 'C:\Users\....'

I have a create-react-app application working 100% , I want to integrate webpack4 to deploy my app but after configuring webpack when I 'npm dev run' I get those errors on every lazy import line: Module not found: Error: Can't resolve…
Ahmed Derbel
  • 37
  • 2
  • 8
2
votes
2 answers

angular hybrid app, lazy loaded module does not work when page refreshed

I have an angular hybrid app (angularjs with angular) with lazy loading on one of the feature modules. The feature module is declared the following way const contactFs: NgHybridStateDeclaration = { name: 'contact.v2.**', url:…
pandith padaya
  • 1,643
  • 1
  • 10
  • 20
2
votes
0 answers

Combine Js Lazy load (no external plugin) with responsive images breakpoints data-srcset . How should I fix this?

I'm trying to combine Js Lazy load with responsive images breakpoints. The algorithmic concept is to find image width values that offer a significant reduction in file size. Images are analyzed to find the best breakpoints on an image by image…
2
votes
0 answers

WordPress compression not working on localhost, XAMPP

I need some help with WordPress speed optimization via .htaccess. For now, the website is still running on localhost, XAMPP, Apache v3.2.4. What I did / tried: turn on GZip in .htaccess enable mod deflate in .htacess place .htaccess in WordPress…
Cinder
  • 319
  • 2
  • 15
2
votes
0 answers

How to lazy load base 64 image with angular?

My products api returns products info which includes image name to download asynchronously. {products: [ {name: 'test product 1', price: 'xxxx', image: 'product1.jpg' etc..} {name: 'test product 2', price: 'xxxx', image: 'product2.jpg' etc..} …
2
votes
1 answer

Angular lazy loaded module with child component default route

Angular 9. Child component is not loaded with lazy loaded module component. Here is my code. app-routing.module.ts { path: '', redirectTo: '/auth', pathMatch: 'full' }, { path: 'auth', loadChildren: () =>…
ahsan ayub
  • 286
  • 2
  • 17
2
votes
0 answers

Dynamic import() and render a React component module

This is a Lazy Route component I wrote a while ago (code below). This is what it does: It initially render a lazyLoading = true state to show some spinner or something. Then on useEffect it will dynamic import() a component module and set the…
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
2
votes
2 answers

Trying to implement a React "Lazy" route for code splitting with React Route and Webpack

I'm trying to implement a "lazy-route" to achieve code splitting in my React single page app. It's all client side rendered I'm using react-router Also using Webpack I have this component that renders all my routes. AllRoutes.js function…
cbdeveloper
  • 27,898
  • 37
  • 155
  • 336
2
votes
0 answers

Lazy Load the swiper slider images when it is not in viewport

I am currently using Swiper 5.3.7. Everything works fine except the Lazy Loading. I am using a separate Lazysizes for Lazy Loading images in the site. And I am aware that Swiper slider provides Lazy Loading only for images that are inside the…
keekee
  • 21
  • 2
2
votes
2 answers

lazily load a dictionary

I have some code that fills two dictionaries void Load(out Dictionary m1, out Dictionary m2) { ... } which I want to execute only when I need access to either of the dictionaries. As there are many methods that rely…
MakePeaceGreatAgain
  • 35,491
  • 6
  • 60
  • 111
2
votes
1 answer

Why my EF collection are not lazy?

I'm using EF 4.1 Code first. I have a model of user and a model of setting. Each time the repository returns a user the Setting is also loaded. I've marked the Setting as virtual all my access modifiers are public LazyLoadingEnabled and…
Sagi
  • 8,972
  • 3
  • 33
  • 41
2
votes
1 answer

Electron: Lazy element type must resolve to a class or function (in production mode)

I am trying to make an desktop app using electron and react. But when I am using React.lazy() it doesn't work in production mode when I package app and it shows just an empty screen (in dev mode it works fine always) Here is an error: Element type…
Ivan Salo
  • 811
  • 1
  • 9
  • 25
2
votes
1 answer

Wordpress Smush Lazy Loading adds padding, how to exclude specific image

For some reason when I have Smush Image Lazy Loading enabled, it adds a padding on some of the Elementor elements. Since this is a Elementor widget from a plugin (Happy Addons) I have no control of the HTML source of the widget, thus I can't add a…
Bram
  • 2,515
  • 6
  • 36
  • 58
2
votes
0 answers

Angular 8 - Bundle some npm package in lazy-loaded module instead of vendor

So I have a lazyloaded module called "ProductModule", which is responsible of my product page. export const routes: Routes = [{ matcher: productMatcher, loadChildren: './+product/product.module#ProductModule', }] In this module, we use a…
dolig
  • 134
  • 9
2
votes
3 answers

Angular Reactive Form Group Issues with Lazy Loaded Components

I am trying to Implement A Reactive form in one of the Lazy Loaded Component and I am getting the following error. Stackblitz Link ERROR Error: Uncaught (in promise): Error: Template parse errors: Can't bind to 'formGroup' since it isn't a known…
1 2 3
99
100