BigPipe
This library currently implements small part of Facebook Bigpipe so far, but the advantage is efficiently insert/replace content and work with the DOM. It is also possible to easily call JavaScript modules from PHP.
Requirements
- PHP 7.1 or higher
- Node 8, 10+.
- Webpack
Installation
These steps are required:
- Install composer package:
$ composer require richarddobron/bigpipe
$ npm install bigpipe-js
window.require = (modulePath) => require('./' + modulePath).default;
- Add this line to page footer:
<script>
(new (require("bigpipe-js/ServerJS"))).handle(<?=json_encode(\dobron\BigPipe\BigPipe::jsmods())?>);
</script>
Credits
License
The MIT License (MIT). Please see License File for more information.
Inspiration
Bigpipe is inspired by the concept behind Facebook's BigPipe. For more details
read their blog post: Pipelining web pages for high performance.