Feature: #91122 - Introduce DocumentService as JQuery.ready substitute

See Issue #91122

Description

The module TYPO3/CMS/Core/DocumentService provides native JavaScript functions to detect DOM ready-state returning a Promise<Document>.

Internally the Promise is resolved when native DOMContentLoaded event has been emitted or when document.readyState is defined already. It means that initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.

Impact

$(document).ready(() => {
  // your application code
});

Above JQuery code can be transformed into the following using DocumentService:

require(['TYPO3/CMS/Core/DocumentService'], function (DocumentService) {
  DocumentService.ready().then(() => {
    // your application code
  });
});