Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stimulus] Create NPM Package for @symfony/stimulus-bundle to Decouple from PHP Components #2575

Open
alinceDev opened this issue Feb 16, 2025 · 2 comments
Labels

Comments

@alinceDev
Copy link

Issue Description:

Currently, certain JavaScript bundles, such as @symfony/stimulus-bundle, are being installed from the vendor package instead of an NPM package. This is evident in the package.json file where the dependency is specified as:

    "@symfony/stimulus-bundle": "file:vendor/symfony/stimulus-bundle/assets",

Problem

This approach creates a tight coupling between the JavaScript and PHP components, making it difficult to manage and install JavaScript dependencies independently. For instance, in a CI environment, this setup requires the installation of PHP components via Composer to install the JavaScript packages, which is not ideal for running tests with Playwright or other JavaScript-focused tasks.

Request

Could you please create an NPM package for @symfony/stimulus-bundle (and potentially other relevant bundles) to allow for independent installation via NPM? This would streamline the setup process, especially in CI environments, and decouple the JavaScript dependencies from the PHP components.

Use Case Example

For example, when setting up a CI pipeline to run Playwright tests, it would be beneficial to install the necessary JavaScript packages directly via NPM without needing to install the PHP components through Composer.

If this issue is already documented and I missed the information, I apologize for the oversight. Thank you for considering this enhancement!

@alinceDev alinceDev added the RFC label Feb 16, 2025
@smnandre
Copy link
Member

Say we do publish on npm the LiveComponent javascript part.

Next release we have a new feature that does work with JS and PHP.

How would you enforce both vendors/symfony/ux-live-component and nodes_modules/vendor/symfony.. are in sync ?

(genuine question)

@Kocal
Copy link
Member

Kocal commented Feb 23, 2025

Maybe we can hook on postinstall npm script and read user's composer.lock to see if the PHP package has the same version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants