Project

General

Profile

Actions

Task #78975

closed

Refactor DOM ready check with AMD loader plugin domReady

Added by Gleb Levitin over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2016-12-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

In #70601 a lot of RequireJS AMDs were provided with a DOM ready check function to prevend their potential run into race condition.
The DOM ready check was taken with JQuery. It works, but in RequireJS there is an AMD loader plugin domReady for this purpose. It should be used instead.

Here is the appropriate API documentation and an understandable example:

http://requirejs.org/docs/api.html#pageload


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #70601: Add missing to DOM ready checks to all AMD modulesClosedMarkus Klein2015-10-12

Actions
Related to TYPO3 Core - Bug #78976: Add missing DOM ready check for JavaScripts in filelist moduleClosedFrank Nägler2016-12-13

Actions
Actions #1

Updated by Frank Nägler over 6 years ago

  • Status changed from New to Needs Feedback

We currently working on a migration to TypeScript, but this alone will not fix this issue, but now it is a good time to talk about other solutions like this one.
Can you explain what is the benefit of this plugin agains jQuery?

Actions #2

Updated by Frank Nägler about 6 years ago

  • Status changed from Needs Feedback to Closed

no feedback within the last three months, so I will close this issue for now.

Actions #3

Updated by Oliver Hader about 6 years ago

I don't think we should use the requireJS domReady plugin since

  • we basically have to deal with applications that are executed in a browser and jQuery's onReady handling in the root component handles that already
  • the mentioned plugin has not been maintained during the last 2 years and has around 130 forks
  • looking into the code reveals some "hacks", e.g. https://github.com/requirejs/domReady/blob/master/domReady.js#L86

Basically, maintaining an internal ready stack is similar in both jQuery and the requireJS plugin.

My conclusion: Let's stay with jQuery ready handling...

Actions

Also available in: Atom PDF