.. include:: /Includes.rst.txt .. _migration: ========================= Migration from 1.x to 2.0 ========================= Version 2 is a major overhaul of the internal code structure as well as the PHP API (i. e. the :php-short:`\Praetorius\ViteAssetCollector\Service\ViteService` class). The API of the ViewHelpers stays mostly the same, however some of the ViewHelper arguments are now deprecated and should be migrated to their new equivalent. Also, the old ViewHelper names :html:`` and :html:``, which have been deprecated already, no longer work with version 2. The extension remains compatible with TYPO3 v13 and v14, but now requires Vite 5 or higher. .. contents:: Table of contents :local: :depth: 1 .. _migration-requirements: Requirements ============ * PHP (8.2+) and TYPO3 (v13+v14) requirements remain the same. * Vite 5 or higher is required. The legacy location of the manifest file without the :file:`.vite/` folder is no longer supported. * Symlinked entry points are no longer resolved to their original path. Use version 3 of `vite-plugin-typo3 `__ or set `resolve.preserveSymlinks` to `true` in your :file:`vite.config.js`. .. _migration-templates: Fluid templates =============== .. _migration-templates-aliases: Removed ViewHelper aliases -------------------------- The old ViewHelper names have been removed: .. code-block:: text => => The `vite` namespace is now registered globally, so explicit namespace declarations for the extension is no longer necessary. .. _migration-templates-arguments: Deprecated arguments of ------------------------------------ Most embedding options of :ref:` ` have been moved to the new child ViewHelpers. The old arguments still work in 2.x, but trigger deprecation notices and will be removed with 3.0. .. list-table:: :header-rows: 1 * - Deprecated argument - Replacement * - `addCss="0"` - :ref:` ` * - `inlineCss="1"` - :ref:` ` * - `cssTagAttributes="{…}"` - :ref:` ` * - `scriptTagAttributes="{…}"` - :ref:` ` * - `priority="1"` - :ref:` ` (CSS is added with priority by default now) * - `useNonce="1"` - `csp="{true}"` Once `` or `` is used, the deprecated arguments can no longer be combined with them in the same `` tag. Example: .. code-block:: html :caption: Before .. code-block:: html :caption: After .. _migration-templates-dev-tag-attributes: Removed argument devTagAttributes --------------------------------- The `devTagAttributes` argument of :html:`` has been removed. Additional script attributes are now applied consistently in development and production via :ref:` `. They are no longer applied to the :html:`