58890[TASK] Drop jQuery dependency in FormControl modules
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 10
- typo3/sysext/backend/Resources/Private/TypeScript/FormEngine/FieldControl/AddRecord.ts+1 −2
- typo3/sysext/backend/Resources/Private/TypeScript/FormEngine/FieldControl/InsertClipboard.ts+1 −2
- typo3/sysext/backend/Resources/Private/TypeScript/FormEngine/FieldControl/ListModule.ts+1 −2
- typo3/sysext/backend/Resources/Private/TypeScript/FormEngine/FieldControl/ResetSelection.ts+1 −3
- typo3/sysext/backend/Resources/Private/TypeScript/FormEngine/FieldControl/TableWizard.ts+1 −2
- typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/FieldControl/AddRecord.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/FieldControl/InsertClipboard.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/FieldControl/ListModule.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/FieldControl/ResetSelection.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/FieldControl/TableWizard.js+1 −1
Review log 1415
-
Andreas Kienast uploaded patch set 1 11/13/18, 16:47
-
TYPO3com voted on patch set 1 V +1 11/13/18, 16:56 Completed build in 08m 34s on Tue, 13 Nov, 05:56 PM Test Summary: 48464 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30133
-
Andreas Kienast commented on patch set 1 11/13/18, 18:36
This needs proper testing in all suppirted browsers. -
Markus Klein commented on patch set 1 11/13/18, 21:43
You are aware of the "slight" difference of the ready function and the native way? Most browsers provide similar functionality in the form of a DOMContentLoaded event. However, jQuery's .ready() method differs in an important and useful way: If the DOM becomes ready and the browser fires DOMContentLoaded before the code calls .ready( handler ), the function handler will still be executed. In contrast, a DOMContentLoaded event listener added after the event fires is never executed. https://api.jquery.com/ready/ -
Markus Klein commented on patch set 1 11/13/18, 21:44
So we not only need testing in all browsers, but more importantly tests with a lot of different connection speeds to avoid timing issues -
Andreas Wolf commented on patch set 1 11/14/18, 01:48
Good point Markus, I've been bitten by this in the past as well. However, there is a way to circumvent this. Have a look at https://github.com/ded/domready/blob/master/ready.js for example. I think we should either include and use that, or create a similar module in our code. For reference, the trick is to encapsulate the functionality in a custom method, that checks if the event has been fired (i.e. if the readyState of document is set accordingly), and if yes, immediately executes the passed callback. I guess this is also what jQuery does. -
Andreas Kienast commented on patch set 1 11/14/18, 01:57
When we go with another library, we should go with domReady, which acts as a RequireJS plugin. -
Markus Klein commented on patch set 1 11/14/18, 10:00
Fine with me, I would not implement that ourselves if I look at the code which domReady ships... It's just not nice ^^ -
Andreas Wolf commented on patch set 1 11/14/18, 10:57
Yes, but I think that with some proper comments, the code would be more readable… as it currently is, I'm not sure if minification actually makes it worse :-D -
Benni Mack commented on patch set 1 11/15/18, 09:07
Hey Andy, can you update the patch using domReady from requireJS? -
Andreas Kienast commented on patch set 1 11/15/18, 09:56
> Patch Set 1: > > Hey Andy, can you update the patch using domReady from requireJS? Hi, probably not today. I guess I'll make it at the weekend, we're rolling to our gate now :D -
Andreas Kienast commented on patch set 1 11/18/18, 14:04
I found this ticket regarding domReady: https://forge.typo3.org/issues/78975 Now I question myself whether we should use that library after I've read Olly's remark on this. What do you think? Long term goal: I think we should reduce the usage of jQuery in future, especially since browsers have a common set of APIs, but AFAICS there are no separated jQuery "modules" that tackle our specific needs. I opt to keep the jQuery stuff here for now, until we have a proper solution. -
Markus Klein commented on patch set 1 11/18/18, 19:59
Fine with me. I don't know if there is a "more" proper solution than jQuery already has to be honest. -
Benni Mack commented on patch set 1 11/19/18, 07:52
yup. let's keep jQuery for now. -
Andreas Kienast abandoned the change 11/19/18, 08:03