evolic/twig-riot

There is no license information available for the latest version (v0.6) of this package.

POC implementation of Rendering Riot.js tags in Twig

v0.6 2020-06-21 22:42 UTC

This package is auto-updated.

Last update: 2024-04-22 07:36:44 UTC


README

POC implementation of Rendering Riot.js tags in Twig.

Twig is everywhere. eZ Platform, Bolt, Drupal 8 and other popular projects have adopted it. At the same time Node.js and Web Components have risen to popularity. This repo demonstrates merging the popular PHP templating library Twig to Riot js, a lightweight React-like library with Node.js.

This Proof of Concept (POC) implementation of a twig function to render Riot.js (https://github.com/riot/riot) components on the server side using an example Yandex Maps component (https://www.symfony.fi/entry/build-a-web-component-with-riot-js-and-yandex-maps).

Read the article describing the internals: https://www.symfony.fi/entry/rendering-riot-js-tags-in-twig-using-node-js

Install

The application is a pretty standard bare bones PHP application. You'll need node and npm installed for rendering as well. Once you've checked out the code, run composer and NPM installs.

curl -s http://getcomposer.org/installer | php
php composer.phar install
npm i

This is by no means an optimal setup nor will I take any responsibility for running this in production.