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

[Theme] [RFC] Strategy about module/theme and asset management #4032

Closed
Guite opened this issue Dec 31, 2019 · 2 comments
Closed

[Theme] [RFC] Strategy about module/theme and asset management #4032

Guite opened this issue Dec 31, 2019 · 2 comments

Comments

@Guite
Copy link
Member

Guite commented Dec 31, 2019

Background and context

I looked into #3908 and started reading. The problem with this issue is that when you start replacing the component-installer you immediately end at the question how we treat assets and libraries in general.

  1. General libraries (in the core)
  2. Module / theme / bundle specific assets

For the 1st part the component-installer uses "component-dir": "public" in our composer.json file and each component (jquery, jquery-ui, etc.) specifies which assets to process (example).

What is missing

Beside the component-installer being deprecated we still have no real asset management nor support for yarn and all this stuff (see #3946). We are also not using Webpack Encore yet (see #3601). Which is of course not easy in a system which consists of several different modules etc. Also we want/need that connected to composer (see #3273, #3438, #3804, Symfony Flex). There are also thoughts about unifying modules and themes (see #3644) and treating them as vendors in future.

Time to look what other's do.

Alternatives

The component-installer readme shows three alternatives:

  1. https://github.com/oomphinc/composer-installers-extender
  2. https://github.com/hiqdev/asset-packagist
  3. https://github.com/fxpio/composer-asset-plugin

The third one is the most popular one. But it's new version is incompatible with older ones and became a new project:

  1. https://github.com/fxpio/foxy

How about other projects?

Other PHP projects have similar requirements. Here is some related reading material:

What next

For all these changes we need to agree about the direction we are heading to. Otherwise it is difficult to prioritise things and tackle them one by one.

@Guite Guite added this to the 3.0.0 milestone Dec 31, 2019
Guite added a commit that referenced this issue Dec 31, 2019
@Guite Guite modified the milestones: 3.0.0, 4.0.0 Jan 6, 2020
@Kaik
Copy link
Contributor

Kaik commented Jan 9, 2020

It might be irrelevant or off topic but...
So...
Copying files from one place to another during installation is not the problem I guess.

Both composer and yarn/npm are dev tools. Both of them are designed and used to compose/build sources into artifacts, which are then tested and deployed.

When build is deployed it should not change.

While we (and other cms) want to add additional packages during production which means, we want to recompile stuff in production.

At the moment our 3rd party modules are bypasing composer when you install them via web, and this works because PHP is mostly interpreted "on the fly". If someone needs 3rd party php lib in his zikula module there is no way to install it via composer, you have to supply it with the module(which is bad).

Even bigger problem is with assets. Webpack (actually npm and yarn) is awesome but it is like composer. The only difference is that it combines all sources into artifacts, which are then being deployed. (I think it will work without being compiled/combined altogether.. maybe? is it even worth checking? it will be huge if not combined and minified)...

We do not use proper new age js, our js framework is jQuery... ;)

So options:

  1. We will build a cms that allows to rebuild its own source online (composer and yarn/npm on production server)

  2. Zikula will have to be pre-generated before (I think there was an idea like that you could select core version, modules and stuff... it was some time ago... like 2010 or something :)...) modules will have to be added to registry, tested and stuff... this would be reasonable but what with custom things like custom theme... (user uploads his theme source and we do all the composing building online) and what will happen when user want's to add new module?

  3. We will provide strict base that is compiled and then additional modules will have to work as they do now, no composer/webpack level integration... just plain css, js and that's it... copy files into web dir and then load them... modules will be restricted to use what they can use (what works without compiling assets) we just need to write script to copy those files

  4. We will teach our users "THE DEV WAY" to download Zikula/ZikulaComposer/ZikulaBuilder/ZikulaStudio... start it locally add all modules and themes and stuff and then build artifacts that are then deployed online... It is some sort of version 2 and current composer/node way, but done by user...

The problem with building on production is security and size of all those files... so 1, 2, 4 are kind of the same, only the building itself happens in different place.

  1. I guess it would be perfect if we could provide whole suit where you can build -> test -> deploy then rebuild (upgrade/add/remove/modules) -> test and deploy... so you install online whole ZikulaCreator, then you compose your Zikula with all modules and themes and stuff then it is tested and then deployed to some sort of "public folder" from where it is delivered as zikula installation... when you want to make some changes then you open ZikulaCreator again make changes test them and then deploy...

The only problem with this solution is that we do not have enough resources to pull this off :)

Above is not really relevant to what is the issue about, but overall it is, at least in my opinion...

@Guite Guite changed the title [RFC] Strategy about module/theme and asset management [Theme] [RFC] Strategy about module/theme and asset management Jul 15, 2020
@Guite
Copy link
Member Author

Guite commented Sep 13, 2022

Closing because this is not our business anymore.

@Guite Guite closed this as completed Sep 13, 2022
@Guite Guite modified the milestones: 4.0.0, Discarded Tickets Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants