Skip to content
Snippets Groups Projects
  1. Feb 16, 2022
    • Benjamin Franzke's avatar
      [TASK] Use @TYPO3/ as ES6 module namespace · 7a41f905
      Benjamin Franzke authored
      Switch from TYPO3/CMS/ExtName/ to @typo3/ext-name/ module
      namespace in all TypoScript modules in order to
      use the common "scoped package" syntax as known from npmjs.
      
      This will allow TYPO3 TypeScript declarations to be
      published to @TYPO3/* packages on npmjs.com at some point,
      allowing extension authors to require these as npm/yarn
      dependencies to be able to use TypeScript type declarations
      when developing against the TYPO3 JavaScript API.
      
      While at it, the naming convention of JavaScript modules is
      also switched to use lowercase-dashed form. This is to adhere
      to the common used naming convention in the npm-world.
      Also @typo3/core/ajax/ajax-request.js simply looks better than
      a mixed form @typo3/core/Ajax/AjaxRequest.js would be.
      
      All existing RequireJS module identifiers are mapped
      to the new naming syntax in the requirejs-to-es6 bridge:
      For example a requirejs call to
        TYPO3/CMS/T3editor/Element/CodeMirrorElement
      will transparently be transformed to the new scheme:
        @typo3/t3editor/element/code-mirror-element.js
      
      Manual modifications in:
      
        Build/Gruntfile.js
        Build/util/map-import.js
        Build/JSUnit/karma.conf.js
        Build/Sources/TypeScript/backend/Resources/Public/TypeScript/viewport/navigation-container.ts
        typo3/sysext/core/Resources/Public/JavaScript/requirejs-loader.js
        typo3/sysext/core/Tests/Functional/Page/PageRendererTest.php
        typo3/sysext/core/Tests/Unit/Page/Fixtures/ImportMap/package2/Configuration/JavaScriptModules.php
        typo3/sysext/core/Tests/Unit/Page/Fixtures/ImportMap/package3/Configuration/JavaScriptModules.php
        typo3/sysext/core/Tests/Unit/Page/ImportMapTest.php
        typo3/sysext/t3editor/Configuration/JavaScriptModules.php
      
      All other changes have been automated with:
      
      find Build/Sources/TypeScript/ -type f | \
          grep -v index.d.ts | \
          sed \
              -e 's:Build/Sources/TypeScript/:typo3/sysext/:' \
              -e 's:/Tests/:/Tests/JavaScript/:' \
              -e 's:/TypeScript/:/JavaScript/:' \
              -e 's:\.ts$:.js:' | \
          xargs git rm
      
      find Build/Sources/TypeScript/ -type f | while read file
      do
          newFilename=$(echo $file | sed \
              -e :loop1 -e 's:\(/Public/TypeScript\|/Tests\)\([0-9a-zA-Z/.]*\)/\([A-Z][A-Z]*\)\([0-9a-zA-Z/-]*\)\.ts:\1\2/\L\3\E\4.ts:' -e 't loop1' \
              -e :loop2 -e 's:\(/Public/TypeScript\|/Tests\)\([0-9a-zA-Z/.]*[a-z]\)\([A-Z][A-Z]*\)\([0-9a-zA-Z/-]*\)\.ts:\1\2-\L\3\E\4.ts:' -e 't loop2' \
              -e s:/Resources/Public/TypeScript/:/: \
              -e s:/Tests/:/tests/:
          )
      
          mkdir -p $(dirname "${newFilename}")
          [[ "$file" != "$newFilename" ]] && git mv "${file}" "${newFilename}"
      done
      
      cat << EOF > convert_uppercase_to_lowercase.sed
      :loop1
      s:\(TYPO3/CMS[0-9a-zA-Z/]*\)/\([A-Z]\)\([0-9a-zA-Z/-]*\.js\):\1/\l\2\3:
      t loop1
      
      :loop2
      s:\(TYPO3/CMS[0-9a-zA-Z/]*[a-z]\)\([A-Z]\)\([0-9a-z/-]*\.js\):\1-\l\2\3:
      t loop2
      
      s:TYPO3/CMS/\([0-9a-z/-]*\.js\):@TYPO3/\1:g
      
      :loop3
      s:\(^import \|^import .* from \|import(\|declare module \)'\([0-9a-zA-Z/.]*\)/\([A-Z][A-Z]*\)\([0-9a-zA-Z/.-]*\)':\1'\2/\L\3\E\4':
      t loop3
      
      :loop4
      s:\(^import \|^import .* from \|import(\|declare module \)'\([0-9a-zA-Z/.]*[a-z]\)\([A-Z][A-Z]*\)\([0-9a-z/.-]*\)':\1'\2-\L\3\E\4':
      t loop4
      
      :loop5
      s:\(\* Module\:\{0,1\} \|\* @exports \|\* @module \)\([0-9a-zA-Z/.]*\)/\([A-Z][A-Z]*\)\([0-9a-zA-Z/.-]*\)$:\1\2/\L\3\E\4:
      t loop5
      
      :loop6
      s:\(\* Module\:\{0,1\} \|\* @exports \|\* @module \)\([0-9a-zA-Z/.]*[a-z]\)\([A-Z][A-Z]*\)\([0-9a-z/.-]*\)$:\1\2-\L\3\E\4:
      t loop6
      
      s:\(^import '\|^import .* from '\|import('\|declare module '\|\* Module\:\{0,1\} \|\* @exports \|\* @module \)TYPO3/cms/\([0-9a-z/.-]*\):\1@typo3/\2:g
      
      s:@typo3/rte_ckeditor:@typo3/rte-ckeditor:
      
      s:TYPO3/CMS/Backend/Module/Iframe:@typo3/backend/module/iframe:
      s:TYPO3/CMS/Backend/PageTree/PageTreeElement:@typo3/backend/page-tree/page-tree-element:
      s:TYPO3/CMS/Backend/Tree/FileStorageTreeContainer:@typo3/backend/tree/file-storage-tree-container:
      s:TYPO3/CMS/Impexp/ContextMenuActions:@typo3/impexp/context-menu-actions:
      s:TYPO3/CMS/Install/chosen.jquery.min.js:@typo3/install/chosen.jquery.min.js:
      
      s:Public/JavaScript/JavaScriptItemHandler.js:Public/JavaScript/java-script-item-handler.js:
      s:Public/JavaScript/RequireJSConfigHandler.js:Public/JavaScript/require-jsconfig-handler.js:
      s:Public/JavaScript/AdminPanel.js:Public/JavaScript/admin-panel.js:
      EOF
      
      git ls-tree --name-only -r HEAD | \
          grep -v dashboard/Documentation/ | \
          grep -v Documentation/Changelog/ | \
          grep -v Build/JSUnit/ | \
          xargs sed -i -f convert_uppercase_to_lowercase.sed
      
      rm convert_uppercase_to_lowercase.sed
      
      sed -i \
          -e 's:TYPO3/CMS/\([A-Z]\):@TYPO3/\l\1:' \
          -e 's:@typo3/rteCkeditor:@typo3/rte-ckeditor:' \
          typo3/sysext/*/Configuration/JavaScriptModules.php \
          typo3/sysext/core/Tests/Unit/Page/Fixtures/ImportMap/*/Configuration/JavaScriptModules.php
      
      sed -i \
          -e "s/: \\(@TYPO3\\/.*\\)/: '\1\'/" \
          typo3/sysext/form/Configuration/Yaml/FormSetup.yaml
      
      (cd Build; grunt build)
      
      git add typo3/sysext/
      
      Resolves: #96906
      Related: #96323
      Releases: main
      Change-Id: Ifed6ac373aa2bc0c36fe157fb3e9c220f520a9c4
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73522
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
      7a41f905
    • Benni Mack's avatar
      [TASK] Simplify code in TSFE->getPageAndRootlineWithDomain · 20fc4bde
      Benni Mack authored
      Some code related to times without Site handling
      is cleaned up and logically arranged.
      
      Resolves: #96919
      Releases: main
      Change-Id: Id2f61048d9bfdd4f0f397bb3afaa1fb883c1faa0
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73557
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      20fc4bde
    • Oliver Bartsch's avatar
      [TASK] Change merge order of new content element wizard defVals · 24691dfc
      Oliver Bartsch authored
      The new content element wizard is using default values
      to define on which colPos or in which language the new
      element should be created.
      
      Using TSconfig it is also possible to define custom default
      values, most commonly the "CType". The user defined values
      should however never overwrite the dynamically generated
      values from the UI.
      
      Therefore, the dynamic values do now always overwrite
      the user defined values, like it's already done on preparing
      the data map (In case "saveAndClose" is used).
      
      Resolves: #96914
      Releases: main, 11.5
      Change-Id: I8f2bbf2589715c63a54bc19380f98483a12d028c
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73530
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarJochen <rothjochen@gmail.com>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarOliver Bartsch <bo@cedev.de>
      Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: default avatarJochen <rothjochen@gmail.com>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
      24691dfc
    • Oliver Bartsch's avatar
      [TASK] Require moduleData to be set in request · c9e792b8
      Oliver Bartsch authored
      Since #96895, the ModuleData object is created
      for every request, targeting a backend module, and
      attached to the PSR-7 Request object.
      
      Previously the route targets (the controllers) made
      use of the nullsafe operator when accessing the
      module data. This however hides the dependency to
      the object. In case the module data is missing, the
      controller should fail "hard".
      
      Therefore, those nullsafe operators are removed again.
      
      Additionally, the $default value is removed from the
      moduleData->get() calls, since the requested properties
      are all registered in the module registration with a
      corresponding default value.
      
      Resolves: #96917
      Related: #96895
      Releases: main
      Change-Id: I3d53e435a809e925f18c7495d832beb94c7f735b
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73554
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarOliver Bartsch <bo@cedev.de>
      Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
      c9e792b8
    • Stefan Bürk's avatar
      [TASK] Align type hints in two classes implementing \ArrayAccess · c0cc9e1e
      Stefan Bürk authored
      This patch aligns \ArrayAccess argument and return type hints in
      two classes of 'ext:form' to be compatible with the implemented
      native php interface '\ArrayAccess'. PHP8.1 added proper return
      types to php internal classes, methods and interfaces, but using
      'mixed' was not possible before because of PHP7.4 incompatibility.
      To mitigate this the PHP8.1 attribute '#[\ReturnTypeWillChange]'
      has been used in v11, which is now removed again.
      
      These classes are already flagged as @internal and thus changed
      now without further notice.
      
      Resolves: #96916
      Related: #95754
      Related: #95755
      Releases: main
      Change-Id: Iad42aaed9fa8dffd88fbbb3d4f82b34b2507e481
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73553
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
      c0cc9e1e
    • Oliver Bartsch's avatar
      [FOLLOWUP] Remove SET prefix from checkbox name · 4ca55e3a
      Oliver Bartsch authored
      Setting module data does no longer use the "SET"
      prefix. This adjusts one place, where the migration
      was not done yet.
      
      Note: This has no functional impact, since the checkbox
      is handled via JavaScript and not in a POST request.
      
      Resolves: #96895
      Releases: main
      Change-Id: Ie0feb1218ccb089df9164eafd7241be56c2b7421
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73531
      
      
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarOliver Bartsch <bo@cedev.de>
      Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
      4ca55e3a
  2. Feb 15, 2022
  3. Feb 14, 2022