getpop/resourceloader

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Load resources for the website

0.8.8 2021-09-27 06:48 UTC

This package is auto-updated.

Last update: 2021-10-27 07:09:54 UTC


README

Load resources for the website

Install

Via Composer

composer require getpop/resourceloader

Development

The source code is hosted on the PoP monorepo, under SiteBuilder/packages/resourceloader.

Usage

Initialize the component:

\PoP\Root\AppLoader::addComponentClassesToInitialize([
    \PoP\ResourceLoader\Component::class,
]);

Architecture foundations

Layouts are rendered through custom-built reactivity, based on observing a unique JavaScript object (which contains database and configuration data).

The view is implemented through Handlebars templates, which can be loaded both in the client (through the Handlebars runtime) and in the server (through PHP library LightnCandy). This approach is isomorphic: the same code works on both environments.

Implementation coming soon.

Main Concepts

Rendering through JavaScript templates

Will be added soon...

Isomorphic Server-Side Rendering

Will be added soon...

Reactivity

Will be added soon...

Architecture Design and Implementation

Dataloading

Dataloading Modules

Handlebars

Will be added soon...

LightnCandy

Will be added soon...

Code Splitting

Will be added soon...

Progressive-Web App

Will be added soon...

Single-Page Application

Will be added soon...

Content CDN

Will be added soon...

A/B Testing

Will be added soon...

Form Input Modules

Will be added soon...

Client-side Rendering

Will be added soon...

JavaScript templates through Handlebars

Will be added soon...

Executing JavaScript functions

Will be added soon...

Resources

Will be added soon...

Asset-bundling

Will be added soon...

Progressive Booting

Will be added soon...

Links in body

Will be added soon...

State Management

Will be added soon...

Data Cache, Configuration Cache and Replication

Will be added soon...

Reactivity

Will be added soon...

Server-Side Rendering

Will be added soon...

Isomorphism

Will be added soon...

JavaScript templates into PHP through LightnCandy

Will be added soon...

Rendering a Webpage as a Transactional Email

Will be added soon...

Examples

Application extending from the API

Note: The examples below are currently not deployed... Will do so soon...

The native API can be extended by adding the other layers (configuration, view) to create the application:

PHP versions

Requirements:

  • PHP 8.0+ for development
  • PHP 7.1+ for production

Supported PHP features

Check the list of Supported PHP features in leoloso/PoP

Preview downgrade to PHP 7.1

Via Rector (dry-run mode):

composer preview-code-downgrade

Standards

PSR-1, PSR-4 and PSR-12.

To check the coding standards via PHP CodeSniffer, run:

composer check-style

To automatically fix issues, run:

composer fix-style

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

To execute PHPUnit, run:

composer test

Static Analysis

To execute PHPStan, run:

composer analyse

Report issues

To report a bug or request a new feature please do it on the PoP monorepo issue tracker.

Contributing

We welcome contributions for this package on the PoP monorepo (where the source code for this package is hosted).

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email leo@getpop.org instead of using the issue tracker.

Credits

License

GNU General Public License v2 (or later). Please see License File for more information.