collective / collective.lazysizes

Integration of lazysizes, a lightweight lazy loader, into Plone.
https://pypi.org/project/collective.lazysizes
6 stars 2 forks source link

Plone 5: lazysizes bundle only initially cooked/created after dev mode + reload #47

Closed thet closed 6 years ago

thet commented 6 years ago

In Plone 5, after installing the collective.lazysizes package it doesn't work out of the box. The lazysizes bundle is empty and must be created/cooked by sending the resource registry into dev mode and do a reload before sending it back to production mode. That was initially even an idea by me, but I think it was not a good one. I got confused by this behavior myself. We should provide a pre-compiled/cooked version of the bundle out of the box.

hvelarde commented 6 years ago

what can I say ;-)

thet commented 6 years ago

"Preguntando caminamos"

hvelarde commented 6 years ago

is this the same issue as #32, @agitator?

@rodfersou can we use webpack here?

agitator commented 6 years ago

@hvelarde can't say for sure, but had to restart the instance to get it to work after deinstall/install

rodfersou commented 6 years ago

@hvelarde sure

thet commented 6 years ago

I'd propose a change to create (once again ;) ) conditional profiles to register resources differently for Plone 4 and 5 and not use jsregistry.xml in Plone 5 (which adds the bundle to plone-legacy and makes a re-cooking of plone-legacy necessary). Better we pre-build it and add it as a separate bundle in Plone 5. cc/ @hvelarde

hvelarde commented 6 years ago

ok, let's do it; but instead of creating 3 profiles, create only 2 and make the conditional registration in ZCML. I don't mind having files duplicated, it would be easier to deprecate Plone 4 later.

hvelarde commented 6 years ago

after merging #57 this will no longer be an issue.

hvelarde commented 6 years ago

I'm preparing a new pull request to make the resource ID unique; after that I'll close this issue.

hvelarde commented 6 years ago

a new release is available now; it should fix this issue: https://pypi.org/project/collective.lazysizes/4.1.1/