[RFC] Use assetic for assets (.css|.js) file management

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by brunoais »

1st: Is my idea ok?

2nd: I've been looking at the code for a while...
Is there any API I may use to work with this caching? Seems like there's a caching class already but I can't find how to work with it to place the files in the public directory.

Is there any API that I can use to gather the full names (path + name + extension) of the .css and the .js files (with the js files in the correct order) so that I can use to add them to have assetic to compile them and then have them placed in the correct place (in the head)?

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by brunoais »

Guys, it's been a very long time and I haven't had any response here.
I've been working with SCE, though, to make it as perfect and we can get with the technology and knowledge we have (me and Sam (SCE's owner)).
Anyhow, I'm quite interested in doing this but I need some guidance, I never worked with phpBB's theme system so I need some guidance with these questions (see previous post).

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by Nicofuma »

If we want to use assetic to manage the assets we need to take a decision about the directory structure. We also need to decide which features and improvement we really want to have because "manage the .css/.js file with assetic" is... very generic.
Member of the phpBB Development-Team
No Support via PM

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by brunoais »

What it seems now is that phpBB is moving a path where using something like assetic does not make as much sense.
If the gulp (or similar) propose passes, this RFC will become obsolete. That's why I stopped working on this PR even after all the hours I had placed on it.

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by Nicofuma »

"the gulp (or similar) propose passes" ?
Member of the phpBB Development-Team
No Support via PM


User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by callumacrae »

I haven't used assetic, but I've used the asset pipeline, and it's a bad experience. Front-end solutions written by backend developers are never nice.

So, -1.

edit: I think I just wrote something really stupid
Made by developers, for developers!
My blog

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by Nicofuma »

A lot of things need to be decided before we can do that... because we can't have only gulp (or less) file in the git repo if they are not compiled automatically by the backend... (we can't request all the contributors to compile the style every time a little change is done to the css/js).

And anyway we need to have a way to manage the assets uniformly (we can't use @vendor_name/file.js, ../theme/file.css and I don't really know what for the images for ever... it looks sloppy...)
Member of the phpBB Development-Team
No Support via PM

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by callumacrae »

Nicofuma wrote:
A lot of things need to be decided before we can do that... because we can't have only gulp (or less) file in the git repo if they are not compiled automatically by the backend... (we can't request all the contributors to compile the style every time a little change is done to the css/js).
Why not? Build tools such as Grunt, Gulp or Broccoli are pretty standard in front-end development now—in fact, in my limited experience actually working on an office (about six months), I've never seen a project (my own or anyone elses) that doesn't use one.

I'd suggest that if someone doesn't want to install a front-end developers tools, they probably shouldn't be doing front-end development. Are you going to suggest packaging a package manager so that front-end developers don't have to install composer? Are you going to suggest packaging a test library so that front-end developers don't have to install PHPUnit?
Made by developers, for developers!
My blog

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: [RFC] Use assetic for assets (.css|.js) file management

Post by Nicofuma »

callumacrae wrote:Are you going to suggest packaging a test library so that front-end developers don't have to install PHPUnit?
It's already the case: composer and travis...

But I'm not sure that we can compare composer and front-end tools because the composer dependencies change at least once per release, you rarely have to run composer install but with front-end tools you have to run your gulp compile each time a styling PR is merged?
Member of the phpBB Development-Team
No Support via PM

Post Reply