Age | Commit message (Collapse) | Author | Files | Lines |
|
Class BigPipe\BigPipe:
* addPhaseDoneJS
Class BigPipe\Pagelet:
* addHTML
* addResource
* addJSCode
* addDependency
* setTagName
* setPlaceholderHTML
|
|
Split up the "enabled" method of the BigPipe class into two methods, one
to check if the pipelining mode is currently enabled ("isEnabled") and
another one to enable/disable the pipelining mode ("setEnabled").
This change prevents that a single method has two different jobs, which
can be confusing for programmers who didn't wrote the code but only use
them. Now there are two clearly named methods for exactly one job.
|
|
|
|
Rename the "tagname" property and the "setTagname" method of the Pagelet
class to the lowerCamelCase variant "tagName" because it are two words.
|
|
Rename the second parameter for the "addPhaseDoneJS" method of the Item
class from the misleading name "callback" to "code" because that method
doesn't expect a real JS (or PHP) callback but rather simple JS code.
|
|
The first parameter for the constructor of the Resource classes should
not be optional if the next parameters obviously are non-optional. The
optional parameters (if any) must come after the required parameters.
|
|
Remove the unnecessary PHP closing tags and ensure that
*all* non-binary files ending with an LF character.
|
|
|
|
|
|
The method "Pagelet::addDependency()" does not allow anything other than an actual instance of Pagelet as argument (see commit 6550b64a5a6463bd371e13af82db86999b9363cc). The existence of this comment was forgotten and now finally removed.
|
|
|
|
This commit adds a new class called "Application". This class will be responsible for creating Pagelet, Stylesheet and Javascript instances, either from the additional Debugging or original BigPipe namespace, based on whether the debugging flag of the application is set to true or false.
|
|
This commit moves the "spl_autoload_register" function directly into the pagelets.php to reduce duplicate code within index.php and async.php.
|
|
This commit moves the if condition, which checks if the pipelining mode of BigPipe should be disabled, directly into the pagelets.php to reduce duplicate code within index.php and async.php.
|
|
|
|
|
|
This commit replaces the function call of "removeLineBreaksAndTabs" from "Pagelet::flush()" with the direct call of the "str_replace" function. Therefore, you don't need to include the external function "removeLineBreaksAndTabs" (which was located outside the BigPipe namespace) into your project anymore.
|
|
This commit removes the superflous function calls "removeLineBreaksAndTabs" from the "Pagelet::getStructure()" and "Item::addPhaseDoneJS()" method. If it bothers you when some properties of the JSON-encoded pagelet object contain line breaks and tabs (visible as "\r", "\n" and "\t"), then you'll need to remove them before you pass the string of javascript code to the corresponding methods:
* $Pagelet->addJSCode(removeLineBreaksAndTabs($javascript_code));
* $Pagelet->addPhaseDoneJS(0, removeLineBreaksAndTabs($javascript_code));
|
|
The string "\r\n" within the search array is superfluous because it is already covered by the single "\r" and "\n".
|
|
|
|
|
|
|
|
|
|
|
|
This commit is a preparation for a few further commits and changes the mechanism how the BigPipe javascript library detects the last flushed pagelet from server. Previously, there was a "IS_LAST:true" property in the JSON encoded pagelet object. However, this meant that when the pagelet was sent to the client, the server already needed to know at this point that this is the last pagelet. This can no longer be reliably determined in the future due to smaller restructuring.
Instead of sending "IS_LAST:true" within the JSON encoded pagelet object of the last pagelet, the BigPipe::render() method on the server will display a <script> element which calls "BigPipe.onLastPageletArrived()" after all pagelets have been flushed. This call informs the javascript library that the last pagelet has been flushed and arrived at the client. This is required because the BigPipe javascript library otherwise doesn't know that the last pagelet has been arrived (the javascript library waits for all pagelets to be flushed and displayed until it begins to execute the external javascript resources of every pagelet).
|
|
The development of this project began several years ago on a Windows system until I switched to GNU\Linux. Therefore, some files contained CRLF as line separators, now replaced with LF.
|
|
The debug mechanism has been changed. Instead of keeping the debug mechanism hardcoded within the core classes, it's now possible and recommended to use the seperate debugging classes which you can modify like you want. Those classes inherit their associated core classes and can add some debugging stuff. This has the advantage of having a clean core code without any debugging stuff. If the debug classes are not used then they shall not be included and their code will not be initialized.
|
|
|
|
|
|
Item class.
|
|
shorthand syntax, you can abstract the Pagelet class and use your own extended class which is more flexible and will keep the BigPipe main classes as small as possible.
|
|
must now pass an existing Pagelet instance to the method!
|
|
implemented methods "enqueue" and "dequeue" for the new queueing mechanism. The "dequeue" method is currently unused but will be used in the future. The changes in this commit are partially preparations for further commits.
|
|
priority of the corresponding Pagelet instance.
|
|
|
|
the "class" keyword which was introduced in ECMAScript 6 (2015) to build the prototypes. In addition, some variables and functions were renamed and declared with the shorthand syntax.
|
|
arrow functions which were introduced in ECMAScript 6 (2015).
|
|
has been replaced by the new introduced keyword "let" from ECMAScript 6 (2015), which scopes the variable to the nearest enclosing block instead of the nearest function block.
|
|
prototype was removed.
|
|
necessary and has been replaced by a simpler variant inside the BigPipe library.
|
|
try/catch block to prevent troubles with some creepy Microsoft browsers.
|
|
display custom HTML content immediately while the pagelet is still processing.
|
|
"Stylesheet" and "Javascript" to make it more consistent with the other class names (instead of using the abbreviations).
|
|
"Stylesheet" and "Javascript" to make it more consistent with the other class names (instead of using the abbreviations).
|
|
"::enabled()".
|
|
|
|
|
|
|
|
dependencies (either with the instance of the dependency Pagelet or the unique ID as string as argument).
|
|
|