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
Extract JavaScript code inside PHP scripts #401
Comments
jaragunde
added a commit
that referenced
this issue
May 7, 2018
Put all the PHP-generated JavaScript code at the beginning of the file.
jaragunde
added a commit
that referenced
this issue
May 7, 2018
Some inline PHP inside JS code took care of explicitly sending the session id to web services. This is unnecessary, the browser already sends the PHP session id via cookies. This removes a bunch of ugly inline PHP, which is necessary to achieve the separation of JS and PHP sources.
jaragunde
added a commit
that referenced
this issue
May 11, 2018
Put all the PHP-generated JavaScript code at the beginning of the file.
jaragunde
added a commit
that referenced
this issue
May 11, 2018
Some inline PHP inside JS code took care of explicitly sending the session id to web services. This is unnecessary, the browser already sends the PHP session id via cookies. This removes a bunch of ugly inline PHP, which is necessary to achieve the separation of JS and PHP sources.
jaragunde
added a commit
that referenced
this issue
May 11, 2018
In this step, we rename the .php file as .js to preserve the history of the JS code, which accounts for most of the file. We also take advantage to rename the page with a better name.
jaragunde
added a commit
that referenced
this issue
May 11, 2018
In this step, we extract the php code from the .js file we just renamed to a new file. The history of that file will be empty. We also take advantage to rename the page with a better name.
jaragunde
added a commit
that referenced
this issue
May 11, 2018
In this step, we rename the .php file as .js to preserve the history of the JS code, which accounts for most of the file. We also take advantage to rename the page with a better name.
jaragunde
added a commit
that referenced
this issue
May 11, 2018
In this step, we extract the php code from the .js file we just renamed to a new file. The history of that file will be empty. We also take advantage to rename the page with a better name.
jaragunde
added a commit
that referenced
this issue
May 14, 2018
In this step, we rename the .php file as .js to preserve the history of the JS code, which accounts for most of the file. We also take advantage to rename the page with a better name.
jaragunde
added a commit
that referenced
this issue
May 14, 2018
In this step, we extract the php code from the .js file we just renamed to a new file. The history of that file will be empty. We also take advantage to rename the page with a better name.
jaragunde
added a commit
that referenced
this issue
May 14, 2018
jaragunde
added a commit
that referenced
this issue
May 14, 2018
In this step, we rename the .php file as .js to preserve the history of the JS code, which accounts for most of the file.
jaragunde
added a commit
that referenced
this issue
May 14, 2018
In this step, we extract the php code from the .js file we just renamed to a new file. The history of that file will be empty.
jaragunde
added a commit
that referenced
this issue
May 30, 2018
(Merge branch 'i401-split-js-in-php-files')
We are progressing on this topic. We have applied this treatment to a number of PHP pages:
|
jaragunde
added a commit
that referenced
this issue
Jan 4, 2019
Any JS code that has to be generated by PHP has been moved to the beginning of the file.
jaragunde
added a commit
that referenced
this issue
Jan 11, 2019
Original .php file was renamed to .js, to preserve history of the JS code, which accounts for most of the file. The PHP code was moved to a newly created .php file. We also take the chance to rename the report following current conventions. New name is "projectDetailsReport".
jaragunde
added a commit
that referenced
this issue
Jan 11, 2019
Any JS code that has to be generated by PHP has been moved to the beginning of the file.
jaragunde
added a commit
that referenced
this issue
Jan 11, 2019
Original .php file was renamed to .js, to preserve history of the JS code, which accounts for most of the file. The PHP code was moved to a newly created .php file. We also take the chance to rename the report following current conventions. New name is "projectDetailsReport".
jaragunde
added a commit
that referenced
this issue
Jan 11, 2019
Original .php file was renamed to .js, to preserve history of the JS code, which accounts for most of the file. The PHP code was moved to a newly created .php file, some unused includes were removed but it's otherwise unchanged. We also take the chance to rename the report following current conventions. New name is "projectDetailsReport".
jaragunde
added a commit
that referenced
this issue
Jan 11, 2019
Original .php file was renamed to .js, to preserve history of the JS code, which accounts for most of the file. The PHP code was moved to a newly created .php file, some unused includes were removed but it's otherwise unchanged. We also take the chance to rename the report following current conventions. New name is "projectDetailsReport".
jaragunde
added a commit
that referenced
this issue
Feb 25, 2019
(Merge pull request #437 from Igalia/i401-project-details)
Applied to project details report. Reviewed at PR #437:
|
Some pages with JS code embedded in the PHP page:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have PHP files that contain sizeable chunks of JavaScript inside them. This is suboptimal because that JS cannot be minified, or cached by the browser. Unless the JS must be dynamically generated, there is no reason to do it like that.
There are some examples of this task already in the project history. This is when we extracted the JS code from
tasks.php
:Commits 8b5136f and 78eb6d1 do the same thing for
tasksFilter.php
. The key to preserve history of the .js file is explained in the comments; we have to choose if we want to preserve the history of the php or the js code for every case, we often want the latter because JS code in the front-end is usually bigger and more complex.The text was updated successfully, but these errors were encountered: