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

Frontend assets as NPM packages #12132

Closed
floriangosse opened this issue Dec 5, 2020 · 4 comments
Closed

Frontend assets as NPM packages #12132

floriangosse opened this issue Dec 5, 2020 · 4 comments
Assignees
Labels
DX Issues and PRs aimed at improving Developer eXperience. Frontend Issues and PRs related to frontend RFC Discussions about potential changes or new features.

Comments

@floriangosse
Copy link

floriangosse commented Dec 5, 2020

I was setting up a new shop with Sylius-Standard and stumbled across the problem that I had to install the composer dependencies to be able to build the admin UI (with gulp or webpack). This made the whole build process quite complicated because I had to take care that PHP + composer is available as well in the build context for the frontend resources.

Describe the proposed solution
We could provide npm packages for the needed assets. This way we can build the frontend resources independently of PHP and composer which allows us to speed up and simplify build pipelines.

I think it should be relatively easy to setup a pipeline that cares about the release of the PHP package and the NPM packages and maintain the same version number in all packages. This should allow developers to easily upgrade their dependencies for both "environments".

@pamil pamil added DX Issues and PRs aimed at improving Developer eXperience. RFC Discussions about potential changes or new features. labels Dec 8, 2020
@jakubtobiasz
Copy link
Contributor

Hi @floriangosse!
Thanks for your suggestion; we are testing this solution :). I will let you know when we finish.

@jakubtobiasz jakubtobiasz added the Frontend Issues and PRs related to frontend label Oct 19, 2022
@jakubtobiasz
Copy link
Contributor

After some testing, I can announce we released sylius-ui/frontend package 👉🏼 https://www.npmjs.com/package/@sylius-ui/frontend.

We are using it internally for our test applications in our plugins, but it works and will be added to Sylius-Standard and Sylius/Sylius soon. Recommended package.json:

{
  "license": "MIT <or whatever you want>",
  "scripts": {
    "build": "encore dev",
    "build:prod": "encore production",
    "postinstall": "semantic-ui-css-patch",
    "lint": "yarn lint:js",
    "watch": "encore dev --watch"
  },
  "devDependencies": {
    "@sylius-ui/frontend": "^1.0"
  }
}

I am closing this issue, in case of any problems with this package just open a new one and ping me :).

@vvasiloi
Copy link
Contributor

@Ferror can we use this to remove one of the circular dependencies between js and php when building the docker images?

@Ferror
Copy link
Contributor

Ferror commented Nov 10, 2022

@Ferror can we use this to remove one of the circular dependencies between js and php when building the docker images?

Yea. As soon as I get my PRs merged and it's ported to Sylius-Standard I will start working on it :)

Rafikooo added a commit to Sylius/Sylius-Standard that referenced this issue Dec 13, 2022
This PR was merged into the 1.12 branch.

Discussion
----------

Following Sylius/Sylius#14529 and Sylius/Sylius#12132.

Commits
-------

8bb5a1d Use @sylius-ui/frontend npm package
windragon0910 added a commit to windragon0910/symfony_ecom_framework that referenced this issue Oct 25, 2023
This PR was merged into the 1.12 branch.

Discussion
----------

Following Sylius/Sylius#14529 and Sylius/Sylius#12132.

Commits
-------

8bb5a1dfc83ae4126786be1dd3f5295ffd2e4d21 Use @sylius-ui/frontend npm package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Issues and PRs aimed at improving Developer eXperience. Frontend Issues and PRs related to frontend RFC Discussions about potential changes or new features.
Projects
None yet
Development

No branches or pull requests

5 participants