[!!!][TASK] Don't resolve symlinks in manifest identifiers - #35
Merged
Conversation
This allows `realpath()` code to be removed from the TYPO3 extension. This is a breaking change because the identifiers will change. This will require the recent version of the TYPO3 extension, which will attempt both variants (first without symlink resolving, second with resolving using `realpath()` as before). Resolves: #28
s2b
force-pushed
the
task/preserveSymlinks
branch
from
March 22, 2026 11:10
4ad4da0 to
a6a5bdd
Compare
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
Mar 22, 2026
Previously, the extension always resolved symlinks to their original location if a specific asset file was requested. This was due to vite doing the same by default in the `manifest.json`. Version 3.0 of `vite-plugin-typo3` disables this behavior (see s2b/vite-plugin-typo3#35), which allows us on the TYPO3 side to only use the resolving via `realpath()` as a fallback if the plain path doesn't work. This change should resolve a whole category of errors that have been reported over the years. With the fallback, the impact for projects should be minimal. The only real change without fallback is that the vite dev server will now always use the specified symlink to access resources during development: previous markup when dev server is active: ```html <script type="module" src="https://vite.myproject.ddev.site/packages/sitepackage/…"> ``` markup after this change: ```html <script type="module" src="https://vite.myproject.ddev.site/vendor/my-vendor/sitepackage/…"> ``` In practice, this shouldn't lead to any problems, since the vite dev server has access to both paths. Resolves: #94 Resolves: #105 Resolves: #93
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
Mar 22, 2026
Previously, the extension always resolved symlinks to their original location if a specific asset file was requested. This was due to vite doing the same by default in the `manifest.json`. Version 3.0 of `vite-plugin-typo3` disables this behavior (see s2b/vite-plugin-typo3#35), which allows us on the TYPO3 side to only use the resolving via `realpath()` as a fallback if the plain path doesn't work. This change should resolve a whole category of errors that have been reported over the years. With the fallback, the impact for projects should be minimal. The only real change without fallback is that the vite dev server will now always use the specified symlink to access resources during development: previous markup when dev server is active: ```html <script type="module" src="https://vite.myproject.ddev.site/packages/sitepackage/…"> ``` markup after this change: ```html <script type="module" src="https://vite.myproject.ddev.site/vendor/my-vendor/sitepackage/…"> ``` In practice, this shouldn't lead to any problems, since the vite dev server has access to both paths. Resolves: #94 Resolves: #105 Resolves: #93
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
Mar 22, 2026
Previously, the extension always resolved symlinks to their original location if a specific asset file was requested. This was due to vite doing the same by default in the `manifest.json`. Version 3.0 of `vite-plugin-typo3` disables this behavior (see s2b/vite-plugin-typo3#35), which allows us on the TYPO3 side to only use the resolving via `realpath()` as a fallback if the plain path doesn't work. This change should resolve a whole category of errors that have been reported over the years. With the fallback, the impact for projects should be minimal. The only real change without fallback is that the vite dev server will now always use the specified symlink to access resources during development: previous markup when dev server is active: ```html <script type="module" src="https://vite.myproject.ddev.site/packages/sitepackage/…"> ``` markup after this change: ```html <script type="module" src="https://vite.myproject.ddev.site/vendor/my-vendor/sitepackage/…"> ``` In practice, this shouldn't lead to any problems, since the vite dev server has access to both paths. Resolves: #94 Resolves: #105 Resolves: #93
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
Mar 22, 2026
Previously, the extension always resolved symlinks to their original location if a specific asset file was requested. This was due to vite doing the same by default in the `manifest.json`. Version 3.0 of `vite-plugin-typo3` disables this behavior (see s2b/vite-plugin-typo3#35), which allows us on the TYPO3 side to only use the resolving via `realpath()` as a fallback if the plain path doesn't work. This change should resolve a whole category of errors that have been reported over the years. With the fallback, the impact for projects should be minimal. The only real change without fallback is that the vite dev server will now always use the specified symlink to access resources during development: previous markup when dev server is active: ```html <script type="module" src="https://vite.myproject.ddev.site/packages/sitepackage/…"> ``` markup after this change: ```html <script type="module" src="https://vite.myproject.ddev.site/vendor/my-vendor/sitepackage/…"> ``` In practice, this shouldn't lead to any problems, since the vite dev server has access to both paths. Resolves: #94 Resolves: #105 Resolves: #93
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
May 8, 2026
With previous iterations of the client-side vite setup, it was necessary for the TYPO3 extension to resolve symlinks to their original location in order to generate the matching identifiers for vite's manifest.json. This lead to various problems related to the usage of `realpath()`, especially in combination with `open_basedir` server configurations. Since `vite-plugin-typo3` v3, the `resolve.preserveSymlinks` is used to retain the original paths in the manifest.json. This makes server-side symlink resolving obsolete and also doesn't require the source asset files being present on production setups. For custom vite setups, the flag can be specified manually in `vite.config.js`. For v1, a fallback is in place in case symlink resolving is still necessary. This fallback is now deprecated and will be removed with v2. Path example: `EXT:sitepackage/Resources/Private/Main.js` resolves to either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...` using TYPO3's path APIs. These are typically symlinks pointing to `packages/sitepackage/...`, created by composer, however TYPO3 is not aware of that and doesn't resolve them by default. On the vite site, without the flag being set, `manifest.json` resolves asset paths to their origin `packages/sitepackage/...`, following the symlink. To access these assets from TYPO3, `realpath()` needed to be used to resolve the symlink server-side as well to get matching paths. With the flag being set, `manifest.json` contains the original symlink, again either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...`. This means that server-side symlink resolving is no longer necessary. Related change in vite-plugin-typo3: s2b/vite-plugin-typo3#35
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
May 8, 2026
With previous iterations of the client-side vite setup, it was necessary for the TYPO3 extension to resolve symlinks to their original location in order to generate the matching identifiers for vite's manifest.json. This lead to various problems related to the usage of `realpath()`, especially in combination with `open_basedir` server configurations. Since `vite-plugin-typo3` v3, the `resolve.preserveSymlinks` is used to retain the original paths in the manifest.json. This makes server-side symlink resolving obsolete and also doesn't require the source asset files being present on production setups. For custom vite setups, the flag can be specified manually in `vite.config.js`. For v1, a fallback is in place in case symlink resolving is still necessary. This fallback is now deprecated and will be removed with v2. Path example: `EXT:sitepackage/Resources/Private/Main.js` resolves to either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...` using TYPO3's path APIs. These are typically symlinks pointing to `packages/sitepackage/...`, created by composer, however TYPO3 is not aware of that and doesn't resolve them by default. On the vite site, without the flag being set, `manifest.json` resolves asset paths to their origin `packages/sitepackage/...`, following the symlink. To access these assets from TYPO3, `realpath()` needed to be used to resolve the symlink server-side as well to get matching paths. With the flag being set, `manifest.json` contains the original symlink, again either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...`. This means that server-side symlink resolving is no longer necessary. Related change in vite-plugin-typo3: s2b/vite-plugin-typo3#35
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
May 8, 2026
With previous iterations of the client-side vite setup, it was necessary for the TYPO3 extension to resolve symlinks to their original location in order to generate the matching identifiers for vite's manifest.json. This lead to various problems related to the usage of `realpath()`, especially in combination with `open_basedir` server configurations. Since `vite-plugin-typo3` v3, the `resolve.preserveSymlinks` is used to retain the original paths in the `manifest.json`. This makes server-side symlink resolving obsolete and also doesn't require the source asset files being present on production setups. For custom vite setups, the flag can be specified manually in `vite.config.js`. For v1, a fallback is in place in case symlink resolving is still necessary. This fallback is now deprecated and will be removed with v2. Path example: `EXT:sitepackage/Resources/Private/Main.js` resolves to either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...` using TYPO3's path APIs. These are typically symlinks pointing to `packages/sitepackage/...`, created by composer, however TYPO3 is not aware of that and doesn't resolve them by default. On the vite site, without the flag being set, `manifest.json` resolves asset paths to their origin `packages/sitepackage/...`, following the symlink. To access these assets from TYPO3, `realpath()` needed to be used to resolve the symlink server-side as well to get matching paths. With the flag being set, `manifest.json` contains the original symlink, again either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...`. This means that server-side symlink resolving is no longer necessary. Related change in vite-plugin-typo3: s2b/vite-plugin-typo3#35
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
May 8, 2026
With previous iterations of the client-side vite setup, it was necessary for the TYPO3 extension to resolve symlinks to their original location in order to generate the matching identifiers for vite's `manifest.json`. This lead to various problems related to the usage of `realpath()`, especially in combination with `open_basedir` server configurations. Since `vite-plugin-typo3` v3, the `resolve.preserveSymlinks` is used to retain the original paths in the `manifest.json`. This makes server-side symlink resolving obsolete and also doesn't require the source asset files being present on production setups. For custom vite setups, the flag can be specified manually in `vite.config.js`. For v1, a fallback is in place in case symlink resolving is still necessary. This fallback is now deprecated and will be removed with v2. Path example: `EXT:sitepackage/Resources/Private/Main.js` resolves to either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...` using TYPO3's path APIs. These are typically symlinks pointing to `packages/sitepackage/...`, created by composer, however TYPO3 is not aware of that and doesn't resolve them by default. On the vite site, without the flag being set, `manifest.json` resolves asset paths to their origin `packages/sitepackage/...`, following the symlink. To access these assets from TYPO3, `realpath()` needed to be used to resolve the symlink server-side as well to get matching paths. With the flag being set, `manifest.json` contains the original symlink, again either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...`. This means that server-side symlink resolving is no longer necessary. Related change in vite-plugin-typo3: s2b/vite-plugin-typo3#35
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
May 8, 2026
With previous iterations of the client-side vite setup, it was necessary for the TYPO3 extension to resolve symlinks to their original location in order to generate the matching identifiers for vite's `manifest.json`. This lead to various problems related to the usage of `realpath()`, especially in combination with `open_basedir` server configurations. Since `vite-plugin-typo3` v3, `resolve.preserveSymlinks` is used to retain the original paths in the `manifest.json`. This makes server-side symlink resolving obsolete and also doesn't require the source asset files being present on production setups. For custom vite setups, the flag can be specified manually in `vite.config.js`. For v1, a fallback is in place in case symlink resolving is still necessary. This fallback is now deprecated and will be removed with v2. Path example: `EXT:sitepackage/Resources/Private/Main.js` resolves to either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...` using TYPO3's path APIs. These are typically symlinks pointing to `packages/sitepackage/...`, created by composer, however TYPO3 is not aware of that and doesn't resolve them by default. On the vite site, without the flag being set, `manifest.json` resolves asset paths to their origin `packages/sitepackage/...`, following the symlink. To access these assets from TYPO3, `realpath()` needed to be used to resolve the symlink server-side as well to get matching paths. With the flag being set, `manifest.json` contains the original symlink, again either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...`. This means that server-side symlink resolving is no longer necessary. Related change in vite-plugin-typo3: s2b/vite-plugin-typo3#35
s2b
added a commit
to s2b/vite-asset-collector
that referenced
this pull request
May 8, 2026
With previous iterations of the client-side vite setup, it was necessary for the TYPO3 extension to resolve symlinks to their original location in order to generate the matching identifiers for vite's `manifest.json`. This lead to various problems related to the usage of `realpath()`, especially in combination with `open_basedir` server configurations. Since `vite-plugin-typo3` v3, `resolve.preserveSymlinks` is used to retain the original paths in the `manifest.json`. This makes server-side symlink resolving obsolete and also doesn't require the source asset files being present on production setups. For custom vite setups, the flag can be specified manually in `vite.config.js`. For v1, a fallback is in place in case symlink resolving is still necessary. This fallback is now deprecated and will be removed with v2. Path example: `EXT:sitepackage/Resources/Private/Main.js` resolves to either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...` using TYPO3's path APIs. These are typically symlinks pointing to `packages/sitepackage/...`, created by composer, however TYPO3 is not aware of that and doesn't resolve them by default. On the vite site, without the flag being set, `manifest.json` resolves asset paths to their origin `packages/sitepackage/...`, following the symlink. To access these assets from TYPO3, `realpath()` needed to be used to resolve the symlink server-side as well to get matching paths. With the flag being set, `manifest.json` contains the original symlink, again either `vendor/myvendor/sitepackage/...` or `typo3conf/ext/sitepackage/...`. This means that server-side symlink resolving is no longer necessary. Related change in vite-plugin-typo3: s2b/vite-plugin-typo3#35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows
realpath()code to be removed from the TYPO3 extension.This is a breaking change because the identifiers will change.
This will require the recent version of the TYPO3 extension,
which will attempt both variants (first without symlink resolving,
second with resolving using
realpath()as before).Resolves: #28