[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
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

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

Post by Arty »

That's the original location of files.

If Assetic is used to compile JS and CSS files then one of two things must happen:

1. Compiled file can be served via something like old style.php
2. Assetic can store compiled files in specific directory, then files will be served without PHP.

If stylesheet is served with something like old style.php, URLs in CSS files will have to be rewritten. Each image it links to will have to be located using styles tree and its URL changed. For example, url('./images/foo.png') will have to be changed to url('styles/progreen/images/foo.png')

If stylesheet is stored in specific directory, there are two possibilities:
1. Rewrite URLs like in example above.
2. Replicate whole style directory in that temporary directory.

Examples in previous post assume that whole directory is replicated. I'm fine with ether way, but I think replicating whole directory is much cleaner.

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 »

EXreaction wrote:Style specific assets should not be under assets/, they should be under style/style name/assets
Also for "compiled" files?

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

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

Post by imkingdavid »

I agree with Nathan. The point of Extensions is to keep 3rd party plugins all in one place. We definitely should not add separation for styles.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

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

Post by EXreaction »

For compiled files I think it would be good to use a different directory. What about assets/generated/stylename/? I do think we need to organize it in a way where it is clearly in a section that contains only generated/cached web files.

I think it would be good to make the styles/ directory not publicly readable, so copying all the linked to asset files to that generated directory would be good.

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 »

Why not use the cache directory and use an appropriate directory path for these kinds of things?

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

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

Post by Arty »

Maybe /public ?
EXreaction wrote:I think it would be good to make the styles/ directory not publicly readable, so copying all the linked to asset files to that generated directory would be good.
I agree. Same for extensions directory.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

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

Post by EXreaction »

The cache directory is not publicly readable.

public would be fine, but then we should figure out what the plan for the assets/ directory is as now it only contains two js files

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 »

EXreaction wrote: public would be fine, but then we should figure out what the plan for the assets/ directory is as now it only contains two js files
I'll use it for SCE, BTW.

User avatar
Arty
Former Team Member
Posts: 985
Joined: Wed Mar 06, 2002 2:36 pm
Location: Mars
Contact:

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

Post by Arty »

EXreaction wrote:we should figure out what the plan for the assets/ directory is as now it only contains two js files
Maybe minimize those as well and put in /public?

/public/assets/ - mirror of /assets
/public/{style name}/{lang}/ - style

If someone makes style named "assets" it won't cause conflicts because style data is in language specific subdirectory

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 »

Arty wrote: /public/assets/ - mirror of /assets
/public/{style name}/{lang}/ - style

If someone makes style named "assets" it won't cause conflicts because style data is in language specific subdirectory
I'd still use the styles subdirectory there.
We may want to use that public directory for other stuff and we already know how problematic is to change something specially because styles can be named in just about any way the file system allows.
So I say:
/public/assets/ - mirror of /assets
/public/styles/{style name}/{lang}/ - style

Post Reply