plone / plone.patternslib

An add-on to make patternslib patterns available within Plone 5.
https://pypi.org/project/plone.patternslib/
GNU General Public License v2.0
2 stars 5 forks source link

Traceback with `andSelf` while trying to initialize leaflet pattern (Plone 6) #57

Open laulaz opened 3 years ago

laulaz commented 3 years ago

On Plone 6 (buildout.coredev), we have a traceback when trying to use leaflet (because of andSelf removal in jQuery > 3):

patterns.pat.leaflet: Failed while initializing 'leaflet' pattern. TypeError: $el.parents().andSelf is not a function

Replacing it by addBack() works like a charm ... for this pattern.

I don't know how jQuery versions are handled between the different Plone packages / patterns, so I would like to have inputs on the best way to fix that everywhere without breaking code still using old jQuery version(s).

laulaz commented 3 years ago

@thet @jensens any advice on this ? 😉

petschki commented 3 years ago

Same here ... so the solution would be to lift patternslib version here to the latest patterns release right? https://github.com/Patternslib/Patterns/releases ... there, the parser ist fixed ... among many other possibly breaking changes ... maybe then we have to bump plone.patternslib version to 2.0.0 for Plone 6 ...

/cc @thet do you have any advice on this? is it possible to get patternslib 4.0.0 into plone.patternslib 2.0.0 ?

yurj commented 2 years ago

with patternslib 7.X, I'm quite confused on how it will work on plone 6. We have:

Patternslib -> plone.patternslib -> pat-leaflet.

With es6 and module federation, how this will work?

petschki commented 2 years ago

IIUC in Plone6 we do not need plone.patternslib anymore, because its included in mockup. But https://github.com/Patternslib/pat-leaflet needs some love to work with Plone 6 ES6 updates ...

yurj commented 2 years ago

So mockup will include (via npm?) Patternslib, which must be updated (at least for plone.patternslib) to work with es6. Is there a way I can test this setup, is the es6 plip enough?

petschki commented 2 years ago

mockup#es6 includes patternslib here https://github.com/plone/mockup/blob/es6/package.json#L10 ... I think this could savely be updated to 7.0.1 there ... so plone.patternslib is obsolete for mockup#es6 and therefore Plone 6 ... but as said, I don't think pat-leaflet is working right now with patternslib>=6.4.0 ... @thet am I right?

petschki commented 2 years ago

@yurj you could simply add https://github.com/Patternslib/pat-leaflet to your sources/auto-checkout along with the plip-3411 checkouts and see what happens 💣

yurj commented 2 years ago

The new 2.1.5 has the same problem.