Skip to content

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Jun 4, 2025

Q A
Bug fix? no
New feature? no
Docs? no
Issues Fix #...
License MIT

I think this is a must have, especially for Toolkit which deals a lot with paths

@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Jun 4, 2025
@Kocal Kocal force-pushed the ci-tests-windows branch 5 times, most recently from 614dc69 to 67ce0d1 Compare June 10, 2025 08:16
@Kocal Kocal force-pushed the ci-tests-windows branch 3 times, most recently from 72ef9f3 to 6921cfd Compare June 17, 2025 06:40
@symfony symfony deleted a comment from github-actions bot Jun 17, 2025
@Kocal Kocal force-pushed the ci-tests-windows branch 16 times, most recently from 1c13a15 to b350423 Compare July 1, 2025 06:38
@Kocal Kocal force-pushed the ci-tests-windows branch from b350423 to c17dff3 Compare July 1, 2025 06:40
@Kocal
Copy link
Member Author

Kocal commented Jul 1, 2025

Tests for the following UX Packages are failing: LiveComponent React Svelte Toolkit Vue

I'm planning to fix tests for Toolkit, React, Svelte, and Vue in another PRs.
For LiveComponent... we will see :D

@Kocal Kocal merged commit 59cb869 into symfony:2.x Jul 1, 2025
41 of 44 checks passed
@Kocal Kocal deleted the ci-tests-windows branch July 1, 2025 19:53
Kocal added a commit that referenced this pull request Jul 6, 2025
This PR was squashed before being merged into the 2.x branch.

Discussion
----------

[Toolkit] Fix comptability with Windows

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | no <!-- required for new features -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - For new features, provide some code snippets to help understand usage.
 - Features and deprecations must be submitted against branch main.
 - Update/add documentation as required (we can help!)
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->
Following #2816

Commits
-------

98aba7a [Toolkit] Fix comptability with Windows
Kocal added a commit that referenced this pull request Jul 6, 2025
…indows server (Kocal)

This PR was merged into the 2.x branch.

Discussion
----------

[Vue][React][Svelte] Fix components assets compilation on Windows server

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Docs?         | no <!-- required for new features -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT

<!--
Replace this notice by a description of your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - For new features, provide some code snippets to help understand usage.
 - Features and deprecations must be submitted against branch main.
 - Update/add documentation as required (we can help!)
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

Following #2816, this PR fixes the `controller.js` files generation when the Symfony app is running on Windows server:
```
Testing
F...                                                                4 / 4 (100%)

Time: 00:01.229, Memory: 30.00 MB

There was 1 failure:

1) Symfony\UX\Vue\Tests\AssetMapper\VueControllerLoaderAssetCompilerTest::testCompileDynamicallyAddsContents
Failed asserting that 'import component_0 from '../../vue/controllers/MyVueController.js';\n
import component_1 from '../../vue/controllers/subdir/DeeperVueController.js';\n
export const components = {"MyVueController": component_0, "subdir\DeeperVueController": component_1};' contains ""subdir/DeeperVueController": component_".

D:\a\ux\ux\src\Vue\tests\AssetMapper\VueControllerLoaderAssetCompilerTest.php:72
```

I was able to set-up a Windows VM to ensure the PR fixes the problem (tip: don't use a remote VM in a train... 🙂)

Before, you can see that `subfolder\Goodbye` is interpreted as `subfolderGoodbye`, meaning that is not possible to use `subfolder/Goodbye` Vue component (I made a typo in the Twig template, but it has no effect):
<img width="1704" alt="Capture d’écran 2025-07-02 à 09 39 00" src="https://github.com/user-attachments/assets/7b812dfb-cb45-46c3-9ec6-50a691e3e38f" />
With the patch, the path now contains `/` instead of `\`, the component `subfolder/Goodbye` is now usable:
<img width="1704" alt="Capture d’écran 2025-07-02 à 09 58 07" src="https://github.com/user-attachments/assets/3a1195f1-c84b-4c42-9bd1-21fb2b9d66a7" />

Commits
-------

ac9e9b5 [Vue][React][Svelte] Fix controllers assets compilation on Windows server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants