styles/<style>/javascript
.[RFC] script.php
Re: [RFC] script.php
Yes, it should be
Re: [RFC] script.php
Not sure if I agree that it should be outside of the template. Templates and themes are two separate parts. This would suggest that javascript is entire entity of its own. It'll typically purely depend on the generated DOM, meaning the templates. So I think that template-specific js should continue to live in the template folder (albeit its own javascript directory within it).
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC] script.php
Started work on this (script.php) because I think it would be very useful for 3.1. Does anyone know of any good JavaScript minification libraries for PHP? All the good ones I have found so far have either been Java or APIs.
Re: [RFC] script.php
script.php is not useful without some scripts to put into it. In development it is actually not wanted as combining javascript files ruins file names/line numbers you get in browsers' error consoles. Lastly, if we do end up having a script.php it would almost certainly need to incorporate a way to include scripts from modifications, thus I would suggest holding off on implementing it until extensions are merged.
The pull request for script.php should be separate from any ajax pull requests, and I would say that the ajax stuff should be implemented first as right now we're doing just fine without a script.php.
The pull request for script.php should be separate from any ajax pull requests, and I would say that the ajax stuff should be implemented first as right now we're doing just fine without a script.php.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC] script.php
True, but I'm doing it because script.js was starting to get big, and I've hit a few limitations.Oleg wrote:script.php is not useful without some scripts to put into it.
I know, I'm checking for PHPBB_DEBUG.Oleg wrote:In development it is actually not wanted as combining javascript files ruins file names/line numbers you get in browsers' error consoles.
I know.Oleg wrote:Lastly, if we do end up having a script.php it would almost certainly need to incorporate a way to include scripts from modifications, thus I would suggest holding off on implementing it until extensions are merged.
It depends how script.php is implemented. Personally, I feel that script.php is essential, as without it it's going to be difficult to install multiple modifications as they will either reference the script.js include or the last line of script.js, which will result in conflicts. At the moment there still isn't a way to access language variables in the JavaScript, and I feel that there should be a way.Oleg wrote:The pull request for script.php should be separate from any ajax pull requests, and I would say that the ajax stuff should be implemented first as right now we're doing just fine without a script.php.
I can't see the point in merging the Ajax stuff, only to move it into script.php when that is merged. script.php will also probably be done first.
Re: [RFC] script.php
script.php is not needed for ajax. Wherever you were going to include script.php you can include all js files you have so far. Having 5 or even 10 straightforward javascript includes in a row is trivial; writing a comprehensive asset management system is not.callumacrae wrote: Personally, I feel that script.php is essential, as without it it's going to be difficult to install multiple modifications as they will either reference the script.js include or the last line of script.js, which will result in conflicts.
While we are probably going to need something like script.php for modifications, possibly, as far as core phpbb is concerned script.php is not essential to implementing ajax. As I said on irc the size of the ajax diff should be decreased so that it can be reviewed, adding asset management is not going to help move toward that goal.
You should describe these limitations if they are really preventing ajax from working without script.php, as I can't think of any at the moment.callumacrae wrote: True, but I'm doing it because script.js was starting to get big, and I've hit a few limitations.
Nothing will be moved to script.php. The purpose of script.php is to merge existing javascript files. It has no content of its own.callumacrae wrote: I can't see the point in merging the Ajax stuff, only to move it into script.php when that is merged.
- callumacrae
- Former Team Member
- Posts: 1046
- Joined: Tue Apr 27, 2010 9:37 am
- Location: England
- Contact:
Re: [RFC] script.php
Of course it isn't needed, but having 5 JavaScript includes in a row is messy and increases HTTP requests.Oleg wrote:script.php is not needed for ajax. Wherever you were going to include script.php you can include all js files you have so far. Having 5 or even 10 straightforward javascript includes in a row is trivial; writing a comprehensive asset management system is not.callumacrae wrote: Personally, I feel that script.php is essential, as without it it's going to be difficult to install multiple modifications as they will either reference the script.js include or the last line of script.js, which will result in conflicts.
It isn't really needed for AJAX (although it would certainly make it easier for language, if that was parsed), I'm thinking about modifications here.Oleg wrote:While we are probably going to need something like script.php for modifications, possibly, as far as core phpbb is concerned script.php is not essential to implementing ajax. As I said on irc the size of the ajax diff should be decreased so that it can be reviewed, adding asset management is not going to help move toward that goal.
I think it's just language stuff at the moment. Igor suggested using data attributes on the required elements, but that is pretty hacky and wouldn't work for everything (for example, a JavaScript game that uses an extension)Oleg wrote:You should describe these limitations if they are really preventing ajax from working without script.php, as I can't think of any at the moment.callumacrae wrote: True, but I'm doing it because script.js was starting to get big, and I've hit a few limitations.
...again, you know what I meant. I was talking from the perspective of the front-end (what with me doing front-end development).Oleg wrote:Nothing will be moved to script.php. The purpose of script.php is to merge existing javascript files. It has no content of its own.callumacrae wrote: I can't see the point in merging the Ajax stuff, only to move it into script.php when that is merged.
Re: [RFC] script.php
I beg to differ : http://www.phpbb.com/community/viewtopi ... &t=2108168.callumacrae wrote:What else will go in the assets directory? By the definition of assets according to the coding guidelines, the only other things that could go in there are images and css, both of which are somewhere else, and something like flash which I don't think any style authors use anyway. There is no point in a directory which will only ever have on thing in it.
Re: [RFC] script.php
Why would we want a script.php when we finally just got rid of style.php!?
style.php has been related to issues with caching css files that led to flashes of blank/white between page loads in webkit browsers.
won't a script.php do the same?
see: style.php not cached (although other css and js files are), and takes longer than anything to download! Because php files are usually not cached by the server, a script.php file could delay the delivery of JS files, as style.php does as shown above, which is visually noticed in webkit browsers
style.php has been related to issues with caching css files that led to flashes of blank/white between page loads in webkit browsers.
won't a script.php do the same?
see: style.php not cached (although other css and js files are), and takes longer than anything to download! Because php files are usually not cached by the server, a script.php file could delay the delivery of JS files, as style.php does as shown above, which is visually noticed in webkit browsers
Has an irascible disposition.
- bantu
- 3.0 Release Manager
- Posts: 557
- Joined: Thu Sep 07, 2006 11:22 am
- Location: Karlsruhe, Germany
- Contact:
Re: [RFC] script.php
+1VSE+ wrote:Why would we want a script.php when we finally just got rid of style.php!?
There has to a better approach.